Token Impersonation — Identity Theft on Windows
The Token-Based Security Model
┌──────────────────────────────────────────────────────────────────────┐
│ Access Token Structure │
│ │
│ ┌─────────────────────────────────────────────────────────────┐ │
│ │ ACCESS TOKEN │ │
│ │ TokenUser: S-1-5-21-...-1001 (DOMAIN\User) │ │
│ │ TokenGroups: [Administrators, Users, Everyone...] │ │
│ │ TokenPrivileges: [SeDebugPrivilege, SeImpersonatePriv...] │ │
│ │ TokenIntegrity: High (0x3000) / System (0x4000) │ │
│ │ TokenSessionId: 1 │ │
│ │ ImpersonationLevel: SecurityImpersonation (3) │ │
│ └─────────────────────────────────────────────────────────────┘ │
│ │
│ Token stolen from SYSTEM process: │
│ ┌─────────────────────────────────────────────────────────────┐ │
│ │ TokenUser: S-1-5-18 (NT AUTHORITY\SYSTEM) │ │
│ │ TokenPrivileges: [SeTcbPrivilege, SeAssignPrimaryToken...] │ │
│ │ TokenIntegrity: System (0x4000) │ │
│ └─────────────────────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────────────────────┘Prerequisites: Required Privileges
Privilege
Purpose
Technique 1: Token Stealing from SYSTEM Process
Technique 2: Spawn Process with Stolen Token (CreateProcessWithTokenW)
Technique 3: Named Pipe Impersonation
Typical Red Team Token Escalation Chain
Red Team Tooling
References
PreviousPPID Spoofing — Forging the Process TreeNextShellcode Obfuscation — Hiding Payloads from Static Detection
Last updated