HTTP Tunneling

Our scenario:

  • We have compromised CONFLUENCE01 and can execute commands through HTTP requests.

  • A DPI solution (FIREWALL/INSPECTOR) is blocking all outbound traffic except HTTP, and only TCP port 8090 is open on CONFLUENCE01. This means we can use tools like curl and wget.

  • As a result, a standard reverse shell or an SSH remote port forward, which doesn't follow the HTTP format, would be blocked by the DPI.

  • We have obtained credentials for PGDATABASE01.

  • Our goal is to SSH directly from Kali to CONFLUENCE01.

chisel is an HTTP tunneling tool that encapsulates data within HTTP packets and uses SSH for encryption, allowing secure data transmission through firewalls or restrictive networks.

  1. We’ll run a Chisel server on the Kali machine to accept a connection from a client on CONFLUENCE01.

  2. The server will bind a SOCKS proxy port, tunnel traffic through an SSH-encrypted HTTP connection, and the client will forward it to its destination.

Chisel tunnels traffic over HTTP, bypassing DPI. The Kali Chisel server listens on TCP port 1080 (SOCKS proxy). Traffic sent to this port is encapsulated in HTTP, sent to the client, and forwarded to its destination.

We get a new connection on the Chisel server.

In case of errors.

Our SOCKS proxy on Kali listens at 127.0.0.1:1080. To connect SSH through it to PGDATABASE01, we'll use SSH’s ProxyCommand option, which lets us define a proxy-aware connection method. While OpenBSD Netcat supports this natively, Kali’s version doesn’t — so we’ll use ncat, the Nmap team’s Netcat alternative, which does.

We’ll pass an ncat command to ProxyCommand, telling it to use the SOCKS5 proxy at 127.0.0.1:1080. The %h and %p tokens are placeholders SSH replaces with the target host and port before executing the command.

Last updated

Was this helpful?