πΈοΈRpivot Web Pivoting
π Module Overview
Purpose: Reverse SOCKS proxy for web server pivoting Tool: Rpivot - Python-based reverse SOCKS proxy Mechanism: Client connects back to server (reverse connection) Use Case: Access internal web servers through compromised hosts Special Feature: NTLM authentication support for corporate proxies
1. Introduction to Rpivot
What is Rpivot?
Type: Reverse SOCKS proxy tool
Language: Python (requires Python 2.7)
Architecture: Client-server model
Direction: Client connects TO server (reverse)
Purpose: SOCKS tunneling through compromised internal hosts
Rpivot vs Traditional SOCKS
Aspect
Traditional SOCKS
Rpivot
Connection Direction
Server waits, client connects
Client connects back to server
Firewall Bypass
May be blocked inbound
Better (outbound connections)
Setup Location
SOCKS server on pivot
Server on attack host
Use Case
Direct network access
Compromised internal hosts
Authentication
Basic SOCKS auth
NTLM proxy support
Network Topology
Key Components
server.py - runs on attack host (external)
client.py - runs on pivot host (internal)
SOCKS proxy - created on attack host for tools
proxychains - routes traffic through SOCKS proxy
2. Installation and Setup
Installing Rpivot
Clone Repository
Python 2.7 Dependency
Alternative Python 2.7 Installation
Verification
3. Basic Rpivot Usage
Step 1: Start Rpivot Server (Attack Host)
Server Configuration:
--proxy-port 9050: SOCKS proxy port for tools
--server-port 9999: Control port for client connections
--server-ip 0.0.0.0: Listen on all interfaces
Step 2: Transfer Rpivot to Target
Step 3: Run Rpivot Client (Pivot Host)
Step 4: Confirm Connection (Attack Host)
4. Accessing Internal Web Servers
Configure Proxychains
Web Server Access Methods
Method 1: Firefox with Proxychains
Method 2: Curl with Proxychains
Method 3: Nmap Scanning
5. Advanced Rpivot Features
NTLM Authentication Support
Scenario: Corporate environment with NTLM proxy
Custom Port Configuration
Multiple Client Support
6. HTB Academy Lab Exercises
Lab Question 1: Server Location
"From which host will rpivot's server.py need to be run from? The Pivot Host or Attack Host?"
Answer: Attack Host
Explanation:
server.py runs on the attack host (external)
Creates SOCKS proxy for tools to use
Listens for incoming connections from clients
Provides external access point for internal clients
Technical Reasoning:
Lab Question 2: Client Location
"From which host will rpivot's client.py need to be run from? The Pivot Host or Attack Host?"
Answer: Pivot Host
Explanation:
client.py runs on the pivot host (internal)
Connects back to server on attack host
Provides access to internal network resources
Acts as bridge between internal and external networks
Technical Reasoning:
Lab Question 3: Web Server Flag
"Using the concepts taught in this section, connect to the web server on the internal network. Submit the flag presented on the home page as the answer."
Complete Solution Steps
Step 1: Setup Rpivot Server
Step 2: Transfer and Run Client
Step 3: Configure Proxychains
Step 4: Access Web Server
Answer: [Flag will be displayed on the web page]
7. Troubleshooting Rpivot
Common Issues
Python 2.7 Not Available
Server Connection Refused
SOCKS Proxy Not Working
File Transfer Issues
8. Operational Considerations
Advantages of Rpivot
Reverse connection - bypasses inbound firewall restrictions
NTLM support - works with corporate proxy authentication
Multiple clients - supports multiple pivot points
Python-based - cross-platform compatibility
Simple setup - minimal configuration required
Limitations
Python 2.7 dependency - legacy Python version
Performance - Python overhead compared to compiled tools
Detection - clear process names and network patterns
Maintenance - Python 2.7 EOL and security concerns
Limited protocols - SOCKS4 only (no SOCKS5 features)
Security Considerations
Process visibility - python processes visible in ps
Network signatures - predictable traffic patterns
Log traces - SSH transfers and connections logged
Python 2.7 vulnerabilities - known security issues
Clear text configuration - command line arguments visible
9. Alternative Tools Comparison
Rpivot vs Other Pivoting Tools
Tool
Language
Direction
Auth Support
Performance
Rpivot
Python 2.7
Reverse
NTLM
Medium
sshuttle
Python 3
Forward
SSH keys
High
Chisel
Go
Both
None
High
ligolo-ng
Go
Reverse
TLS
High
SSH
C
Forward
Keys/password
High
When to Use Rpivot
β Corporate environments with NTLM proxies β Reverse connections needed for firewall bypass β Multiple pivot points required β Python available on target systems β SOCKS tunneling sufficient for needs
When NOT to Use Rpivot
β Python 2.7 unavailable on targets β High performance requirements β Stealth operations (process detection risk) β Modern protocols needed (HTTP/3, etc.) β Long-term persistence (maintenance overhead)
10. Integration Examples
Web Application Testing
Database Access
File Share Access
11. Monitoring and Logging
Server-Side Monitoring
Client-Side Monitoring
Traffic Analysis
12. Best Practices
Operational Guidelines
Pre-stage Python 2.7 - ensure availability before engagement
Test connectivity - verify network paths before deployment
Use non-standard ports - avoid default port detection
Monitor connections - track client status and performance
Clean up processes - terminate sessions properly
Security Recommendations
Encrypt transfers - use SSH/HTTPS for rpivot deployment
Rotate ports - change default ports for each engagement
Limit exposure time - minimize active tunnel duration
Clear artifacts - remove rpivot files after use
Monitor logs - watch for detection indicators
Performance Optimization
Single-purpose clients - dedicate clients to specific tasks
Batch operations - minimize interactive session overhead
Compress transfers - use efficient data transfer methods
Monitor bandwidth - track and limit usage patterns
Connection pooling - reuse established tunnels
References
HTB Academy: Pivoting, Tunneling & Port Forwarding - Page 10
Rpivot GitHub: Official Repository
Python 2.7 Documentation: Legacy Python Docs
SOCKS Protocol: RFC 1928 - SOCKS Version 5
NTLM Authentication: Microsoft NTLM Documentation
Last updated