Pivoting, Tunneling & Port Forwarding
Enumeration
# Enumeration commands
ip a
ip route
ss -ntplu
# Starting tcpdump to listen on TCP/8080 through the tun0 interface
sudo tcpdump -nvvvXi tun0 tcp port 8080Port Forwarding
Local Port Forwarding
# Forward port 3306 from remote host to local port 1234 using ssh on port 22
# [LOCAL_IP:]LOCAL_PORT:DEST_IP:DEST_PORT
ssh -N -L 0.0.0.0:4455:172.16.5.217:445 ubuntu@10.10.10.10
# Metasploit Meterpreter
# start a listner local port 3300 and frwd trafic to the remote host on port 3389
meterpreter > portfwd add -l 3300 -p 3389 -r 172.16.5.129
Dynamic Port Forwarding

Reverse Port Forwarding

SSH Remote Dynamic Port Forwarding

Socat Redirection
SSH Pivoting with sshuttle
SSH for Windows
Port Forwarding with Windows netsh
Web Server Pivoting with Rpivot
Tunneling
DNS Tunneling with Dnscat2
SOCKS5 Tunneling with Chisel
ICMP Tunneling with SOCKS
RDP and SOCKS Tunneling with SocksOverRDP
Ligolo-ng
Last updated