πRemote Port Forwarding
Overview
Scenario Description
Network Topology
[Attack Host] ββ [Ubuntu Pivot] ββ [Windows Target]
10.10.15.x 10.129.202.64 172.16.5.19
172.16.5.129 (RDP Service)The Problem
Remote Port Forwarding Concepts
SSH Remote Port Forwarding (-R)
Practical Implementation (HTB Academy Lab)
Step 1: Create Meterpreter Payload
Step 2: Configure Metasploit Handler
Step 3: Transfer Payload to Pivot
Step 4: Download Payload on Windows Target
Step 5: Create SSH Remote Port Forward
Step 6: Execute Payload and Get Shell
Technical Analysis
Why Remote Port Forwarding Works
Connection Source Analysis
Alternative Remote Port Forwarding Examples
Example 1: HTTP Service Exposure
Example 2: Database Access
Example 3: Multiple Service Forwarding
Remote vs Local Port Forwarding Comparison
Security Considerations
Payload Security
Tunnel Security
Operational Security
Troubleshooting Common Issues
1. Payload Not Connecting
2. SSH Tunnel Issues
3. Handler Not Receiving Connections
4. Windows Payload Execution Issues
HTB Academy Official Walkthrough
Complete Step-by-Step Guide (HTB Academy)
Step 1: Create Meterpreter Payload
Step 2: Configure Metasploit Handler
Step 3: Transfer Payload to Pivot
Step 4: Setup Dynamic Port Forwarding
Step 5: Start Web Server on Pivot
Step 6: RDP to Windows Target
Step 7: Download Payload on Windows
Step 8: Setup SSH Remote Port Forward
Step 9: Execute Payload & Get Shell
HTB Academy Lab Questions
Question 1: Ubuntu Pivot Internal IP
Question 2: Handler Listening Address
Network Diagram
Remote Port Forwarding Flow
Best Practices Summary
HTB Academy Official Answer Key
Complete Official Walkthrough with Expected Outputs
Step 1: Create Windows HTTPS Reverse Shell Payload
Step 2: Configure and Start Msfconsole Multi-Handler
Step 3: Transfer Msfvenom Payload to Pivot Host
Step 4: SSH Dynamic Port Forwarding to Pivot
Step 5: Start Python Web Server on Ubuntu
Step 6: Connect to Windows Target via Proxychains
Step 7: Download Payload on Windows Target
Step 8: Perform SSH Remote Port Forward
Step 9: Execute Payload to Get Reverse Shell
Lab Success Criteria
π― Practical Lab Experience - July 19, 2025
Real-World Implementation Success
Problem Encountered: Port Conflict
Solution Applied
Lab Execution Results
Key Learning Points
Troubleshooting Commands Used
Lab Questions - Verified Answers
Success Metrics
References
Last updated