> For the complete documentation index, see [llms.txt](https://rfc1918.gitbook.io/offsec/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rfc1918.gitbook.io/offsec/network-pivoting/proxies-and-port-fowarding/socat.md).

# Socat

## Port forwarding

Uses Socat to listen on port 8080 and then to fork when the connection is received. It will then connect to the attack host on port 80.

```bash
socat TCP4-LISTEN:8080,fork TCP4::80
```

Uses Socat to listen on port 8080 and then to fork when the connection is received. Then it will connect to the target host on port 8443.

```bash
socat TCP4-LISTEN:8080,fork TCP4:<IPaddressofTarget>:8443
```
