> For the complete documentation index, see [llms.txt](https://notes.nomanaziz.me/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://notes.nomanaziz.me/cybersecurity/penetration-testing/tryhackme/main-methodology/4.-post-exploitation/tools/socat-reverse-tcp-tunnel.md).

# Socat - Reverse TCP Tunnel

We use it for port forwarding where all the TCP connections to 127.0.0.1:8080 will be redirected to port 1234.

```bash
socat TCP-LISTEN:1234,fork,reuseaddr tcp:127.0.0.1:8080 &
```
