GO KALI FREE

sshuttle

Post Exploitation

Intermediatelow risk

sshuttle acts as a transparent proxy server that forwards traffic over an SSH connection, configuring local routing rules without requiring administrator privileges on the remote server host.

Installation

sudo apt install sshuttle

Basic Syntax

sshuttle -r [user@]sshserver[:port] <subnets>

Quick Facts

Full Name
sshuttle
License
LGPL
Language
Python
Interface
CLI
Category
VPN / Pivoting
Requires
SSH Access to Pivot Host

Tool Overview

sshuttle is a transparent proxy VPN that forwards traffic over SSH without requiring administrator access on the remote server. It provides a quick and easy way to access internal networks through a pivot host.

By modifying local routing rules, sshuttle transparently routes traffic for specified subnets through an encrypted SSH tunnel, making it an essential tool for network pivoting in penetration testing.

Common Commands

sshuttle -r <USER>@10.10.10.10 0/0Tunnel all IPv4 traffic through the remote SSH host (full VPN-over-SSH)
sshuttle -r <USER>@10.10.10.10 192.168.1.0/24Route only the given subnet through the remote host
sshuttle -r <USER>@10.10.10.10 192.168.1.0/24 10.0.0.0/8Tunnel multiple subnets in a single session
sshuttle -r <USER>@10.10.10.10 --dns 0/0Also intercept and forward DNS queries through the tunnel
sshuttle -r <USER>@10.10.10.10 -NAuto-detect the remote networks (routes) and tunnel them
sshuttle -r <USER>@10.10.10.10 -x 10.10.10.10 0/0Tunnel everything except the SSH host's own address
sshuttle -r <USER>@10.10.10.10 -x 192.168.1.5 192.168.1.0/24Tunnel a subnet but exclude a specific host
sshuttle -r <USER>@10.10.10.10 -X /path/to/exclude.txt 0/0Exclude subnets listed in a file from the tunnel
sshuttle -r <USER>@10.10.10.10 -v 192.168.1.0/24Run with verbose output for troubleshooting
sshuttle -r <USER>@10.10.10.10 -vv 192.168.1.0/24Run with very verbose (debug-level) output
sshuttle -r <USER>@10.10.10.10 -D 0/0Run as a background daemon
sshuttle -r <USER>@10.10.10.10 -D --pidfile /path/to/sshuttle.pid 0/0Daemonize and write the PID to a file for later control
sshuttle -r <USER>@10.10.10.10:2222 192.168.1.0/24Connect to SSH on a non-default port via the remote spec
sshuttle -r <USER>@10.10.10.10 -e 'ssh -i /path/to/key.pem' 0/0Use a custom SSH command, e.g. to supply an identity key
sshuttle -r <USER>@10.10.10.10 -l 0.0.0.0:12300 0/0Bind the local transparent proxy to a specific address/port

Step-by-Step Guide

  1. 1Ensure you have elevated rights on your local machine to alter routing tables
  2. 2Confirm you can establish a standard SSH connection to the intermediate host
  3. 3Execute the tool, defining the remote subnets you wish to access
  4. 4Access internal services as if your machine were physically on the target network

Warnings

Use Cases

Network Pivoting

Route traffic through SSH jump host.

Internal Scanning

Nmap internal subnets through tunnel.

Service Access

Access internal web/app servers transparently.

File Transfers

Transfer files via tunnel tools without proxy config.

Key Features

Related Tools

Chisel

Maintaining Access

HTTP tunnel with SOCKS proxy.

ProxyChains

Maintaining Access

Route apps through proxy chains.

WireGuard

Maintaining Access

Modern VPN for persistent tunnels.

Frequently Asked Questions

What is sshuttle used for?

sshuttle creates a transparent VPN-like tunnel over SSH, forwarding traffic destined for specific subnets through an SSH connection without requiring administrator privileges on the remote server.

How is sshuttle different from a regular SSH proxy?

Unlike SSH dynamic port forwarding (-D), sshuttle works as a full VPN at the network layer, modifying local routing tables to transparently redirect traffic. No per-tool proxy configuration needed.

Does sshuttle require admin on the remote server?

No, sshuttle does not require root or admin privileges on the SSH server. It only needs SSH access and Python on the client side. The server just needs standard SSH.

Can sshuttle forward DNS traffic?

Yes, sshuttle forwards DNS requests through the SSH tunnel by default. Use the --dns flag to ensure target DNS queries are resolved through the remote network.

Tags

#post-exploitation#pivoting#vpn#ssh

Output Explanation

Indicates when the secure tunnel is active. Once running, the terminal acts as a background process while network traffic is silently redirected.

Ethical Usage Notice

This tool is designed for authorized security testing, educational purposes, and legitimate network administration only. Unauthorized access to computer systems is illegal.