PORT FORWARDING WITH SSH AND SOCKS TUNNELING¶
EXECUTING LOCAL PORT FORWARD¶
-
Forward local port 1234 to MySQL port 3306 on the Ubuntu server:
ssh -L 1234:localhost:3306 ubuntu@[TARGET-IP]
-
Forwarding Multiple Ports
ssh -L 1234:localhost:3306 -L 8080:localhost:80 ubuntu@10.129.202.64
-
Confirming Port Forward with Netstat
netstat -antp | grep 1234
-
Confirming Port Forward with Nmap
nmap -v -sV -p1234 localhost
DYNAMIC PORT FORWARDING WITH SSH AND SOCKS TUNNELING¶
-
Start SSH client to enable dynamic port forwarding:
ssh -D 9050 ubuntu@10.129.202.64
-
Modify /etc/proxychains.conf to include:
socks4 127.0.0.1 9050
-
Using Nmap with Proxychains
proxychains nmap -v -sn 172.16.5.1-200
-
Enumerating Windows Target through Proxychains
proxychains nmap -v -Pn -sT 172.16.5.19
-
Using xfreerdp with Proxychains
proxychains xfreerdp /v:172.16.5.19 /u:victor /p:pass@123