Skip to content

Lesson 2 of 9 · 27m

Access Tokens, Privileges, and Integrity Levels

Build the correct mental model of Windows authorization: tokens, groups, privileges, integrity, and why administrator is not a boolean.

Most Windows privilege confusion comes from treating administrator as a yes-or-no property. Windows does not. Every process carries an access token containing a user SID, group SIDs, privileges, session information, and integrity level. Two processes for the same user can have very different authority. If you do not understand tokens, you will misread UAC, service hardening, and half the privilege-escalation paths on a host.

A token is a process's security identity

Inspect your own token with:

whoami /user
whoami /groups
whoami /priv

/priv is the one juniors skip. It shows powerful capabilities such as SeDebugPrivilege, SeImpersonatePrivilege, SeBackupPrivilege, and SeRestorePrivilege. Most are present but disabled in ordinary tokens. Present means the process may enable them; enabled means the capability is currently active.

UAC creates split tokens

When an administrator logs in interactively, Windows normally creates a filtered standard-user token and a full elevated token. This is why a process can belong to DOMAIN\Alice yet lack administrative groups in effect:

Standard token: Administrators group present but denied for access checks
Elevated token: Administrators group enabled, high integrity, broad privileges

UAC is a usability boundary, not a security boundary in the strongest sense. It reduces accidental or silent use of administrative power, but Microsoft has never treated every local admin-to-kernel path as a serviceable security boundary.

Integrity levels control write direction

Integrity levels are a lightweight containment system layered on top of user authorization:

Low        browsers, sandboxed renderers, some untrusted content
Medium     normal user processes
High       elevated administrators
System     SYSTEM and highly privileged services

The practical rule is that lower-integrity processes cannot freely write or inject upward. That is why browser sandbox escapes often need a second bug: compromising a renderer is not the same as controlling the browser broker, much less the machine.

Privileges are the keys attackers collect

Certain privileges convert directly into compromise primitives. SeDebugPrivilege can open and manipulate other processes. SeImpersonatePrivilege can impersonate a client token and appears in many service-to-SYSTEM escalation chains. Backup and restore privileges can read or replace files outside normal ACL intent.

whoami /priv | findstr /I "Debug Impersonate Backup Restore Tcb"

Do not just catalog privileges. Ask which account has them, which process token enabled them, and whether the service configuration makes that combination reachable by a lower-privileged user.

Field notes

  • Group membership and effective access are not the same thing; inspect the token, not just the account.
  • UAC elevation creates a new token; it does not magically upgrade the existing process.
  • Medium integrity does not mean powerless — the user's files, browser sessions, and cloud tokens are all still there.
  • Service accounts often carry dangerous privileges even when they are not in Administrators.
  • If a hunting rule keys only on whoami /groups, it will miss exactly the privilege material attackers care about.

Was this lesson helpful?

Sign in to rate