Netsh is a Windows command-line tool that can help with the network configuration of a particular Windows system.

Some of the networking related tasks we can use Netsh for:

image.png

We can use netsh.exe to forward all data received on a specific port (say 8080) to a remote host on a remote port.

netsh.exe interface portproxy add v4tov4 listenport=8080 listenaddress=10.129.42.198 connectport=3389 connectaddress=172.16.5.25

netsh.exe interface portproxy show v4tov4

After configuring the portproxy on our Windows-based pivot host, we will try to connect to the 8080 port of this host from our attack host using xfreerdp. Once a request is sent from our attack host, the Windows host will route our traffic according to the proxy settings configured by netsh.exe.