📋 Introduction to Network Pivoting
Network pivoting is an advanced penetration testing technique that allows ethical hackers to access and compromise systems that are not directly reachable from their attacking machine. This method uses a compromised system as a "pivot point" or "stepping stone" to reach other systems within internal networks that would otherwise be inaccessible.
🎯 Understanding the Pivoting Scenario
Network Topology Overview
(Attacker)
(Compromised)
(Pivot Point)
(Target)
The Windows 10 machine acts as the pivot point, connecting two separate networks
- Kali Linux: Connected to NAT network (10.20.14.x)
- Windows 10: Dual-homed with two network adapters (NAT + Bridged)
- Metasploitable: Connected only to Bridged network (10.20.15.x)
- Target: Metasploitable is invisible to Kali but visible to Windows 10
⚙️ Virtual Machine Network Configuration
Kali Linux Configuration
The Kali Linux machine remains on the NAT network. This is the standard configuration used throughout penetration testing to gain initial access to target systems.
Network Adapter: NAT (Default)Purpose: Initial attack vector
Windows 10 Configuration (Pivot Machine)
The Windows 10 machine requires two network adapters to function as a pivot point. This dual-homed configuration allows it to bridge between the attacker's network and the isolated target network.
Adapter 1: NAT (connects to Kali network)Adapter 2: Bridged (connects to target network)Purpose: Acts as network bridge/pivot point
Metasploitable Configuration (Target)
The Metasploitable machine is configured with only a Bridged network adapter, making it unreachable from the Kali Linux machine directly.
Network Adapter: BridgedIP Address: 10.20.15.4Purpose: Isolated target system
🔍 The Pivoting Process
Phase 1: Initial Access Attempt (Failure)
First, we demonstrate that direct exploitation fails because the target is not visible from the attacker's network.
Phase 2: Network Discovery
Next, we investigate the compromised Windows machine to identify additional network interfaces that might provide access to other networks.
Phase 3: Establishing the Route (Autoroute)
Using Metasploit's autoroute module, we establish a route through the compromised Windows machine to reach the target network.
Routing Flow Diagram
10.20.14.x
10.20.14.5
10.20.15.5
10.20.15.4
Traffic flows through the compromised Windows machine to reach the isolated target
Phase 4: Successful Exploitation Through Pivot
With the route established, we can now successfully exploit the target system through the pivot point.
📊 Comparison: Direct vs. Pivoted Attacks
| Aspect | Direct Attack | Pivoted Attack |
|---|---|---|
| Network Visibility | Target must be on same network or routable | Target can be on isolated network |
| Prerequisites | Direct network access | Compromised pivot machine required |
| Complexity | Simple, single-step | Multi-stage, requires routing |
| Detection Risk | Higher (direct connection) | Lower (traffic appears internal) |
| Tool Availability | All tools available | Limited to uploaded tools or Metasploit modules |
| Real-World Scenario | External perimeter testing | Internal network penetration |
🛠️ Alternative Pivoting Techniques
1. Manual Tool Upload Method
Instead of using Metasploit's routing capabilities, you can manually upload scanning and exploitation tools to the compromised pivot machine.
2. Port Forwarding
Forward specific ports from the target network through the pivot machine to your attacking machine.
3. SOCKS Proxy
Establish a SOCKS proxy through the Meterpreter session for more flexible routing.
⚡ Best Practices and Recommendations
Security Considerations
- Minimize Tool Upload: Uploading tools to compromised systems increases detection risk and leaves forensic evidence. Use built-in tools or Metasploit modules when possible.
- Maintain Session Stability: Keep your pivot session stable and establish backup sessions in case the primary connection is lost.
- Clean Up Routes: Remove autoroutes when finished to avoid leaving persistent backdoors.
- Document Everything: Keep detailed records of all pivoting routes and compromised systems for reporting and cleanup.
Legal and Ethical Warnings
- Only perform pivoting attacks in authorized penetration testing engagements
- Ensure your scope of work explicitly covers internal network testing
- Obtain written permission before accessing systems through pivot points
- Be aware that pivoting can affect production systems and network performance
🎓 Key Takeaways
- Pivoting enables access to isolated networks by using compromised systems as bridges
- Dual-homed machines (systems with multiple network interfaces) make ideal pivot points
- Metasploit's autoroute module simplifies routing configuration for pivoting attacks
- Network reconnaissance on compromised systems reveals additional attack surfaces
- Multiple pivoting methods exist, each with different use cases and advantages
- Stealth and operational security are crucial when conducting pivoted attacks
📚 Further Learning Resources
To deepen your understanding of network pivoting and lateral movement techniques, consider exploring:
- Advanced Metasploit modules for post-exploitation
- SSH tunneling and dynamic port forwarding techniques
- Windows domain pivoting using pass-the-hash attacks
- Network segmentation bypass strategies
- Active Directory lateral movement techniques
- VPN pivoting for complex network environments