1. Resources
  2. Identity Threats
  3. Active Directory

Windows Token Privilege Abuse (SeImpersonate, SeDebug, SeBackup and others)

Also known as: Token privilege escalation, SeImpersonatePrivilege abuse, Potato attacks, SeDebugPrivilege abuse, User rights abuse

An account or service that holds a sensitive Windows privilege such as SeImpersonate, SeDebug, SeBackup, SeRestore or SeLoadDriver can turn it into SYSTEM on that host without being an administrator.

Platform
Active Directory
Impact
High
Last updated
Attack difficulty
Low
Detection difficulty
Medium
Privileges required: Specific rights or roles
Code execution in a logon session whose token holds one of the sensitive privileges: a service account, an IIS or SQL Server worker, or a user given the right by policy or group membership.
What the attacker gains
SYSTEM on the host, and with it every credential stored or used there. On a domain controller that is control of the domain.
Threat groups
APT28FIN8Blue MockingbirdFIN6Lazarus GroupLotus BlossomTurlaGroups that MITRE ATT&CK records using T1134.001, T1134.002, T1134.

How it works

When an account logs on to a Windows host, the system builds an access token for the session. The token holds the account's SID, the SIDs of its groups, and a list of privileges: rights to perform system-level operations that are not tied to any single object. Privileges come from the User Rights Assignment policy of that host, through the account itself or through any group in the token. They are local: the same domain account can hold a privilege on one server and not on another.

A privilege in a token is either enabled or disabled. Disabled does not mean unavailable; the process enables it with AdjustTokenPrivileges when it needs it. A few privileges bypass the normal access checks so completely that holding one is the same as being an administrator of the host. Windows calls them sensitive privileges:

Privilege User right What the holder can do
SeImpersonatePrivilege Impersonate a client after authentication Run a thread as any account that authenticates to a server the holder controls. If a SYSTEM service can be made to connect, the holder becomes SYSTEM.
SeAssignPrimaryTokenPrivilege Replace a process-level token Start a process with a different token, for example one obtained through impersonation.
SeDebugPrivilege Debug programs Open any process and read or write its memory, ignoring the process DACL. That includes LSASS and every SYSTEM process.
SeBackupPrivilege Back up files and directories Read any file and save any registry hive, regardless of ACLs.
SeRestorePrivilege Restore files and directories Write any file, regardless of ACLs, and set any owner on a file.
SeTakeOwnershipPrivilege Take ownership of files or other objects Become the owner of any securable object (files, registry keys, processes, directory objects), then grant yourself access.
SeLoadDriverPrivilege Load and unload device drivers Load a driver, and so code, into the kernel.
SeTcbPrivilege Act as part of the operating system Act as a trusted part of the system; a process with it can impersonate any user without authentication.
SeCreateTokenPrivilege Create a token object Build an arbitrary token, with any SIDs and privileges, and use it for local access.

Three situations put these privileges in an attacker's hands:

  • Service accounts. Processes started by the Service Control Manager get the Service group in their token, and that group holds SeImpersonatePrivilege by default. An attacker who gets code execution in a web application, a SQL Server instance (for example through xp_cmdshell) or any other service lands in a session with the privilege, even when the service account is otherwise unprivileged.
  • Operator groups. Backup Operators and Server Operators hold the backup and restore privileges on domain controllers, and Print Operators holds the driver privilege there. See Backup Operators, Server Operators and Print Operators.
  • Policy assignments. A GPO or a product installer assigns a right such as "Debug programs" or "Act as part of the operating system" to a user, a group or an application account, and the assignment outlives its reason.

Prerequisites

  • Code execution on the host in a logon session whose token contains the privilege. For a service account that usually means exploiting or misusing the service; for a user it means a logon on that host.
  • For users under User Account Control: an elevated process. The standard token of a filtered logon does not contain the sensitive privileges.
  • For SeImpersonatePrivilege: a SYSTEM service that can be made to authenticate locally. PrintSpoofer needs the Print Spooler service; GodPotato uses DCOM and the RPCSS service, which is always running.
  • For SeDebugPrivilege against LSASS: LSA protection and Credential Guard not blocking the access.
  • For SeLoadDriverPrivilege: a signed vulnerable driver that the host will load.

Attack steps

For authorized security testing and lab use only. Run these steps against systems you own or have written permission to assess.

1. List the privileges of the current token

whoami /priv
whoami /groups

Any of the nine privileges in the table is a path to SYSTEM, whether its state is Enabled or Disabled.

2. SeImpersonatePrivilege: get a SYSTEM token from a coerced service

PrintSpoofer makes the Print Spooler connect to a named pipe it controls, impersonates the SYSTEM token of that connection and starts a process with it. It targets Windows 10 and Windows Server 2016 and 2019.

:: SYSTEM shell in the current console
PrintSpoofer.exe -i -c cmd

:: Run one command as SYSTEM and exit (web shell, WinRM, xp_cmdshell)
PrintSpoofer.exe -c "cmd /c net localgroup Administrators CORP\alice /add"

GodPotato does the same through DCOM and lists Windows Server 2012 through 2022 and Windows 8 through 11 as affected:

GodPotato -cmd "cmd /c whoami"
GodPotato -cmd "cmd /c net localgroup Administrators CORP\alice /add"

SeAssignPrimaryTokenPrivilege serves the same tools: with a SYSTEM token in hand, either privilege is enough to start a new process under it.

3. SeDebugPrivilege: open a SYSTEM process

With the debug privilege enabled, the holder can open LSASS and read the credentials of every logged-on account, or inject code into any SYSTEM process. The tools and commands are on the LSASS credential dumping page.

4. SeBackupPrivilege: read what the ACLs protect

:: Registry hives with the local account hashes and LSA secrets
reg save HKLM\SYSTEM C:\Temp\SYSTEM.save
reg save HKLM\SAM C:\Temp\SAM.save
reg save HKLM\SECURITY C:\Temp\SECURITY.save

:: Any file, in backup mode
robocopy C:\Users\Administrator\Documents C:\Temp\out secrets.kdbx /b

The hives are parsed offline, as described under SAM and LSA secrets.

5. SeRestorePrivilege: write what the ACLs protect

Backup mode also writes. Replacing a binary that a service runs as SYSTEM gives code execution when the service next starts:

robocopy C:\Temp\payload "C:\Program Files\Vendor\Agent" agent.exe /b

SeTakeOwnershipPrivilege reaches the same result in two steps: take ownership of the file or registry key, grant yourself full control as the new owner, then change it.

6. SeLoadDriverPrivilege: run code in the kernel

EoPLoadDriver registers a driver under the current user's registry hive and loads it. With a signed vulnerable driver this ends in SYSTEM; the Print Operators page has the full sequence and its limits on current builds.

EoPLoadDriver.exe System\CurrentControlSet\MyService C:\Users\alice\Desktop\Capcom.sys

7. SeTcbPrivilege and SeCreateTokenPrivilege

These two are rarely assigned outside SYSTEM. A process holding SeTcbPrivilege can obtain a token for any user without that user's credentials, and one holding SeCreateTokenPrivilege can build a token that claims membership of the local Administrators group. Either is a direct route to SYSTEM for a custom tool.

Impact

The result is SYSTEM on the host: full privilege escalation from a service or operator context. From there the attacker reads LSASS, the SAM and LSA secrets and every credential cached or used on the machine, and uses them for lateral movement. The step matters most where the low-privileged foothold is common and the host is valuable: a web or database server with a domain service account, a jump host, or a domain controller where an operator group holds the privilege.

OPSEC and artifacts

  • Disabled privileges stay quiet until used. Holding a privilege creates one record: event 4672 at logon, listing the sensitive privileges of the session. For SYSTEM and for service accounts that event is routine and written constantly.
  • Enabling a privilege. With Audit Authorization Policy Change enabled, event 4703 records a process enabling a privilege in its token.
  • Using a privilege. With Audit Sensitive Privilege Use, events 4673 and 4674 record privileged service calls and operations on privileged objects, with the process name. The backup and restore privileges are the exception: their use is only logged when "Audit: Audit the use of Backup and Restore privilege" is on. Microsoft rates the volume of this subcategory as high.
  • Potato tools leave a process tree. A service process such as w3wp.exe or sqlservr.exe starts an unknown binary, which starts cmd.exe as SYSTEM. Process creation auditing (event 4688) shows a child running as SYSTEM under a parent that runs as a service account. PrintSpoofer also creates a named pipe that the spooler connects to, which Sysmon pipe events (17 and 18) record.
  • Files and hives. reg save output files, robocopy in backup mode from a non-backup account, and a changed service binary are all visible to file and process monitoring.
  • Drivers. A driver load is recorded by Sysmon event 6 with the hashes and signature.

Detection

  • Know who holds the privileges. Compare the effective User Rights Assignment of each server class with a baseline, and alert on changes: event 4704 records a right being assigned, and the sensitive user right rules cover domain controllers. Additions to the operator groups are covered by the privileged group membership change rules.
  • Special logons by unexpected accounts. Microsoft's recommendation for event 4672 is to monitor subjects that are not SYSTEM, Local Service or Network Service and are not administrators expected to hold the listed privileges, and to alert on privileges that should never be granted, such as SeDebugPrivilege for a non-administrator.
  • SYSTEM children of service processes. A process running as SYSTEM whose parent runs as a service account or an application pool identity.
  • Privilege use from unusual paths. Event 4673 where the process is outside System32 and Program Files, or where a user account uses a privilege it should not have.
// Sessions that received sensitive privileges, excluding the built-in service identities
SecurityEvent
| where EventID == 4672
| where SubjectUserSid !in ("S-1-5-18", "S-1-5-19", "S-1-5-20")
| extend Sensitive = extract_all(@"(SeDebugPrivilege|SeTcbPrivilege|SeCreateTokenPrivilege|SeLoadDriverPrivilege|SeBackupPrivilege|SeRestorePrivilege|SeTakeOwnershipPrivilege|SeAssignPrimaryTokenPrivilege)", PrivilegeList)
| where array_length(Sensitive) > 0
| summarize Logons = count(), Privileges = make_set(Sensitive) by Computer, SubjectUserName, SubjectUserSid
| order by Logons desc

Use the result as an inventory first: remove the administrators and service accounts that are expected on each host class, then alert on new rows. SeImpersonatePrivilege is left out of the pattern on purpose, because every service session holds it.

Mitigation

  • Assign sensitive rights to administrators only. Review User Rights Assignment on every server class and remove users, operator groups and application accounts from the nine rights in the table. Microsoft's guidance for SeDebugPrivilege is that it be granted to Administrators and only to Administrators.
  • Treat a service compromise as a host compromise. Because every service holds SeImpersonatePrivilege, isolation between a service account and SYSTEM on the same host is weak. Give each service its own account with no rights elsewhere, prefer group managed service accounts, and follow how to secure Active Directory service accounts so that an over-permissioned service account does not turn one server into many.
  • Remove what the tools need. Disable the Print Spooler where printing is not required, and keep servers patched so that known coercion paths are closed.
  • Protect LSASS. Enable LSA protection and Credential Guard so that SeDebugPrivilege no longer opens the credential store. See the LSA protection and Credential Guard guide.
  • Block vulnerable drivers with memory integrity or the recommended driver block rules.
  • Keep privileged accounts off lower-tier hosts. SYSTEM on a server yields whatever credentials are used there, so the tier model limits what the escalation is worth, in line with least privilege.
  • Audit. Enable Special Logon, Authorization Policy Change, Process Creation and, where the volume is acceptable, Sensitive Privilege Use. The audit policy guide lists the settings.

Detection rules for this attack

Log events to collect

FAQ

Which Windows privileges are equivalent to administrator?

The ones that let the holder read or write anything, take over other processes or run code in the kernel: SeDebugPrivilege, SeImpersonatePrivilege, SeAssignPrimaryTokenPrivilege, SeTcbPrivilege, SeCreateTokenPrivilege, SeBackupPrivilege, SeRestorePrivilege, SeTakeOwnershipPrivilege and SeLoadDriverPrivilege. Windows treats them as sensitive and writes event 4672 when a logon session receives any of them.

Why do service accounts have SeImpersonatePrivilege?

A service has to act as its clients, so Windows adds the Service group to the token of every process the Service Control Manager starts, and that group holds the 'Impersonate a client after authentication' right by default, together with Local Service, Network Service and Administrators. A web application pool or a SQL Server instance therefore runs with the privilege even under a low-privileged account.

What is a potato attack?

A family of local privilege escalation tools for accounts that hold SeImpersonatePrivilege. Each one tricks a SYSTEM service into authenticating to an endpoint the attacker controls, such as a named pipe or a COM server, then impersonates the resulting SYSTEM token and starts a process with it. PrintSpoofer and GodPotato are current examples.

A privilege shows as Disabled in whoami /priv. Is it safe?

No. Disabled means the privilege is in the token but not switched on. Any program running in that session can enable it with one API call when it needs it. Only a privilege that is absent from the list is unavailable.

References

Techniques, tactics and threat groups: MITRE ATT&CK® Enterprise v20.1. © The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation. Last updated 2026-11-29.

Does this attack work in your environment?

Forestall maps every identity and the attack paths between them across Active Directory, Entra ID and cloud, read-only and agentless.