1. INTRODUCTION

SMBMap is a powerful SMB enumeration tool used to:

Common in:


2. BASIC ENUMERATION

List SMB shares on a host:

bash
smbmap -H <IP>

Example:

bash
smbmap -H 10.10.10.5

3. AUTHENTICATED ENUMERATION

Provide username and password:

bash
smbmap -H <IP> -u <USER> -p <PASS>

Null session (guest / anonymous):

bash
smbmap -H 10.10.10.5 -u "" -p ""

4. LIST SHARE PERMISSIONS

Show read/write/execute permissions:

bash
smbmap -H 10.10.10.5 -u admin -p admin123

Permissions meaning:

- R : read

- W : write

- X : execute


5. SEARCH FOR SPECIFIC FILES

Search recursively for files containing a keyword:

bash
smbmap -H <IP> -R <KEYWORD>

Example:

bash
smbmap -H 10.10.10.5 -R backup

6. DOWNLOAD FILES

Download a file from a share:

bash
smbmap -H <IP> --download <SHARE/PATH>

Example:

bash
smbmap -H 10.10.10.5 --download "public/creds.txt"

7. UPLOAD FILES (IF WRITE ACCESS)

Upload a local file to a writable share:

bash
smbmap -H <IP> --upload local.txt share/uploaded.txt

Used for:

- Privilege escalation scripts

- Planting payloads in labs/CTFs


8. RECURSIVE SHARE ENUMERATION

List all files recursively:

bash
smbmap -H 10.10.10.5 -R

Useful to discover:

- Password files

- Backups

- Configuration files

- Sensitive notes


9. CHECK ACCESS TO A SPECIFIC SHARE

Test permission for a single share:

bash
smbmap -H 10.10.10.5 -u bob -p bob123 -s public

10. EXECUTE COMMANDS (IF SERVER ALLOWS)

Some Windows hosts allow RCE via anonymous or authenticated IPC$.

Execute a command:

bash
smbmap -H <IP> -x "ipconfig"

Used for:

- Foothold on Windows machines

- Testing SMB-to-RCE vulnerabilities


11. BRUTE-FORCE TESTING

Try multiple usernames/passwords:

bash
smbmap -H <IP> -u users.txt -p passwords.txt

Useful for:

- Weak domain credentials

- User enumeration in AD environments


12. COMBINING WITH OTHER TOOLS

SMBMap works well with:

- enum4linux : enumerate users/groups

- crackmapexec : large-scale SMB testing

- nmap --script smb* : vulnerability detection


13. FULL CTF WORKFLOW

1. Enumerate shares:

bash
smbmap -H 10.10.10.5

2. Try null session:

bash
smbmap -H 10.10.10.5 -u "" -p ""

3. Identify share permissions.

4. Recursively list files:

bash
smbmap -H 10.10.10.5 -R

5. Download interesting files (creds, configs, backups):

bash
smbmap -H <IP> --download "<share/file>"

6. Upload payload if write access exists.

7. Try command execution:

bash
smbmap -H <IP> -x "whoami"

8. Pivot using gained credentials:

- RDP

- WinRM

- SMB

- SSH


← Back to tutorial