Skip to content
Home

smbmap: SMB share enumeration & permissions

Enumerate SMB shares, check read/write permissions, and upload/download/execute.

bash·1 min read··INE Certification

Where smbclient gives you an interactive session, smbmap is built for fast one-shot queries: what shares exist, what can I read or write, and can I execute a command through valid credentials.

Enumeration

smbmap -H <target_ip>                                  # anonymous enumeration
smbmap -u <user> -p <password> -H <target_ip>           # authenticated enumeration
smbmap -u <user> -p <password> -H <target_ip> -r 'C$'   # recursive listing of a share
smbmap -u <user> -p <password> -H <target_ip> -L        # list all drives
smbmap -u <user> -p <password> -H <target_ip> --check-write

Execution and file transfer

smbmap -u <user> -p <password> -H <target_ip> -x 'ipconfig'          # RCE via a writable share
smbmap -u <user> -p <password> -H <target_ip> --upload '/local/file' 'C$\file'
smbmap -u <user> -p <password> -H <target_ip> --download 'C$\file'
FlagMeaning
-HTarget host
-u / -pUsername / password
-rRecursive listing of a share
-LList all drives
--check-writeTest for writable shares
-xExecute a command
--upload / --downloadTransfer files