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
sshuttle -r <USER>@10.10.10.10 --dns --to-ns 8.8.8.8 0/0Forward DNS to a specific nameserver on the remote side
sshuttle -r <USER>@10.10.10.10 -H 192.168.1.0/24Auto-populate /etc/hosts from remote hostnames (scan hosts)
sshuttle -r <USER>@10.10.10.10 --seed-hosts host1,host2 -H 0/0Seed the host auto-scan with known hostnames
sshuttle -r <USER>@10.10.10.10 --python /usr/bin/python3 0/0Specify which Python interpreter to run on the remote host
sshuttle -r <USER>@10.10.10.10 --no-latency-control 0/0Favor bandwidth over latency for bulk transfers
sshuttle -r <USER>@10.10.10.10 --ssh-cmd 'ssh -v' 0/0Override the SSH command used to build the tunnel
sudo sshuttle -r <USER>@10.10.10.10 0/0Run with root so sshuttle can install firewall rules
sshuttle --sudoers-no-modifyPrint a sudoers snippet allowing sshuttle's firewall setup without editing sudoers
sshuttle --versionPrint the installed sshuttle version
sshuttle --helpDisplay the full list of options and usage

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

Post Exploitation

Chisel is a fast TCP/UDP tunnel utility that encapsulates traffic over an HTTP transport channel, secured via SSH. It is useful for traversing firewall boundaries and pivoting inside network environments.

ProxyChains

Post Exploitation

ProxyChains forces TCP connections made by arbitrary applications to follow user-configured proxy networks (such as TOR or SOCKS4/5 configurations), useful for obfuscation and internal pivoting.

WireGuard

Maintaining Access

WireGuard is an extremely fast, modern VPN protocol that lives inside the Linux kernel and uses state-of-the-art cryptography — Curve25519 key exchange, ChaCha20Poly1305 encryption, and the Noise protocol framework — in a core codebase of only a few thousand lines. In penetration testing and red team work it creates secure, persistent tunnels for pivoting into internal networks and maintaining encrypted access, while system administrators use the same tool for site-to-site links and road-warrior VPNs. Every peer is identified by a single public key, traffic is bound to that key by cryptokey routing (AllowedIPs), and the protocol stays completely silent toward unauthenticated packets, which makes a WireGuard port nearly invisible to scanners.

Evil-WinRM

Post Exploitation

Learn how to use Evil-WinRM, a Ruby-based client for the Windows Remote Management (WinRM) protocol. This guide covers installation, your first connection, password, pass-the-hash and Kerberos authentication, file transfers and script execution, all for use in authorized lab environments.

LinPEAS

Post Exploitation

LinPEAS is a script that searches for possible paths to escalate privileges on Linux hosts. It highlights findings using colors to signal potential misconfigurations or vulnerabilities.

Mimikatz

Post Exploitation

Mimikatz is a powerful post-exploitation tool that exposes vulnerabilities in Windows authentication protection mechanisms, capable of extracting plaintexts passwords, hashes, PINs, and kerberos tickets from memory.

Related Cybersecurity Guides

Active Directory · Advanced

Active Directory Fundamentals: Windows Network Domains

A comprehensive introduction to Microsoft Active Directory covering domain services, LDAP, Group Policy, authentication protocols, and security fundamentals for Windows enterprise environments.

Active Directory · Advanced

Pass-the-Hash: Understanding NTLM Authentication Attacks

An in-depth look at pass-the-hash attacks against NTLM authentication, how they work, real-world exploitation scenarios, detection techniques, and defense strategies.

Active Directory · Advanced

BloodHound Guide: Mapping Active Directory Relationships

Learn how to use BloodHound and SharpHound for Active Directory reconnaissance, attack path analysis, privilege escalation detection, and security assessment.

Active Directory · Advanced

Domain Enumeration: Active Directory Reconnaissance Techniques

Comprehensive guide to Active Directory enumeration using native tools, PowerShell, and specialized utilities for discovering users, groups, computers, and trust relationships.

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.