Information Gathering
SMBMap allows users to flash out Samba share drives across entire domains, mapping access rights, folder structural read/write lists, file downloads, and upload tests.
sudo apt install smbmap
smbmap -H <target>
SMBMap is a tool for enumerating Samba shared drives across entire domains. It can list shares, check read/write permissions, download files, and test for null session access on Windows and Samba servers.
SMBMap automates the process of discovering and testing SMB shares across networks. Instead of manually connecting to each share, SMBMap scans entire subnets and provides a comprehensive view of accessible shares and their permissions.
The tool is essential for penetration testers assessing Windows environments. It quickly identifies misconfigured shares, weak permissions, and sensitive files that could lead to further compromise of the network.
smbmap -H 192.168.1.1Null session share check - Identify permissions allowed to public unauthenticated userssmbmap -H 192.168.1.1 -u User -p PasswordAuthenticated check - Enumerate accessible shares using valid target user credentialssmbmap -H 192.168.1.1 -u user -p passAuthenticated listingsmbmap -H 192.168.1.1 -u user -p pass -r shareList files in sharesmbmap -H 192.168.1.1 -u user -p pass --download share/file.txtDownload filesmbmap -H 192.168.1.1 -u user -p pass -x "ipconfig"Execute commandsmbmap -H 192.168.1.100List shares and permissionssmbmap -H 192.168.1.100 -u admin -p passAuthenticated share listingsmbmap -H 192.168.1.100 -u admin -p pass -RRecursive directory listingsmbmap -H 192.168.1.100 -u admin -p pass -r shareList specific sharesmbmap -H 192.168.1.100 -u admin -p pass -d share -f file.txtDownload file from sharesmbmap -H 192.168.1.100 -u admin -p pass -d share --upload file.txt /share/Upload file to sharesmbmap -H 192.168.1.100 -u admin -p pass -x 'dir'Execute command via sharesmbmap -H 192.168.1.100 --share-file 'file.txt'Search for specific filesmbmap -H 192.168.1.100 -u admin -p pass -g groups.txtMap group sharesDiscover all SMB shares on a network and list their contents.
Check read/write permissions on discovered shares.
Test for unauthenticated access to SMB shares.
Recursively list files and identify sensitive documents.
Download and upload files on accessible shares.
SMBMap output lists SMB shares along with their permissions (read/write), file listings, and directory structures. Authenticated scans show accessible shares with full file trees. Error messages indicate permission levels and access restrictions on each share.
This tool is designed for authorized security testing, educational purposes, and legitimate network administration only. Unauthorized access to computer systems is illegal.