Pivoting & Tunneling
Pivoting is moving to other networks through a compromised host to find multiple targets on different network segments and Tunneling is the obfuscation of our actions to avoid detection.
SSH
ssh -N -L [<C_IP>:]<C_PORT>:<S_TRAGET_IP>:<S_TARGET_PORT> <S_USER>@<S_IP>ssh -N -D [<C_IP>:]<C_PORT> <S_USER>@<S_IP>vim /etc/proxychains[4].conf
# socks4 127.0.0.1 <C_PORT>sudo proxychains[4] <COMMAND> ssh -N -R [<S_IP>:]<S_PORT>:<C_TRAGET_IP>:<C_TARGET_PORT> <S_USER>@<S_IP>ssh -N -R [<S_IP>:]<S_PORT> <S_USER>@<S_IP>Metasploit
post/multi/manage/autoroute # set network and sessionroute add <NETWORK> <SESSION>run autoroute -s <NETWORK># Set Routeauxiliary/server/socks_proxy # set vSocks 4a or 5 and PORTvim etc/proxychains[4].conf
# socks4 127.0.0.1 <PORT>sudo proxychains[4] <COMMAND>portfwd add -l <C_PORT> -p <S_TARGET_PORT> -r <S_TRAGET_IP>portfwd add -R -l <C_TARGET_PORT> -p <S_PORT> -L <C_TRAGET_IP>Other
Simple Port Forwarding (single-host)
Tunneling
Warning
Last updated