This attack is possible when we have a shell/rce on a host under an unprivilege user and we don't know his password/hash.
Theory
We spawn a malicious SMB server that forces authentication via NTMLv2 instead of Kerberos
From our shell / rce, we trigger authentication by accessing the share
Our malicious SMB server captures the hash which we can attempt to crack or relay
Crack the hash Attack
Download responder => https://github.com/lgandx/Responder (clone repo and run Responder.py) or it's also already pre-installed on kali but must be run with sudo.
On our kali we spawn responder (make sure to use correct network interface):
sudo responder -I tun0
Then using our rce/shell, we trigger an authentication by accessing the malicious smb server:
We can attempt to crack the hash with hashcat using the NetNTLMv2 attack mode:
Once the password is cracked we now have the credentials of the user we could only interact as via shell/rce.
Relay the hash Attack
Instead of cracking the hash, we relay it to another machine the user as access to. Once authenticated on this new machine, we can trigger a command on behalf of this user.
We start the malicious smb server:
-t is the IP of the new machine we want to authenticate to
-c is the command that will be executed as the user
powershell -enc allows to execute a command that's base64 encoded.