User and Group Management
Windows identity is built on Security Identifiers — not usernames. Understanding SIDs, built-in accounts, and the privilege model tells you why credential-based attacks are so effective and what controls actually stop them.
A penetration tester compromises a workstation through a phishing payload. The machine is domain-joined. They run Mimikatz and dump the local SAM database — but the local Administrator account has been renamed to "helpdesk-local" and is disabled. Doesn't matter. They find the NT hash for the account, check its RID. RID 500. That's the built-in Administrator. They pass the hash to every other machine in the network. Half of them accept it, because every one of those machines has the same local Administrator password — the organization set it up that way two years ago and never changed it. In under ten minutes, the tester has local admin on forty machines.
The rename meant nothing. The disable was bypassed by pass-the-hash. The real failure was a lack of LAPS. This chapter explains why Windows identity works this way and what the actual defenses are.
Security Identifiers: The Real Identity
When Windows makes an access control decision — can this user read this file, can this process open that registry key — it never consults the username. It consults the Security Identifier (SID). Usernames are a human-readable label. SIDs are the actual identity token that the security system uses.
SID Structure
══════════════════════════════════════════════════════════════════════
S - 1 - 5 - 21 - 1234567890 - 0987654321 - 1122334455 - 1001
│ │ │ │ └─────────────────────────────────────┘ │
│ │ │ │ Domain/Machine Identifier │
│ │ │ │ (3 sub-authority values) │
│ │ │ │ │
│ │ │ └── Sub-authority 1: 21 = domain/machine │
│ │ │ │
│ │ └── Identifier Authority: 5 = NT Authority │
│ │ │
│ └── Revision: always 1 │
│ │
└── "S" = SID prefix RID ────────┘
(Relative Identifier)
Unique within the domain/machine
Well-Known SIDs (not tied to any machine):
───────────────────────────────────────────────────────────────
S-1-0-0 Null SID (no user)
S-1-1-0 Everyone (all users, including anonymous)
S-1-5-18 SYSTEM (local OS itself)
S-1-5-19 LOCAL SERVICE (service with limited local rights)
S-1-5-20 NETWORK SERVICE (service with limited network rights)
S-1-5-11 Authenticated Users (all authenticated accounts)
S-1-5-32-544 Administrators (local Administrators group)
S-1-5-32-545 Users (local Users group)
Built-in accounts have predictable RIDs (last component):
───────────────────────────────────────────────────────────────
RID 500 = Built-in Administrator (always, on every machine)
RID 501 = Guest
RID 503 = DefaultAccount
RID 504 = WDAGUtilityAccount (Windows Defender App Guard)
The Administrator account's identity is not its name — it's its SID, specifically the RID of 500. When an attacker dumps the local SAM database, they see the NT hash alongside the RID, not the username. An account with RID 500 is the built-in Administrator regardless of what it's named. Pass-the-hash attacks pass the NT hash; the system checks it against the RID 500 account's stored hash. The name "helpdesk-local" is irrelevant. Renaming the Administrator account is theater. Disabling it is slightly more meaningful — but the pass-the-hash technique can still authenticate as a disabled account in certain contexts (specifically, UAC over-the-network restrictions apply to accounts with RID 500 by default, but this behavior differs between local and domain accounts).
How SIDs Drive Access Control
When a user logs in, Windows constructs an access token for their session. The access token contains: the user's SID, the SIDs of every group the user belongs to, the user's privileges, and the integrity level. This token is attached to every process the user launches.
When that process tries to open a file, the kernel's Security Reference Monitor compares the token's SIDs against the file's Security Descriptor (the ACL). A match on a "deny" ACE blocks access; a match on an "allow" ACE permits it. The username never appears in this calculation — only SIDs.
Access Check Flow
══════════════════════════════════════════════════════════════════════
Process tries to open C:\SensitiveFile.txt with READ access
│
▼
Kernel Security Reference Monitor (SRM)
│
├── Gets: Process Access Token
│ ├── User SID: S-1-5-21-...-1001 (alice)
│ ├── Group SIDs: S-1-5-32-545 (Users)
│ │ S-1-5-32-544 (Administrators)
│ └── Privileges: SeShutdownPrivilege, etc.
│
└── Gets: File Security Descriptor (DACL)
├── ACE 1: DENY S-1-5-32-545 (Users) WRITE
├── ACE 2: ALLOW S-1-5-32-544 (Admins) FULL
└── ACE 3: ALLOW S-1-5-21-...-1001 READ
SRM walks the DACL in order:
1. ACE 1: Does token contain S-1-5-32-545? YES. Is this a DENY for WRITE?
Request is for READ, not WRITE. No effect.
2. ACE 2: Does token contain S-1-5-32-544? YES. ALLOW FULL.
READ is covered by FULL. ACCESS GRANTED.
(stops at first allowing match)
Built-In Account Risks
Every Windows installation includes several built-in accounts with fixed, well-known SIDs. Attackers know these SIDs by heart. The security profile of each matters for detection.
| Account | RID | Default State | Security Risk |
|---|---|---|---|
| Administrator | 500 | Enabled on workgroups, may be disabled on domain members | Pass-the-hash target. If all machines share the same local admin password, one compromise = all compromised. UAC does NOT apply to RID 500 over the network on pre-KB2871997 systems. |
| Guest | 501 | Disabled | Historically used for anonymous access. Enabling it gives unauthenticated users network access. Should remain disabled. Enabling it is a Sysmon Event ID 4722 (account enabled). |
| DefaultAccount | 503 | Disabled | Managed by Windows for app compatibility. Should remain disabled. Any activity associated with this account warrants investigation. |
| WDAGUtilityAccount | 504 | Disabled unless App Guard enabled | Used by Windows Defender Application Guard for isolated browsing. Automatically managed. Not a typical attack target. |
| SYSTEM | S-1-5-18 | Always present (not a user account) | The most privileged identity on a local machine. Malware running as SYSTEM has unrestricted local access. Many privilege escalation attacks aim to reach SYSTEM from a lower-privileged context. |
Local Accounts vs Domain Accounts
Windows distinguishes between local accounts (defined in the local SAM database) and domain accounts (defined in Active Directory on a domain controller). The distinction matters because they are stored differently, authenticated differently, and have different security implications.
| Property | Local Account | Domain Account |
|---|---|---|
| Credential storage | NT hash in local SAM (C:\Windows\System32\config\SAM). SAM is locked while Windows is running but readable offline or via Volume Shadow Copy. | NT hash in NTDS.dit on domain controllers. Also cached in the local LSA Secrets registry hive for offline logon (last 10 logins by default). |
| Scope | Valid only on the machine where it's defined. | Valid across all machines in the domain. |
| SID format | S-1-5-21-[machine ID]-[RID] | S-1-5-21-[domain ID]-[RID] |
| Lateral movement risk | Limited to machines sharing the same password. LAPS eliminates this by making passwords unique per machine. | High. A compromised domain account works on every machine where that account has rights. Domain admin compromise = full domain compromise. |
| Cached credentials | N/A — local accounts don't need DC for authentication. | Cached as MSCASH2 hashes in registry. Offline cracking is possible but slow. Attackers prefer dumping LSASS for NT hashes instead. |
The Least Privilege Model
The principle of least privilege states that every process, user, and service should operate with the minimum permissions necessary to do its job. In Windows terms, this means running day-to-day work as a standard user (not an administrator), using separate privileged accounts only when administrative tasks are required, and never running services as SYSTEM or Domain Admin when a service account with only the necessary permissions will do.
The reason least privilege is the single most effective security control in Windows environments is not subtle: most attack techniques that matter — credential dumping, lateral movement, persistence installation, defense evasion — require administrator or SYSTEM rights. An attacker who compromises a standard user account is severely limited in what they can do next. An attacker who compromises an administrator immediately has most of what they need.
Why Least Privilege Limits Attacker Options
══════════════════════════════════════════════════════════════════════
Attacker has compromised account with rights:
┌───────────────────────────────────────────────────────────────┐
│ Standard User (non-admin) │
│ │
│ Can do: │
│ ✓ Read files in own profile and shared locations │
│ ✓ Execute code in user-writable locations │
│ ✓ Make network connections (outbound) │
│ ✓ Access resources this user has been granted │
│ │
│ Cannot do (without privilege escalation): │
│ ✗ Read LSASS memory (requires SeDebugPrivilege) │
│ ✗ Install services or drivers │
│ ✗ Write to %ProgramFiles%, %SystemRoot%, HKLM │
│ ✗ Disable Windows Defender or EDR │
│ ✗ Create scheduled tasks for other users │
│ ✗ Dump SAM database or NTDS.dit │
└───────────────────────────────────────────────────────────────┘
│
│ (attacker must find a privilege escalation path)
▼
┌───────────────────────────────────────────────────────────────┐
│ Local Administrator │
│ │
│ Can additionally do: │
│ ✓ Read LSASS memory → credential theft │
│ ✓ Disable security tools │
│ ✓ Install persistence mechanisms │
│ ✓ Pass-the-hash to other local admin accounts │
│ ✓ Dump SAM database │
└───────────────────────────────────────────────────────────────┘
Service Accounts: The Over-Privilege Problem
Service accounts are accounts used by Windows services and applications to authenticate and access resources. They are among the most common sources of privilege over-extension in enterprise environments, and among the most valuable targets for attackers.
The pattern plays out consistently: a developer needs a service to access a database, so they create a domain account, give it Domain Admin rights "because it's easier than figuring out the minimum permissions," and the application runs fine. Years later, an attacker compromises the application server, extracts the service account's credentials, and has Domain Admin. The service never needed Domain Admin — it needed access to one database.
| Account Type | Description | Security Benefit |
|---|---|---|
| Standard Domain Account | Manually created, password managed by humans. The most common and most risky approach. | None beyond whatever rights are assigned. Password rarely changed. Kerberoastable if assigned SPNs. |
| Managed Service Account (MSA) | Domain account where AD manages the password automatically (rotated every 30 days). Single-machine only. | No password to steal (automatically rotated). Can't be used interactively. Not Kerberoastable. |
| Group Managed Service Account (gMSA) | Like MSA but usable across multiple servers. Password managed by AD, 240-character random password rotated every 30 days. | Best option for multi-server services. Eliminates password management risk. Not Kerberoastable. |
| SYSTEM / LOCAL SERVICE / NETWORK SERVICE | Built-in Windows service identities. SYSTEM = full local admin. LOCAL SERVICE = limited. NETWORK SERVICE = limited with network. | No external password. SYSTEM is very powerful — services should use gMSA instead where possible. |
Any authenticated domain user can request a Kerberos service ticket for any Service Principal Name (SPN) in the domain. Service tickets are encrypted with the service account's NT hash. Kerberoasting exploits this by requesting service tickets for all accounts with SPNs, then cracking the tickets offline — no network noise during cracking, no failed authentication events, completely within normal Kerberos behavior. If the service account has a weak password, it's cracked in minutes. If it's a gMSA with a 240-character random password, it's computationally infeasible to crack. The defense is gMSA for all service accounts that support it, and strong passwords (25+ characters) where gMSA is not available.
LAPS: Solving the Shared Local Admin Password Problem
The scenario in the opening section — one compromise leading to local admin on forty machines — has a well-known solution: Local Administrator Password Solution (LAPS). LAPS is a Microsoft tool (now built into Windows natively as Windows LAPS) that generates a unique, random password for the local Administrator account on each domain-joined machine and stores it in Active Directory.
LAPS Architecture
══════════════════════════════════════════════════════════════════════
Without LAPS: With LAPS:
───────────────────────────── ─────────────────────────────────
Machine A: Admin pw = P@ss123 Machine A: Admin pw = xK9#mP2qL7vN
Machine B: Admin pw = P@ss123 Machine B: Admin pw = 4wR8jT5nY1cX
Machine C: Admin pw = P@ss123 Machine C: Admin pw = 9hF3zV6bQ0sE
One hash = all machines Each machine is isolated
AD stores each machine's password in a confidential
attribute (ms-Mcs-AdmPwd). Only members of designated
AD groups can read it. Password rotated automatically
after each use or on a schedule.
Pass-the-hash with LAPS:
✗ Hash from Machine A doesn't work on B or C
✓ Attacker must compromise each machine independently
Note: LAPS passwords are stored in AD — a compromised
Domain Controller or account with LAPS read access
can retrieve them all. LAPS reduces lateral movement
from workstation to workstation, not DC compromise.
LAPS doesn't prevent the first compromise — it limits how far the attacker can spread using the same credential. Think of it as firebreaks: if every machine has a unique local admin password, a credential compromise on one machine burns only that machine. Without LAPS, a credential from one machine sets the entire forest on fire. The attacker still got in. LAPS just means they can't multiply that access for free.
UAC: The Privilege Elevation Mechanism
User Account Control (UAC) is widely misunderstood. It is not a security boundary — the Windows security documentation explicitly states this. An administrator who clicks "Yes" on a UAC prompt has not been protected from anything. UAC is an anti-habituation mechanism: it makes elevation explicit and visible, reducing the chance of malware silently elevating by requiring a conscious user action.
The actual security mechanism is the split token. When a user in the Administrators group logs in, Windows creates two tokens: a restricted token (same as a standard user, administrator SID marked as "deny only") and a full elevated token. All processes launch with the restricted token by default. When a process needs admin rights, it goes through the UAC consent prompt to get the elevated token. This is why Task Manager shows some processes as "elevated" — they hold the full token.
UAC auto-elevation bypasses are one of the most documented attack techniques in Windows. Dozens of methods exist: writing to auto-elevated COM objects, hijacking DLLs loaded by auto-elevated processes, abusing the fodhelper.exe fodhelper bypass, environment variable manipulation, and many more. Most are caught by modern EDR, but they exist because UAC was never designed as a security boundary — it was designed to make elevation visible. If your security model depends on UAC blocking malware elevation, reconsider that model. The correct use of UAC is as a speed bump that slows unsophisticated attacks and prompts users to think before approving elevation — not as a control that blocks determined attackers.
Q & A
1. An alert fires on an EventID 4648 (explicit credential logon) showing the built-in Administrator account being used from a workstation. Why is this suspicious even if the account isn't disabled?
The built-in Administrator (RID 500) account is typically not used for day-to-day operations in well-managed environments. Administrators use their own named domain accounts for normal work. A 4648 event (a process logged on using explicitly provided credentials, distinct from the current session's credentials) for the local Administrator account from a workstation suggests either: an attacker is passing credentials explicitly using runas, PowerShell Invoke-Command with -Credential, WMI with -Credential, or similar, OR a script is running with hardcoded credentials. Either scenario warrants investigation. The 4648 event includes the subject (who initiated the authentication), the account being used (which will show the local admin account name), and the target server/process. Cross-referencing with Sysmon process creation events around the same time reveals what process triggered the explicit credential use.
2. What is pass-the-hash and why can't Windows simply reject hash-based authentication?
Pass-the-hash is an attack that authenticates to Windows resources using a user's NT hash directly, without knowing the plaintext password. This works because the NTLM authentication protocol is challenge-response: the server sends a challenge, the client responds with HMAC-MD5(NT_hash, challenge). If an attacker has the NT hash, they can compute the correct response without the password. Windows cannot "simply reject" hash-based authentication because NTLM doesn't transmit the password at all — it only ever uses the hash in the computation. The hash IS the secret in NTLM. To eliminate pass-the-hash entirely requires eliminating NTLM authentication, which Microsoft is progressively doing — Windows 11 and Server 2025 now allow disabling NTLM entirely in favor of Kerberos. Kerberos is not vulnerable to pass-the-hash in the same way (it uses tickets encrypted with the KDC's keys), though it has its own credential attack (pass-the-ticket). The practical defense short of eliminating NTLM: LAPS (unique local admin passwords), tiered administration models (domain admins never log into workstations), and Credential Guard (keeps hashes in an isolated VM where they can't be extracted).
3. What is the difference between a privilege and a permission, and why does it matter for detection?
A permission is an access control entry on a specific object (file, registry key, process) — it governs whether a particular identity can perform a particular action on that specific object. A privilege is a system-wide right not tied to a specific object — it overrides normal access control for specific classes of action. SeDebugPrivilege, for example, allows a process to open any other process with any access rights, bypassing object-level access checks. SeLoadDriverPrivilege allows loading kernel drivers. SeTakeOwnershipPrivilege allows taking ownership of any object. Privileges are listed in an access token and are either enabled or disabled (they can be present but disabled as a defense-in-depth measure). The security relevance: attackers frequently seek specific privileges rather than group memberships. A standard user account with SeDebugPrivilege explicitly granted is as dangerous as a local admin for credential dumping purposes. Detection: Sysmon Event ID 4672 (special privileges assigned to new logon) fires when a logon session is assigned sensitive privileges including SeDebugPrivilege, SeTcbPrivilege, and SeLoadDriverPrivilege. These events are high-signal for privilege abuse when they fire for non-system accounts.
4. What does "integrity level" mean in Windows and how does it affect security?
Windows Integrity Levels (Mandatory Integrity Control, MIC) assign a trust level to every process and object: Low, Medium, High, and System. The rule is that a process cannot write to an object at a higher integrity level than its own — even if the DACL would otherwise allow it. Internet Explorer Enhanced Protected Mode runs at Low integrity. Downloads from IE go to the Low integrity %TEMP% folder. A Low integrity process cannot write to %ProgramFiles% or HKLM (both High integrity) even if it runs as an administrator. This is a containment mechanism: a browser exploit that achieves code execution within the browser process is still limited to Low integrity — it can't install a service, can't write to system directories, can't modify HKLM. To "break out" of the integrity restriction requires a separate privilege escalation step. For detection: processes running at Low integrity that attempt High integrity writes generate access denied events. More importantly, a Low integrity process that somehow achieves High integrity writes (indicating a successful escape) is a high-confidence indicator of a sandbox escape or privilege escalation.
5. What is Kerberoasting, who can perform it, and what does it look like in logs?
Kerberoasting is an attack where any authenticated domain user requests Kerberos service tickets for accounts with Service Principal Names (SPNs) registered in Active Directory, then cracks those tickets offline. Any authenticated domain user can request these tickets — no special permissions required. The tickets are encrypted with the service account's NT hash. If the service account has a weak password, the ticket can be cracked offline in minutes to hours. In domain controller Security event logs, Kerberoasting appears as Event ID 4769 (Kerberos Service Ticket Request) with ticket encryption type 0x17 (RC4-HMAC) or 0x12 (AES256-CTS-HMAC-SHA1, harder to crack). A burst of 4769 events from a single source requesting tickets for many different service accounts in a short period is a strong Kerberoasting indicator — normal behavior is one or two service ticket requests for services the user actually accesses. The defense: migrate service accounts to gMSA (Group Managed Service Accounts), which have 240-character random passwords that are computationally infeasible to crack even if the ticket is obtained.