Overview
impacket-lookupsid enumerates Windows users and groups by brute forcing SID (Security Identifier) lookups through the LSARPC named pipe. It queries the LSA (Local Security Authority) to resolve RIDs (Relative Identifiers) to account names.
Works over SMB (port 445) and can often succeed with NULL sessions on misconfigured Domain Controllers.
Authentication
Basic Usage
Enumerate domain users and groups:Specify Maximum RID
The max RID is a positional argument (passed after the target), not a flag. Default is 4000. Increase for larger environments:NULL Session Enumeration
No credentials needed on misconfigured Domain Controllers:RestrictAnonymousis not set or set to 0RestrictAnonymousSAMis disabled- The “Network access: Restrict anonymous access to Named Pipes and Shares” policy is not enforced
- Common on older Domain Controllers (2008/2012) and misconfigured environments
Finding Domain SID
The domain SID is printed at the top of the output:- Forging Golden Tickets (
ticketer.py) - Forging Silver Tickets
- SID History injection
- Cross-domain attacks via trust relationships