Windows Privilege Model and Security Context
You'll learn how Windows determines what a user or process can and cannot do through privilege levels, tokens, and security identifiers.
The Core Idea
Windows doesn't just check "who you are"—it checks what rights you carry every time a process or thread tries to access a resource. Think of it like carrying an ID badge at a secure facility: the badge itself (not just your face) determines which doors you can open.
Security Identifiers (SIDs)
Every user, group, and computer has a unique Security Identifier (SID)—a long string like S-1-5-21-.... Windows uses SIDs, not usernames, to track identity. When you log in, Windows doesn't say "this is Alice"; it says "this is SID X with memberships in SIDs Y and Z."
Access Tokens
When you authenticate, Windows creates an access token—a data structure containing your SID, group SIDs, privilege list (like SeDebugPrivilege or SeImpersonatePrivilege), and integrity level. Every process you launch inherits a copy of this token. The token is your security context.
Privilege Levels and Integrity
Windows organizes contexts into integrity levels: Low (sandboxed), Medium (standard user), High (administrator), and System. A Medium-integrity process cannot write to High-integrity locations—even if you're an admin. This is why "Run as Administrator" matters: it spawns a new process with a High-integrity token.
Threads and Impersonation
Threads can temporarily impersonate different tokens, allowing services to act on behalf of specific users. This is powerful but dangerous—attackers often steal or manipulate tokens to escalate privileges.
Key Takeaway:
Windows security context is token-based: your SID, group memberships, privileges, and integrity level all live in an access token that determines what every process and thread can do.