CS-07 // RED TEAM TOOLING
CHISEL TUNNELING
A practical reference for Chisel TCP tunnels, reverse port forwarding, SOCKS5, and ProxyChains. Use these patterns to understand and validate network reachability during an authorized penetration test or in your own lab.
01 // Install & verify
Install the distribution package on Kali/Debian-based systems, or use a release binary from the official project. Check the binary architecture before transferring it to another host.
sudo apt update && sudo apt install chiselPackage availability and version depend on the distribution repository.
chisel --helpUse chisel server --help and chisel client --help to confirm options for your installed version.
https://github.com/jpillora/chisel/releasesDownload only from the upstream project and choose the correct operating system and architecture.
02 // Check the network first
Confirm interface addresses, routes, listening services, and the intended target port before creating a tunnel.
ip -br addr
ip routeIdentify the interface and route used to reach the approved target network.
ss -lntp
ss -ntSome process details require elevated privileges. Prefer ss; netstat may not be installed.
nc -vz 10.10.20.15 8080Replace the sample address and port. A failed direct test may be caused by routing, filtering, or the service being down.
03 // Reverse port forwarding
Use this pattern when the client host can reach the Chisel server, but the testing machine needs to reach a service available from the client. In reverse mappings, R: requests a listener on the server side.
chisel server --port 8000 --reverseKeep the server port reachable only from the intended client where possible. Do not expose it broadly to the internet.
./chisel client 10.10.10.5:8000 R:8443:127.0.0.1:443Replace 10.10.10.5 with the testing host address reachable by the client. The server-side listener on port 8443 forwards to the client's loopback port 443.
curl -vk https://127.0.0.1:8443/Use the protocol that matches the target service. -k skips certificate validation for diagnosis only; omit it when validating TLS trust.
./chisel client 10.10.10.5:8000 R:9001:10.10.20.15:9001The client-side host must be able to reach 10.10.20.15:9001. This maps a server-side port 9001 to that destination through the client.
04 // Local port forwarding
Local forwarding opens a port on the client machine and sends connections through the tunnel to a destination reachable from the server. This is useful when the testing host can reach the Chisel server.
chisel server --port 8000Run this on the host acting as the Chisel server.
./chisel client 10.10.10.5:8000 8888:127.0.0.1:8080This opens port 8888 on the client and forwards it through the server to the server's 127.0.0.1:8080. The destination is interpreted from the server side.
curl http://127.0.0.1:8888/Run this on the client where the local forwarding listener was created.
05 // SOCKS5 dynamic proxy
A SOCKS tunnel can route supported TCP connections through the client network. In this reverse pattern, Chisel exposes a SOCKS listener on the server side.
chisel server --port 8000 --reverseUse a firewall rule to restrict which clients can connect to the Chisel server.
./chisel client 10.10.10.5:8000 R:socksThe default reverse SOCKS listener is typically on the server's loopback port 1080. Verify the log output and version-specific behavior.
ss -lntp | grep 1080If no listener appears, inspect the Chisel server/client logs and confirm the tunnel is established.
06 // ProxyChains integration
ProxyChains can send compatible TCP applications through the local SOCKS proxy. It does not transparently proxy every application or UDP traffic.
sudo apt install proxychains4On some systems the configuration file is /etc/proxychains4.conf.
sudo cp /etc/proxychains4.conf /etc/proxychains4.conf.bakEdit the file with your preferred text editor and ensure the active proxy entry matches the actual SOCKS listener.
socks5 127.0.0.1 1080Place this under [ProxyList] in the configuration file. Comment out any unused example proxy entries to avoid confusion.
proxychains4 curl -I http://10.10.20.15:8080/Use an in-scope destination that is reachable from the client host. The target may not be reachable directly from the testing machine.
proxychains4 nc -zvn 10.10.20.15 21 22 80 443Only scan addresses and ports explicitly authorized for assessment. Results may vary by application compatibility and proxy behavior.
07 // Troubleshooting checklist
- Client cannot connect: verify server IP/port, routing, firewall rules, and that the server is listening.
- Connection established but service fails: confirm the destination is reachable from the correct side of the tunnel and that the service is listening on the expected interface/port.
- Reverse forwarding fails: confirm the server was started with --reverse and the client uses an R: mapping.
- SOCKS proxy is missing: inspect Chisel logs and ss -lntp; check the expected listener port and loopback binding.
- ProxyChains does not work: verify the config path, active [ProxyList] entry, and whether the application uses TCP and is compatible with ProxyChains.
- Permission denied: confirm the binary matches the host architecture and has execute permission, e.g. chmod u+x ./chisel.
- Cleanup: stop the client and server processes when the test ends, remove temporary binaries, and document the tunnel endpoints used.
References
Command examples are adapted into a concise reference from the supplied Chisel guide. Verify syntax against your installed version and validate all tunnels in an isolated lab before an engagement.