Port forwarding and tunneling are techniques used to forward network traffic from one host to another. This can be useful for bypassing firewalls, accessing services on a remote network, or creating a secure connection between two hosts.

  • SSH port forwarding
# Host machine
ssh -L 8080:localhost:80 user@remote_host
# Host machine
sudo chisel server --reverse -v -p 1234 --socks5
 
# Target machine (Windows)
.\chisel.exe client -v 10.10.16.11:1234 R:socks
 
# Target machine (Linux)
./chisel client -v 10.10.16.11:1234 R:socks

Info

I found the ligolo-ng available on Kali Linux is not well maintained, I had several issues with it. I recommend using the version from the GitHub repository.

# Host machine
sudo ./proxy -selfcert
 
# Target machine
./agent -connect <host>:11601 -ignore-cert
 
# After establishing the connection (on host machine):
session
autoroute