SMBMAP(1)

πŸ“¦
version 1.10.7 Β· 3 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

smbmap β€” the SMB enumeration tool, bestie. Like, the whole point of it. πŸ¦‹


πŸ¦‹ SYNOPSIS πŸ¦‹

smbmap [-h] (-H HOST | --host-file FILE) [-u USERNAME] [-p PASSWORD
|--prompt] [-s SHARE] [-d DOMAIN] [-P PORT] [-v] [--admin] [--no-banner]
[--no-color] [--no-update] [-x COMMAND][--mode CMDMODE] [-L | -r [PATH]]
[-A PATTERN | -g FILE | --csv FILE] [--dir-only][--no-write-check] [-q]
[--depth DEPTH] [--exclude SHARE [SHARE ...]] [-F PATTERN] [--search-
path PATH] [--search-timeout TIMEOUT] [--download PATH] [--upload SRC
DST] [--delete PATH TO FILE] [--skip]

🌸 DESCRIPTION 🌸

okay so picture this: SMBMap lets you enumerate samba share drives across an entire domain. An entire domain!! πŸ’…

It can list share drives, list drive permissions, list share contents, do the whole upload/download thing, do file name auto-download pattern matching, and it can literally execute remote commands. The way that this tool was designed with pen testing in mind… it's giving "let me simplify searching for potentially sensitive data across large networks." Periodt. πŸ‘‘


✨ OPTIONS ✨

πŸ‘‘ Main arguments:

  • -H HOST β€” IP of host 🫢
  • --host-file FILE β€” a file containing a list of hosts
  • -u USERNAME, --username USERNAME β€” the username. If you omit it, a null session is assumed, bestie
  • -p PASSWORD, --password PASSWORD β€” password, or an NTLM hash πŸ”₯
  • --prompt β€” prompts you for a password
  • -s SHARE β€” specify a share (default C$), ex 'C$'
  • -d DOMAIN β€” domain name (default WORKGROUP)
  • -P PORT β€” SMB port (default 445)
  • -v, --version β€” return the OS version of the remote host ⭐
  • --signing β€” check if host has SMB signing disabled, enabled, or required
  • --admin β€” just report if the user is an admin, nothing more, no crumbs
  • --no-banner β€” removes the banner from the top of the output
  • --no-color β€” removes the color from output πŸŽ€
  • --no-update β€” removes the "Working on it" message
  • --timeout SCAN_TIMEOUT β€” set port scan socket timeout. Default is .5 seconds

Kerberos settings:

  • -k, --kerberos β€” use Kerberos authentication ✨
  • --no-pass β€” use CCache file (export KRB5CCNAME='~/current.ccache')
  • --dc-ip IP or Host β€” IP or FQDN of DC

Command Execution:

Options for executing commands on the specified host 😌

  • -x COMMAND β€” execute a command ex. 'ipconfig /all'
  • --mode CMDMODE β€” set the execution method, wmi or psexec, default wmi

Options for searching/enumerating the filesystem of the specified host πŸ”

  • -L β€” list all drives on the specified host, requires ADMIN rights. no cap
  • -r [PATH] β€” recursively list dirs and files (with no PATH it lists the root of ALL shares), ex. 'email/backup'
  • -g FILE β€” output to a file in a grep friendly format, used with -r (otherwise it outputs nothing), ex -g grep_out.txt
  • -A PATTERN β€” define a file name pattern (regex) that auto downloads a file on a match (requires -r), not case sensitive, ex '(web|global).(asax|config)'
  • --csv FILE β€” output to a CSV file, ex --csv shares.csv
  • --dir-only β€” list only directories, omit files
  • --no-write-check β€” skip check to see if drive grants WRITE access
  • -q β€” quiet verbose output. Only shows shares you have READ or WRITE on, and suppresses file listing when performing a search (-A)
  • --depth DEPTH β€” traverse a directory tree to a specific depth. Default is 1 (root node)
  • --exclude SHARE [SHARE ...] β€” exclude share(s) from searching and listing, ex. --exclude ADMIN$ C$'

Options for searching the content of files (must run as root), kind of experimental πŸ™ˆ

  • -F PATTERN β€” file content search, -F '[Pp]assword' (requires admin access to execute commands, and powershell on victim host)
  • --search-path PATH β€” specify drive/path to search (used with -F, default C:\Users), ex 'D:\HR\'
  • --search-timeout TIMEOUT β€” specify a timeout (in seconds) before the file search job gets killed. Default is 300 seconds

Filesystem interaction:

Options for interacting with the specified host's filesystem 🧚

  • --download PATH β€” download a file from the remote system, ex. 'C$\temp\passwords.txt'
  • --upload SRC DST β€” upload a file to the remote system ex. '/tmp/payload.exe C$\temp\payload.exe'
  • --delete PATH_TO_FILE β€” delete a remote file, ex. 'C$\temp\msf.exe'
  • --skip β€” skip delete file confirmation prompt

🌈 EXAMPLES: 🌈

$ python smbmap.py -u jsmith -p password1 -d workgroup -H 192.168.0.1
$ python smbmap.py -u jsmith -p 'aad3b435b51404eeaad3b435b51404ee:da76f2c4c96028b7a6111aef4a50a94d' -H 172.16.0.20
$ python smbmap.py -u 'apadmin' -p 'asdf1234!' -d ACME -H 10.1.3.30 -x 'net group "Domain Admins" /domain'

look at that NTLM hash in example two. iconic. πŸ’œ


πŸ’œ AUTHOR πŸ’œ

smbmap was developed by ShawnDEvans <ShawnDEvans@gmail.com> 🫢

This manual page was written by Samuel Henrique <samueloph@debian.org> for the Debian project, it was based on smbmap -h output and can be used by other projects as well. slay.


and that's the whole page bestie!! this is smbmap 1.10.7, dated January 2025, from the User Commands manual β€” mwah, go enumerate something responsibly πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from