-L
option for a local port forwarding, along with the ports and addresses to bind-R
option for a remote port forwarding, along with the ports and addresses to bind-N
option to make sure no command gets executed after the SSH session is opened.portfwd
cmdlet.-l
option for a local port forwarding, along with the ports and addresses to bind.-p
option for a remote port forwarding, along with the ports and addresses to bind.-r
option for the targeted remote machine IP address.nc
utility can be used to setup local port forwarding.80/TCP
by targeting port 1111/TCP
on his own machine. His machine will forward the communication to pivot1's port 2222/TCP
. Pivot1 will forward to pivot2's 3333/TCP
. Pivot2 will forward to workstation's 80/TCP
.1111/TCP
by targeting pivot2 on port 3333/TCP
. Pivot2 will forward the communication to pivot1's port 2222/TCP
which will itself forward to attacker's port 1111/TCP
./etc/ssh/sshd_config
has the GatewayPorts
option set to yes
or clientspecified
.