# netsh Pivoting rules

## To Add

{% code overflow="wrap" %}

```batch
netsh interface portproxy add v4tov4 listenport=2222 listenaddress=<PivotMahine> connectport=22 connectaddress=<VictimMachine>

netsh interface portproxy show all

netsh advfirewall firewall add rule name="port_forward_ssh_2222" protocol=TCP dir=in localip=<PivotMahine> localport=2222 action=allow
```

{% endcode %}

## To Delete

```batch
netsh advfirewall firewall delete rule name="port_forward_ssh_2222"


netsh interface portproxy del v4tov4 listenport=2222 listenaddress=192.168.50.64
```
