Packs / socat Recipes
Pack 07
socat Recipes
20 practical commands for connecting, relaying, wrapping in TLS and bridging with socat
For blue-team learners, homelabbers and junior admins who have outgrown netcat and need to relay, forward or wrap a connection in TLS. Twenty recipes cover socat's two-address model and its -d -d logs, TCP and UDP listeners, quick TLS servers and clients, port forwarding, UDP and UNIX-socket bridges, serving files, virtual serial ports and spotting socat relays on a host. Each recipe was run between Kali, Ubuntu Server and Metasploitable 2 on an isolated lab network and shows the real output it produced.

What you get
- socat Recipes PDF: 20 recipes
- One-page socat cheat sheet PDF
- Edition 1
What it covers
- Connect, listen and read socat's log
- Add or strip TLS with OPENSSL
- Forward ports, UDP and UNIX sockets
- Move files, make PTYs, spot stray relays
Tested on
- Tool
- socat 1.8.1.3 and 1.8.1.1
- System
- Kali GNU/Linux Rolling and Ubuntu 26.04.1 LTS
- Lab runs
- 28 and 29 Nov 2026, on an isolated lab network
Only connect to, listen on or relay to systems you own or have written permission to test.

The 20 recipes
Connecting and reading socat's output
- 01Connect to a service: socat's two addresses
- 02See why a connection failed
- 03Watch the bytes both ways (-v, crlf)
Listeners, TCP and UDP
- 04Listen for one connection and see who it was
- 05Accept only chosen clients (range=)
- 06A stand-in service that answers every client (fork)
- 07Receive UDP datagrams (a quick syslog sink)
TLS with OPENSSL
- 08Run a quick TLS server
- 09A TLS client that checks the certificate (OPENSSL)
- 10Put TLS in front of a plain service
Forwarding and proxying
- 11Forward a port to another host (fork)
- 12Forward UDP (DNS) to another host
- 13Turn UDP into TCP (a syslog relay)
- 14Record a session byte for byte (-r, -R)
- 15Let another host reach a loopback-only service
- 16Bridge a UNIX-domain socket and TCP
Files and terminals
- 17Serve a file to every client that connects
- 18Send a file to a receiver and check it (-u, CREATE)
- 19Make a pair of virtual serial ports (PTY)
Spotting socat on a host
- 20Find socat relays and listeners
Also in a bundle
- Network Toolkit Bundle · 5 packs for US$42
- The Complete Collection · 8 packs for US$55