Skip to content

fix(smb): stop truncating the NTLM domain on bare-username auth - #7

Open
WaiZ0 wants to merge 1 commit into
SpecterOps:mainfrom
WaiZ0:fix/smb-ntlm-domain-truncation
Open

fix(smb): stop truncating the NTLM domain on bare-username auth#7
WaiZ0 wants to merge 1 commit into
SpecterOps:mainfrom
WaiZ0:fix/smb-ntlm-domain-truncation

Conversation

@WaiZ0

@WaiZ0 WaiZ0 commented Aug 24, 2026

Copy link
Copy Markdown

Found while validating this collector's SCCM Hierarchy TAKEOVER-1 detection against a GOAD
SCCM lab, as a domain user. I'm a bad user and did not read the doc: -u needs domain\username
and I just supplied the username, like many other tools allow.

The bare-username case is still an explicit, reachable fallback in _split_user_domain, not a
rejected input. It fell back to default_domain.split(".")[0] (e.g. "sccm.lab" -> "sccm"),
assuming a domain's NetBIOS name is always its DNS domain's first label. That assumption can be
wrong, and is wrong in this lab: its real NetBIOS name is SCCMLAB.

http_auth.py has documented, since this repo's first commit, that smb_sso.py imports
split_user_domain from there -- it never did; _split_user_domain was a separate, buggy
duplicate moved verbatim from collectors/registry.py instead.

Delegates to the shared split_user_domain (openhound_collector_common, already used by
wmi.py).

_split_user_domain fell back to default_domain.split(".")[0] (e.g.
"sccm.lab" -> "sccm") when the operator supplies a bare username with
no DOMAIN\ or user@domain prefix. A DC accepts the truncated form
because it is self-authoritative, but a member server's Netlogon
pass-through can reject it -- confirmed against a live lab where the
same credentials succeeded via netexec (full DNS domain) and failed
via this client (truncated domain) against every non-DC host.

Delegate to the shared split_user_domain (openhound_collector_common,
already used by wmi.py) instead of the private duplicate, which does
not truncate. Also stops truncating the domain on the null-session
fallback for consistency.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant