SMB Null Session Permitted

The host accepts anonymous (null session) SMB connections that can be used to list accounts, groups, shares or the password policy without credentials.

SeverityMedium
CVSS 3.15.3 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N Open in the calculator
CVSS 4.06.9 CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N Open in the calculator
CWECWE-497: Exposure of Sensitive System Information to an Unauthorized Control Sphere
OWASP Top 10A01:2025 Broken Access Control
MITRE ATT&CKT1087.002 Domain Account, T1201 Password Policy Discovery, T1069.002 Domain Groups, T1135 Network Share Discovery
CategoryBroken Access Control

Description

The host allows an anonymous SMB connection, known as a null session, to the IPC$ share with an empty user name and password, and answers some remote procedure calls made over it without authentication. Depending on the settings, an anonymous user can list domain or local accounts and groups, the members of administrative groups, the shares on the host and the password and lockout policy, or can translate security identifiers to names, which reveals every account by stepping through relative identifiers in turn (RID cycling).

What matters is the information returned. Valid account names and the lockout threshold together allow password spraying that stays just below the lockout limit, the members of administrative groups show which accounts are worth targeting, and share names and descriptions point to where data is held. No data or system access is gained directly, and the attacker needs network access to the SMB service, but the enumeration removes much of the guesswork from the next stage of an attack. An anonymous connection to IPC$ that returns nothing useful is not a finding in itself.

Current Windows releases restrict anonymous enumeration by default, so the issue usually comes from relaxed security options, from legacy compatibility settings such as anonymous membership of the Pre-Windows 2000 Compatible Access group on domain controllers, or from SMB servers on other platforms, such as Samba and storage appliances. It can be confirmed with rpcclient and an empty user name, enum4linux-ng or NetExec, and scanners report it as null session or anonymous enumeration permitted.

Remediation

Restrict what anonymous users can retrieve:

  • In Group Policy, under Computer Configuration, Windows Settings, Security Settings, Local Policies, Security Options, enable Network access: Do not allow anonymous enumeration of SAM accounts, Network access: Do not allow anonymous enumeration of SAM accounts and shares and Network access: Restrict anonymous access to Named Pipes and Shares, and disable Network access: Allow anonymous SID/Name translation and Network access: Let Everyone permissions apply to anonymous users.
  • Leave Network access: Named Pipes that can be accessed anonymously and Network access: Shares that can be accessed anonymously empty, or limited to entries that a documented application needs.
  • On domain controllers, remove Anonymous Logon and Everyone from the Pre-Windows 2000 Compatible Access group, after checking that no legacy application depends on them.
  • On Samba, set restrict anonymous = 2 and avoid map to guest settings that turn failed logons into guest sessions.

Test the changes on a small group of systems first, as some older applications rely on anonymous access. Confirm the fix by repeating the enumeration with an empty user name and checking that it is refused.

References


Add This Finding to Your Library

In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.

Free trial  ·  No card required

Only need the reporting? Our reporting tool is free and open source, with the same library.


More Network Services Findings

Every Network Services finding