Nmap SMB Enumeration
DISCOVERY SMB Port Scanning
NSE SCRIPTS Share & User Enumeration
SECURITY Security Configuration
COMPREHENSIVE All-in-One SMB Scan
Use nbtscan 192.168.1.0/24 for quick NetBIOS name enumeration, or nmblookup -A TARGET to query NetBIOS names.
Connecting to Shares
Inside SMBClient
Authentication Testing
Null & Guest Sessions
Password Spraying
Check lockout policy first! Use
nxc smb TARGET --pass-pol
to view password policy.
User Enumeration
RID 500 is always the built-in Administrator. RID 1000+ are domain users. Even if renamed, the RID never changes!
RPCClient Commands
Connecting to RPC
User & Group Queries
SID & Name Lookups
System & Share Information
RPCClient One-Liners
Use the help command inside rpcclient to see all available commands. Try help [command] for detailed syntax.
Impacket Tools
Remote Execution
Pass-the-Hash
Secret Dumping
Additional Tools
Install Impacket with: pipx install impacket or clone from GitHub for the latest version.
Vulnerability Scanning
CRITICAL Remote Code Execution Vulnerabilities
HIGH DoS & Privilege Escalation
MALWARE Backdoor Detection
RELAY SMB Signing & Relay Detection
Some NSE vuln scripts can crash services or trigger IDS/IPS. Always get authorization and test in a lab environment first. Use --script-args=unsafe=1 only when explicitly permitted.
Relay Attacks
When SMB signing is disabled, you can relay NTLM authentication to other hosts!
Use PetitPotam, PrinterBug, or DFSCoerce to force authentication from DCs and high-value targets!
Advanced File Discovery
SMBGET Recursive File Download
MANSPIDER Sensitive Data Discovery
ManSpider crawls SMB shares looking for sensitive files (passwords, creds, configs, keys)
NXC NetExec Spider Module
Get ManSpider from pip install manspider or clone from GitHub. Spider results are saved to ~/.nxc/logs/
Mounting Shares (Linux)
💡 Best Practices & Pro Tips
🎯 Enumeration Strategy
- • Always start with null session/guest access tests
- • Use enum4linux-ng for comprehensive automated enum
- • Check password policy BEFORE password spraying
- • RID cycling works great on older Windows (2000-2008)
- • Spider shares with NetExec spider_plus module
🔒 OpSec Considerations
- • Avoid excessive login attempts (triggers lockout)
- • Some NSE scripts can crash services (use carefully)
- • Relay attacks generate authentication logs
- • Pass-the-hash leaves forensic artifacts
- • Use --no-bruteforce flag to avoid lockouts
🚀 Common Targets
- • SYSVOL share → GPP passwords (cpassword)
- • NETLOGON → Login scripts with hardcoded creds
- • User home directories → SSH keys, config files
- • IT/Backup shares → Password vaults, scripts
- • IPC$ → RPC enumeration, null sessions
⚙️ Tool Selection
- • smbmap → Quick share permissions check
- • enum4linux-ng → Full automated enumeration
- • NetExec → Swiss army knife for AD pentest
- • Impacket → Remote execution & credential dumping
- • ManSpider → Sensitive file discovery at scale
🔍 Debugging Tip:
If tools fail, check SMB version compatibility. SMBv1 is disabled by default on newer Windows. Use
--option='client min protocol=SMB2'
for smbclient or
-2
flag for smbmap.