Port Redirection and Tunneling
SSH Local Port Forwarding
On Attacker Machine:
Use the following command to establish local port forwarding:
sudo ssh -L localhost:local-port:target:remote-port user@mediatorReplace
localhost,local-port,target,remote-port,user, andmediatorwith appropriate values.This redirects traffic from the local machine's
local-portto thetarget:remote-portthrough themediatormachine.
SSH Remote Port Forwarding
On Victim Machine:
Use the following command to establish remote port forwarding:
sudo ssh -R 8080:127.0.0.1:80 kali@192.168.1.15Replace
8080,127.0.0.1:80,kali, and192.168.1.15with appropriate values.This redirects traffic from the victim machine's
127.0.0.1:80to the attacker's machine on port8080.
SSH Dynamic Port Forwarding
Use the following command to establish dynamic port forwarding:
ssh -D 8080 user@ipReplace
8080,user, andipwith appropriate values.This creates a dynamic SOCKS proxy on the local machine, redirecting traffic through the specified SSH server.
Last updated
Was this helpful?