22 diciembre, 2022

SOCAT cheat sheet

Remember that socat usually has 2 legs. Both are connected bidirectionally.

 
Listen/Passive Connect/Active
TCPv4 TCP4-LISTEN:8000,reuseaddr,fork TCP4:192.168.1.5:8000
OpenSSL OPENSSL-LISTEN:1443,reuseaddr,pf=ip4,fork,cert=server.pem,verify=0 OPENSSL:192.168.1.5:1443,pf=ip4,verify=0,no-sni=0
Unix Socket UNIX-LISTEN:mysqld.sock,mode=777,reuseaddr,fork UNIX-CONNECT:mysqld.sock.orig
SOCKSv4 SOCKS4:socks-server.local:10.1.2.3:22,socksport=1080

(First IP is socks server, Second IP is destination server).
HTTP Proxy PROXY:aproxy.local:example.com:80,proxyport=8080
STDIO - / STDIN - / STDOUT / STDERR
Misc EXEC:/bin/bash

FILE:/dev/null



Example certificate file server.pem: [Click here to show]

No hay comentarios: