CPSA ยท Windows domain reconnaissance and Active Directory
SMB shares and null sessions
Listing accessible shares, anonymous access and share vs NTFS permissions.
Key points
- SMB: TCP 445 (and over NetBIOS on 139).
- Null session: anonymous connection with empty user name and password; on old or loose hosts it lists shares, sometimes accounts.
- smbclient -L //host -N: lists shares without a password prompt.
- Network access: intersection of share and NTFS permissions, so the stricter wins.
- Administrative shares: IPC$ and C$ exist by default; anonymous enumeration relies on IPC$.
Source: https://www.samba.org/samba/docs/current/man-html/smbclient.1.html
Practice questions
Which smbclient option lists the services (shares) offered by a server?
- -L
- -I
- -U
- -W
Show answer
Answer: A. -L
-L (--list) lists the services on a host. -I sets the target IP address and -U sets the user name.
Which measures reduce anonymous enumeration of shares and accounts?
- Enable the policy 'Network access: Do not allow anonymous enumeration of SAM accounts and shares'
- Block TCP 445 and 139 from untrusted networks
- Disable automatic Windows updates
- Remove ANONYMOUS LOGON and Everyone from share and folder ACLs
- Shorten the screen lock timeout
Show answer
Answer: A. Enable the policy 'Network access: Do not allow anonymous enumeration of SAM accounts and shares', B. Block TCP 445 and 139 from untrusted networks, D. Remove ANONYMOUS LOGON and Everyone from share and folder ACLs
The policy, perimeter filtering and clean ACLs each close a path. Updates and screen locks do not affect anonymous access, and note that the policy does not override ACL entries that explicitly name ANONYMOUS LOGON.
Enabling 'Do not allow anonymous enumeration of SAM accounts and shares' blocks anonymous access even to resources whose ACL explicitly grants ANONYMOUS LOGON.
Show answer
Answer: False
False. Anonymous users still reach resources whose permissions explicitly include ANONYMOUS LOGON. The setting only removes the extra anonymous enumeration rights.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
