Metasploit

Autoroute

meterpreter > 
run autoroute -s 10.1.13.0/24

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.

portfwd add -l 3300 -p 3389 -r <IPaddressofTarget>

Add

meterpreter > 
portfwd add –l 3389 –p 3389 –r  [target host]
  • 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:

meterpreter > 
portfwd delete –l 3389 –p 3389 –r [target host]

List

This argument needs no options and provides us with a list of currently listening and forwarded ports.

meterpreter > 
portfwd list

Flush

This argument will allow us to remove all the local port forward at once.

meterpreter > 
portfwd flush

References

Last updated