Pivoting from Web Server to Internal Network
A compromised web server typically has access to internal network segments not reachable from the attacker's position. The web server often connects to internal databases, APIs, and management interfaces. Pivoting routes attacker traffic through the compromised host to reach those internal services. Establish a stable shell first through web shell management before setting up tunnels.
Internal Network Discovery
Map what the web server can reach before setting up tunneling infrastructure:
inet 10.10.10.50/24 brd 10.10.10.255 inet 172.16.0.10/24 brd 172.16.0.255 default via 10.10.10.1
172.16.0.1 alive 172.16.0.20 alive 172.16.0.50 alive
172.16.0.20:22 open 172.16.0.20:3306 open 172.16.0.20:8080 open
chisel SOCKS Proxy
chisel creates an encrypted tunnel with a SOCKS5 proxy. Upload the binary to the target and connect back to your Kali server. All traffic proxied through the tunnel reaches the internal network:
2026/03/28 12:00:00 server: Listening on http://0.0.0.0:4444
client: Connected (Latency 2.3ms)
Configure proxychains on Kali to route through the SOCKS5 proxy chisel creates on port 1080:
22/tcp open ssh 3306/tcp open mysql 8080/tcp open http-proxy
ligolo-ng for Better Performance
ligolo-ng performs better than chisel for sustained tunneling. It creates a tun interface on Kali so proxychains is not needed — traffic routes naturally:
SSH Port Forwarding
When SSH credentials are available on the compromised host, SSH port forwarding is the most stable and reliable tunneling option:
-D 1080 creates a SOCKS5 dynamic proxy. -L local:remote forwards a specific port. Use local forwarding when you need to reach a single internal service directly — it is simpler and more stable than a SOCKS proxy for targeted access.
Web Shell as HTTP Proxy
When no binary upload is possible, a PHP web shell can proxy HTTP requests to internal services using curl or file_get_contents. Useful for quick one-off requests to internal APIs:
{"admin":true,"users":[]}
References
-
TCP tunnel over HTTP with SOCKS5 proxy support
-
Advanced tunneling using TUN interface for transparent network access
Was this helpful?
Your feedback helps improve this page.