Default Ports: 139 (NetBIOS), 445 (SMB over TCP)
SMB is the backbone of file sharing and authentication in Windows networks, which makes it one of the highest-value services to enumerate on almost any internal engagement. A huge amount of Active Directory attack surface, shares, users, password policy, even remote code execution, sits behind this one protocol.
Null / Anonymous Session
No credentials at all. Plenty of SMB servers still allow a null session for basic enumeration, worth checking before anything else.
Authenticated
A valid username and password, or an NTLM hash via pass-the-hash. Opens up share access, RCE, and credential dumping depending on privileges.
For spraying credentials and running bulk enumeration across many hosts at once, NetExec covers that ground in more depth. This page focuses on SMB-specific tools and techniques.
Enumerating Shares
The first real step on any SMB target is finding out what shares exist and what you can actually read or write to. A few tools cover this, each with a slightly different strength.- smbclient
- smbmap
- enum4linux
- Impacket
Always worth trying a null session first, since it costs nothing and plenty of servers still allow it:Once you know a share name, connect to it directly.
recurse ON plus mget * pulls everything down in one go instead of browsing file by file:RPCClient
rpcclient gives you an interactive session for querying domain and user information directly over MS-RPC, useful when you want specific details rather than a full automated enumeration pass.
Remote Code Execution
With valid credentials, whether a password or an NTLM hash, SMB becomes a direct path to command execution on the target. Impacket’spsexec.py is the standard tool for this.
smbexec.py achieves the same thing through a different technique, worth having as a fallback if psexec gets flagged:
Brute Forcing
Authentication Attacks
Responder listens on the network and catches NTLM hashes from hosts broadcasting authentication requests, often triggered by a mistyped share path or a poisoned LLMNR/NBT-NS response./usr/share/responder/logs/, ready to crack offline or relay directly instead:
Nmap Enumeration
Known RCE Vulnerabilities
A handful of SMB vulnerabilities are common enough, and severe enough, that they’re worth checking for on sight rather than waiting for deeper enumeration.Metasploit Modules
Quick Reference Tools
Hackviser: SMB
Quick-reference pentesting guide for the SMB service.
HackTricks: SMB
Deeper breakdown of SMB enumeration, exploitation, and relay techniques.

