sshuttle
Transparent proxy server for VPN over SSH. Forwards all traffic through an SSH tunnel to access remote networks.
Description
Sshuttle makes it possible to access remote networks using SSH. It creates a transparent proxy server, using iptables, that will forward all the traffic through an SSH tunnel to a remote copy of sshuttle. It does not require installation on the remote server, which just needs to have Python installed.
This tool is particularly useful for creating VPN-like functionality without needing root access or special software on the target server. It leverages existing SSH connectivity to route traffic transparently, making it ideal for secure network access in pentesting scenarios.
Sshuttle is featured in OffSec's PEN-200 course under Port Redirection and SSH Tunneling.
How It Works
Sshuttle operates by creating a transparent proxy server using iptables (or nftables) on the local machine. It captures traffic destined for specified subnets and forwards it through an SSH tunnel to a remote sshuttle instance running over SSH. The remote side requires only Python. Local DNS requests can be captured and forwarded to the remote DNS server. The solution uses SSH for secure tunneling without needing VPN server installation.
Installation
sudo apt install sshuttleFlags
Examples
sshuttle -hsshuttle -r user@sshserver 192.168.1.0/24sshuttle -l 0.0.0.0:2222 -r user@sshserver 10.0.0.0/8sshuttle --dns -r user@sshserver 172.16.0.0/12sshuttle -H -r user@sshserver 192.168.0.0/16sshuttle -N -r user@sshserver