Metasploit
Autoroute
PortFwd
The portfwd command from within the Meterpreter shell is most commonly used as a pivoting technique, allowing direct access to machines otherwise inaccessible from the attacking system.
Meterpreter-based portfwd command that adds a forwarding rule to the current Meterpreter session. This rule forwards network traffic on port 3300 on the local machine to port 3389 (RDP) on the target.
Add
add will add the port forwarding to the list and will essentially create a tunnel for us. Please note, this tunnel will also exist outside the Metasploit console, making it available to any terminal session.
-l 3389 is the local port that will be listening and forwarded to our target. This can be any port on your machine, as long as it’s not already being used.
-p 3389 is the destination port on our targeting host.
-r [target host] is the our targeted system’s IP or hostname.
Delete
Entries are deleted very much like the previous command. Once again from an active Meterpreter session, we would type the following:
List
This argument needs no options and provides us with a list of currently listening and forwarded ports.
Flush
This argument will allow us to remove all the local port forward at once.
References
Last updated