2021-11-21 06:19:35 -05:00
|
|
|
# smbmap
|
|
|
|
|
2025-03-22 08:36:07 +02:00
|
|
|
> Enumerate samba share drives across an entire domain.
|
2021-11-21 06:19:35 -05:00
|
|
|
> More information: <https://github.com/ShawnDEvans/smbmap>.
|
|
|
|
|
|
|
|
- Enumerate hosts with NULL sessions enabled and open shares:
|
|
|
|
|
|
|
|
`smbmap --host-file {{path/to/file}}`
|
|
|
|
|
2025-03-22 08:36:07 +02:00
|
|
|
- Display SMB shares and permissions on a host, prompting for user's password or NTLM hash:
|
|
|
|
|
|
|
|
`smbmap {{[-u|--username]}} {{username}} --prompt -H {{ip}}`
|
|
|
|
|
|
|
|
- Execute a shell command on a remote system:
|
|
|
|
|
|
|
|
`smbmap {{[-u|--username]}} {{username}} --prompt -H {{ip}} -x {{command}}`
|
|
|
|
|
2021-11-21 06:19:35 -05:00
|
|
|
- Enumerate hosts and check SMB file permissions:
|
|
|
|
|
2025-03-22 08:36:07 +02:00
|
|
|
`smbmap --host-file {{path/to/file}} {{[-u|--username]}} {{username}} {{[-p|--password]}} {{password}} -q`
|
2021-11-21 06:19:35 -05:00
|
|
|
|
|
|
|
- Connect to an ip or hostname through smb using a username and password:
|
|
|
|
|
2025-03-22 08:36:07 +02:00
|
|
|
`smbmap {{[-u|--username]}} {{username}} {{[-p|--password]}} {{password}} -d {{domain}} -H {{ip_or_hostname}}`
|
2021-11-21 06:19:35 -05:00
|
|
|
|
|
|
|
- Locate and download files [R]ecursively up to N levels depth, searching for filename pattern (regex), and excluding certain shares:
|
|
|
|
|
2025-03-22 08:36:07 +02:00
|
|
|
`smbmap --host-file {{path/to/file}} {{[-u|--username]}} {{username}} {{[-p|--password]}} {{password}} -q -R --depth {{number}} --exclude {{sharename}} -A {{filepattern}}`
|
2021-11-21 06:19:35 -05:00
|
|
|
|
|
|
|
- Upload file through smb using username and password:
|
|
|
|
|
2025-03-22 08:36:07 +02:00
|
|
|
`smbmap {{[-u|--username]}} {{username}} {{[-p|--password]}} {{password}} -d {{domain}} -H {{ip_or_hostname}} --upload {{path/to/file}} '{{/share_name/remote_filename}}'`
|
|
|
|
|
|
|
|
- Display SMB shares and recursively list directories and files, searching for file content matching a regular expression:
|
|
|
|
|
|
|
|
`smbmap {{[-u|--username]}} {{username}} --prompt -H {{ip}} -R -F {{pattern}}`
|