11. SOCKS5 tunneling w Chisel

Chisel is a TCP/UDP-based tunneling tool written in Go 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.

git clone https://github.com/jpillora/chisel.git
cd chisel
go build
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

./chisel server -v -p 1234 --socks5

Connecting to chisel server from attacking host

./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)

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