Tunneling / Ligolo-NG

PRINCIPLE OF WORK

Tunneling works like a VPN between your machine and compromised hosts. You run a proxy on your machine and an agent on a pivot. When the agent connects back, your machine creates a virtual interface (tun0) — this is basically a fake network card that makes it look like you are inside the internal network.

To actually use it, you add routes. A route is just a rule like:

“if traffic is for 10.10.20.0/24  send it through this agent”

So when you run something like:

nmap 10.10.20.15

your traffic goes into the virtual interface (tun0), the proxy checks its routes, sees that this subnet belongs to a specific agent, and sends the traffic through that agent to the target. The response comes back the same way.

With multiple pivots, agents connect through each other, but you still only control everything from your machine. You just add more routes, and the proxy already knows which agent is reachable through which path, so traffic automatically flows like:

Attacker  Pivot1  Pivot2  Target

You don’t manually chain anything — the interface makes it look local, and the routes decide where traffic goes.

LIGOLO-NG

Ligolo-ng is a simple, lightweight and fast tool that allows pentesters to establish tunnels from a reverse TCP/TLS connection using a tunnel interface.

MANUAL (IP commands)

Creating and managing the TUN interface directly on your attack host without ligolo's built-in commands.

LIGOLO CLI

Managing interface and routing from inside the ligolo-ng proxy console.

circle-info

When you have multiple interfaces for the same subnet, only one route can be active at a time in your routing table. The other interface sits idle until you manually switch the route to it. So if you have setup which requires you to use different interfaces then you should make separate interfaces and use tunnel_start instead of just start

WEB UI

Ligolo-ng has a web interface accessible after proxy starts. Default credentials ligolo:password — change in ligolo-ng.yaml.

Agents — shows all connected agents, configure tunneling per agent, autoroute option available.

Interfaces — create and manage TUN interfaces, add routes to internal subnets.

Listeners — configure port listeners on the agent side to forward traffic back to your attack host.

RESOURCES

Last updated