⚑Chisel SOCKS5 Tunneling

πŸ“‹ Module Overview

Purpose: TCP/UDP tunneling using HTTP transport secured with SSH Tool: Chisel - Go-based tunneling tool Protocol: HTTP with SSH encryption Advantage: Bypasses firewall restrictions, SOCKS5 proxy support Use Case: Internal network access, traffic pivoting, RDP tunneling


1. Introduction to Chisel

What is Chisel?

  • Language: Written in Go (Golang)

  • Transport: HTTP-based tunneling

  • Security: SSH encryption for data protection

  • Proxy Support: SOCKS4/SOCKS5 proxy functionality

  • Modes: Client-server and reverse tunneling

  • Platform: Cross-platform (Windows, Linux, macOS)

How Chisel Works

[Attack Host] ←HTTP/SSHβ†’ [Pivot Host] ←Internalβ†’ [Target Network]
Chisel Client              Chisel Server           172.16.5.0/23
SOCKS5 Proxy               Port Forward            Domain Controller
127.0.0.1:1080             Network Bridge          172.16.5.19

Chisel vs Other Tunneling Tools

Aspect

Chisel

SSH Tunnel

Meterpreter

Protocol

HTTP/SSH

SSH

TCP

Firewall Bypass

Excellent

Limited

Good

Setup Complexity

Low

Low

Medium

Performance

High

High

Medium

Platform Support

Cross-platform

Limited

Windows Focus

Binary Size

~11MB

N/A

Large


2. Installation and Setup

Download Specific Version (HTB Academy Compatible)

Download Latest Version

Method 2: Build from Source

Prerequisites

Clone and Build

Cross-compilation for Different Platforms

Binary Size Optimization


3. Normal Mode - Server on Pivot Host

Architecture Overview

Step 1: Transfer Binary to Pivot Host

Step 2: Start Server on Pivot Host

Step 3: Connect Client from Attack Host

Step 4: Configure Proxychains

Step 5: Use Tunnel for RDP


4. Reverse Mode - Server on Attack Host

When to Use Reverse Mode

  • βœ… Firewall blocks inbound connections to pivot host

  • βœ… NAT restrictions prevent external access

  • βœ… Egress-only network policies

  • βœ… Better OPSEC - server on attacker-controlled host

Architecture Overview

Step 1: Start Reverse Server on Attack Host

Step 2: Connect Reverse Client from Pivot Host

Step 3: Configure Proxychains (Same as Normal Mode)


5. HTB Academy Lab Exercise

Lab Challenge

"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."

Lab Environment

  • Target SSH: Ubuntu pivot host with credentials ubuntu:HTB_@cademy_stdnt!

  • Internal Network: 172.16.5.0/23

  • Domain Controller: 172.16.5.19

  • DC Credentials: victor:pass@123

  • Flag Location: C:\Users\victor\Documents\flag.txt

  • Expected Flag: Th3$eTunne1$@rent8oring!

Complete Lab Solution

Step 1: Download Chisel v1.7.6

Step 2: Transfer to Pivot Host

Step 3: SSH to Pivot Host

Step 4: Start Chisel Server on Pivot

Step 5: Connect Client from Attack Host

Step 6: Configure Proxychains

Step 7: RDP to Domain Controller

Step 8: Retrieve Flag

Lab Solution Summary


6. Advanced Chisel Techniques

Port Forwarding (Local)

Port Forwarding (Remote)

Multiple Tunnels

HTTP Proxy Mode


7. Troubleshooting

Common Issues

Version Compatibility

Connection Issues

SOCKS Version Mismatch (COMMON)

SOCKS Proxy Not Working

Binary Transfer Issues

Performance Optimization


8. Operational Security (OPSEC)

Stealth Considerations

  1. HTTP Traffic - appears as web traffic

  2. Custom User-Agent - avoid detection signatures

  3. Port Selection - use common HTTP ports (80, 8080, 8000)

  4. Traffic Analysis - WebSocket upgrade patterns

  5. Binary Artifacts - temporary files, process names

Detection Evasion

Cleanup Commands


9. Integration with Other Tools

Metasploit Integration

Nmap through Tunnel

Web Application Testing


10. Alternative Tools Comparison

Chisel vs Similar Tools

Tool

Protocol

Encryption

Proxy Type

Platform

Size

Chisel

HTTP/WebSocket

SSH

SOCKS4/5, HTTP

Cross-platform

~11MB

SSF

TCP

TLS

SOCKS4/5

Cross-platform

~15MB

ngrok

HTTP/HTTPS

TLS

HTTP

Cross-platform

~25MB

frp

TCP/HTTP

TLS

Multiple

Cross-platform

~20MB

Ligolo

TUN/TAP

TLS

Network layer

Cross-platform

~10MB

When to Choose Chisel

βœ… HTTP-friendly environments βœ… WebSocket support required βœ… SSH encryption needed βœ… Cross-platform compatibility βœ… SOCKS proxy functionality βœ… Moderate binary size acceptable


References

Last updated