Pivoting with hidden-portforwarding and Chisel

At this point, Victim1 is already compromised. In order to reach Victim2 (the network-isolated machine), we will use Victim1 as a pivot. To achieve our goal, we will use hidden-portforwarding together with Chisel.

As shown in the following illustration, the victim will publish a Hidden Service that routes TCP traffic to the Chisel Server (running in the pivot). Once the Chisel server is reached from the Chisel client, an SOCKS5+HTTP tunnel is established so that we can send packets through it.

Hidden Port Forwarding for Chisel tunnel

1. Run Chisel Server in the pivot

As described in the Chisel documentation, we can start the Chisel server as a SOCKS5 proxy by executing the following command:

Now Chisel server is ready to get connections from the Chisel client.

2. Chisel Server reachable from Tor

In order to reach the Chisel Server from the Chisel Client preserving the anonimity, we will use hidden-portforwarding. This tool will allow us to redirect TCP packets from a new Hidden Service to the TCP port where Chisel Server is listening.

The tool will need to receive:

1) the -data-dir parameter to preserve the onion address,

2) the -hidden-port parameter with the port you want for the Hidden Service and

3) the -forward parameter with the TCP socket you want to send traffix to.

3. Chisel tunnel establishment

Now that Chisel Server is reachable though the hidden-portforwarding tool, we will connect from Chisel Client. We can set the --proxy parameter to use the Tor instance proxy:

Now, Chisel Client is serving a SOCKS5 proxy on 1080 port that will route traffic to the Chisel Server:

4. Send traffic through the tunnel

In order to connect to the SOCKS5 proxy that Chisel Client serves, we will use proxychains4:

Now, let's try a simple port scanning against Victim2:

Last updated

Was this helpful?