---
title: "11. SOCKS5 tunneling w Chisel"
date: 2024-08-25
draft: false
---

[Chisel](https://github.com/jpillora/chisel) is a TCP/UDP-based tunneling tool written in [Go](https://go.dev/) that uses HTTP to transport data that is secured using SSH. `Chisel` can create a client-server tunnel connection in a firewall restricted environment.

Consider scenario to tunnel traffic on 172.16.5.0/23 internal subnet 
DC with address 172.16.5.19 - not directly accessible. Attack host and domain controller on different network segments. 
We've compromised ubuntu SSH and can start chisel server that will listen on a port and forward traffic to internal network. 

```bash
git clone https://github.com/jpillora/chisel.git
cd chisel
go build
```


```bash
It can be helpful to be mindful of the size of the files we transfer onto targets on our client's networks, not just for performance reasons but also considering detection. Two beneficial resources to complement this particular concept are Oxdf's blog post "Tunneling with Chisel and SSF" and IppSec's walkthrough of the box Reddish. IppSec starts his explanation of Chisel, building the binary and shrinking the size of the binary at the 24:29 mark of his video.
```

Run `chisel` server on pivot host 
```bash
./chisel server -v -p 1234 --socks5
```

Connecting to chisel server from attacking host
```bash
./chisel client -v 10.129.202.64:1234 socks
```

![](/img/Pasted image 20240825150440.png)

NOTE: You may have to download a separate release of chisel if the most recent version is not supported on the pivot host. In this case I had to wget the 1.5.2 binary and use that instead on the ubuntu server. 

update proxychains: 

![](/img/Pasted image 20240825150612.png)

+ 1  Using the concepts taught in this section, connect to the target and establish a SOCKS5 Tunnel that can be used to RDP into the domain controller (172.16.5.19, victor:pass@123). Submit the contents of C:\Users\victor\Documents\flag.txt as the answer.
![](/img/Pasted image 20240825150721.png)

![](/img/Pasted image 20240825150734.png)

