RED TEAM TOOLING//CHISEL//PORT FORWARDING//SOCKS5//AUTHORIZED TESTING//CHISEL//PORT FORWARDING//
← PIVOTING

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.

CHISELPORT FORWARDINGSOCKS5PROXYCHAINSKALI LINUX
Scope & safety: Tunnels can expose internal services through a host that is reachable from your testing system. Use only on systems and networks explicitly in scope, bind listeners as narrowly as practical, and close tunnels when finished. The IPs, ports, usernames, and hostnames below are examples—replace them with values from your lab. Do not use these commands to evade controls on networks you do not administer or have permission to test.

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.

Install Chisel on Kali / Debian
sudo apt update && sudo apt install chisel

Package availability and version depend on the distribution repository.

Check installed version and options
chisel --help

Use chisel server --help and chisel client --help to confirm options for your installed version.

Official releases
https://github.com/jpillora/chisel/releases

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

Show addresses and routes
ip -br addr ip route

Identify the interface and route used to reach the approved target network.

Inspect TCP listeners and connections
ss -lntp ss -nt

Some process details require elevated privileges. Prefer ss; netstat may not be installed.

Test a known in-scope service
nc -vz 10.10.20.15 8080

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

On the testing host — start reverse-enabled server
chisel server --port 8000 --reverse

Keep the server port reachable only from the intended client where possible. Do not expose it broadly to the internet.

On the client host — forward server port 8443 to its local service 443
./chisel client 10.10.10.5:8000 R:8443:127.0.0.1:443

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

Test the forwarded service from the testing host
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.

Reverse forward to a different in-scope host
./chisel client 10.10.10.5:8000 R:9001:10.10.20.15:9001

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

Start a standard Chisel server
chisel server --port 8000

Run this on the host acting as the Chisel server.

On the client — map local port 8888 to a server-reachable service
./chisel client 10.10.10.5:8000 8888:127.0.0.1:8080

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

Connect through the local tunnel
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.

On the testing host — enable reverse tunneling
chisel server --port 8000 --reverse

Use a firewall rule to restrict which clients can connect to the Chisel server.

On the client — request a reverse SOCKS listener
./chisel client 10.10.10.5:8000 R:socks

The default reverse SOCKS listener is typically on the server's loopback port 1080. Verify the log output and version-specific behavior.

Check SOCKS listener on the testing host
ss -lntp | grep 1080

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

Install ProxyChains on Kali
sudo apt install proxychains4

On some systems the configuration file is /etc/proxychains4.conf.

Back up the configuration before editing
sudo cp /etc/proxychains4.conf /etc/proxychains4.conf.bak

Edit the file with your preferred text editor and ensure the active proxy entry matches the actual SOCKS listener.

ProxyList entry for a local SOCKS5 listener
socks5 127.0.0.1 1080

Place this under [ProxyList] in the configuration file. Comment out any unused example proxy entries to avoid confusion.

Test HTTP through the SOCKS proxy
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.

Check selected TCP ports through ProxyChains
proxychains4 nc -zvn 10.10.20.15 21 22 80 443

Only scan addresses and ports explicitly authorized for assessment. Results may vary by application compatibility and proxy behavior.

07 // Troubleshooting checklist

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.

Command copied to clipboard