SMB Check
Evaluates SMB signing, SMBv1, anonymous access, and Standard User write access to shares across discovered systems.
Prerequisite
Requires the Domain Controller and domain computer inventories from
ad-kit enum. The writable-share check uses a Standard User account.
Commands run
ad-kit runs NetExec against the discovered hosts:
nxc smb <host> --dns-server <dc_ip>
nxc smb <host> -u <username> -p <password> --shares WRITE --dns-server <dc_ip>
The writable-share check uses the Standard User account and is prompted only when needed.
What it checks
ad-kit records:
- SMB signing - required or not.
- SMBv1 - enabled or not.
- Anonymous access - whether a null session can enumerate shares and users.
- Writable shares - shares the Standard User can write to, reported without writing any files.
The signing, SMBv1, and anonymous checks are unauthenticated. The writable-share check uses the Standard User account and is prompted only when needed.
How it works
SMB is the Windows file-sharing and remote-administration protocol, reachable on ports 139 and 445. SMB signing adds a keyed hash to each SMB message, derived from a session key established during authentication. Each side uses this hash to confirm that a message came from a peer holding the same key and was not modified in transit.
Because NTLM provides no mutual authentication, an attacker positioned between a client and a server can forward the authentication exchange (relay). If the target does not require SMB signing, the relayed session can be used. If signing is required, the attacker cannot produce valid signatures without the session key, so the relayed session cannot be used.
SMBv1 is the legacy version of the protocol and lacks the protections of SMBv2 and SMBv3. It has been tied to several long-standing vulnerabilities and should be disabled.
Why it matters
- Without signing, SMB authentication can be relayed and messages can be modified.
- With SMBv1 enabled, hosts expose legacy functionality with known weaknesses.
- With anonymous access, share names and account lists can be enumerated without credentials.
- With writable shares, the Standard User can place or modify files on a share where write access was not intended.
Findings
| Finding ID | Title |
|---|---|
| SMB-001 | SMB Signing Not Enforced |
| SMB-002 | SMBv1 Enabled |
| SMB-003 | Anonymous SMB Enumeration Permitted |
| SMB-004 | SMB Shares Writable by Standard User |
Tooling
- NetExec: used by this check.
- Impacket: SMB and RPC tooling.
- smbmap: share enumeration and access.
- smbclient: SMB client for share interaction.
- enum4linux-ng: enumeration.