SMB Null Session Enumeration
A null session authenticates to SMB with empty credentials. On older Windows systems, misconfigured hosts, and Samba installations with map to guest = bad user, null sessions allow unauthenticated enumeration of shares, users, groups, and password policy. Modern Windows defaults block null sessions, but they still appear regularly on internal networks and lab targets.
Quick Null Session Check with nxc
SMB 10.10.10.5 445 LEGACY01 [+] WORKGROUP\: (Guest)
A [+] result confirms null or guest session access. Move immediately to shares, users, and password policy:
--pass-pol returns the lockout threshold and minimum password length, which feeds directly into spray timing decisions — see AD Password Policy and Spray Surface. --users gives you a SAM account list without any credentials — feed it into AD Password Spraying or AS-REP Roastable Account Enumeration.
Also test the guest account explicitly:
enum4linux-ng
enum4linux-ng runs a comprehensive null session sweep covering shares, users, groups, password policy, OS info, and RPC enumeration in a single command:
With explicit null credentials:
Key output sections to read:
[+] Shares— all shares and access level[+] Users— SAM user dump via RPC[+] Groups— local and domain group membership[+] Password Policy— complexity, lockout settings[+] OS Information— hostname, domain, OS version
Warning
This tool is old, deprecated, or rarely used in modern engagements. Prefer enum4linux-ng.
smbclient Null Session
Confirm null session and list shares:
Sharename Type Comment
--------- ---- -------
IPC$ IPC IPC Service (Samba 4.6.2)
backup Disk
Connect to IPC$ to confirm null bind works at the protocol level:
A successful connection confirms the null session is active. Connect to any readable share:
rpcclient Null Session
rpcclient uses the null session to enumerate users, groups, and domain information via named pipe calls over IPC$:
Key commands inside the session:
srvinfo server info and OS version
enumdomusers all domain user accounts with RIDs
enumdomgroups domain groups
querydominfo domain name, user count, policy values
getdompwinfo password policy
netshareenumall all shares including hidden
Non-interactive one-liners:
Try guest if null is blocked:
Nmap Null Session Scripts
OS, hostname, and domain via SMB without credentials:
| smb-os-discovery: | OS: Windows 7 Ultimate 7601 Service Pack 1 | Computer name: LEGACY01 | NetBIOS computer name: LEGACY01 | Domain name: WORKGROUP | System time: 2025-03-10T10:23:14+00:00
Share and user enumeration via Nmap:
smbmap Anonymous Check
[+] IP: 10.10.10.5:445 Name: legacy01
Disk Permissions Comment
---- ----------- -------
backup READ ONLY
IPC$ NO ACCESS
Recursive listing of a readable share:
Interpreting Results
A null session returning shares confirms the host allows unauthenticated SMB access. Any READ permission on a non-IPC share means file browsing is possible without credentials. User lists from enumdomusers or --users map the account surface. Password policy from --pass-pol or getdompwinfo determines safe spray timing.
On modern Windows hosts with null sessions blocked, every attempt returns STATUS_ACCESS_DENIED or STATUS_LOGON_FAILURE. Move to authenticated enumeration if null session is not available.
References
-
cddmp/enum4linux-nggithub.com/cddmp/enum4linux-ng (opens in new tab)
Modern Python rewrite of enum4linux with null and authenticated SMB/RPC enumeration
-
Pennyw0rth/NetExecgithub.com/Pennyw0rth/NetExec (opens in new tab)
nxc null session checks for shares, users, groups, and password policy
-
smb-os-discovery NSE Scriptnmap.org/nsedoc/scripts/smb-os-discovery.html (opens in new tab)
OS, hostname, domain, and workgroup via anonymous SMB session
-
smb-enum-shares NSE Scriptnmap.org/nsedoc/scripts/smb-enum-shares.html (opens in new tab)
Anonymous and authenticated share enumeration
-
smb-enum-users NSE Scriptnmap.org/nsedoc/scripts/smb-enum-users.html (opens in new tab)
User enumeration via null SMB session
Was this helpful?
Your feedback helps improve this page.