smbmap

A Python SMB enumeration tool by Shawn Evans that lists share drives, drive permissions, and share contents — with upload/download, filename pattern matching, and remote command execution built in. Where smbclient is an interactive FTP-like client, smbmap is built for sweeping hosts and quickly answering “which shares can I read or write?”

Key options

FlagPurpose
-HIP address or host to enumerate
-uUsername (attempts a NULL session if omitted)
-pPassword or NTLM hash
-dDomain or workgroup
-sShare to enumerate (defaults to C$)
-rRecursively list share contents (--depth N to limit)
-xExecute a command on the server (requires appropriate privileges)
--download / --uploadTransfer files to/from the specified share
-AAuto-download files matching a regex pattern

Example output

$ smbmap -H 192.168.86.214 -u Administrator -p asdf1234
[+] IP: 192.168.86.214:445   Name: shawnevans-pc.lan   Status: ADMIN!!!
    Disk                Permissions   Comment
    ----                -----------   -------
    ADMIN$              READ, WRITE   Remote Admin
    C$                  READ, WRITE   Default share
    IPC$                NO ACCESS     Remote IPC

The Permissions column is the payoff — writable shares like ADMIN$ map directly to %WINDIR% and enable binary-planting attacks (see exploit-windows-services). Passing an NTLM hash to -p enables pass-the-hash-style access without knowing the cleartext password.

Sources

Related: smbclient, smbget, enum4linux, default-cifs-shares, exploit-windows-services