# Windows netsh command

## Port proxies

### List port proxies

Show currently configured port proxies.&#x20;

```powershell
netsh interface portproxy show v4tov4
```

### Adding a port forward port proxy

The below example will start a listerner on the localhost and forward all traffic to the connectaddress and port.&#x20;

```powershell
netsh interface portproxy add v4tov4 listenport=443 listenaddress=0.0.0.0 connectport=443 connectaddress=192.168.99.16
```

### Deleting a port proxy

```powershell
netsh interface portproxy delete v4tov4 listenport=5985 listenaddress=192.168.250.10
```

### Cleaning up and reverting changes

```powershell
netsh interface portproxy reset
```

## Adding firewall rule

```powershell
netsh advfirewall firewall add rule name=fwd_80 dir=in action=allow protocol=TCP localport=80
```

## References

{% embed url="<https://docs.microsoft.com/en-us/windows-server/networking/technologies/netsh/netsh-contexts>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://rfc1918.gitbook.io/offsec/network-pivoting/proxies-and-port-fowarding/windows-netsh-command.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
