Explore our new Cybersecurity Terms Glossary, explained by our experts.

View the Glossary View the Glossary
PRIVIA

Cybersecurity Terms Glossary

What Is Token Impersonation?

Token impersonation is a Windows privilege escalation technique in which an attacker borrows the access token of another logged-on account and runs code with that identity.

Illustration for the cybersecurity term Token Impersonation
Home / Blog / Cybersecurity Terms / What Is Token Impersonation?
17 November 2026

What Is Token Impersonation?

What Is Token Impersonation?

Windows attaches an access token to every process and thread. The token holds the account’s security identifier, its group memberships, and its privileges, and the kernel consults it for every access decision. Token impersonation is the act of taking a token that belongs to another account and using it to act as that account, without ever knowing their password.

MITRE ATT&CK records the family as T1134, Access Token Manipulation. It is one of the most dependable ways to move from a compromised service account to SYSTEM, and from SYSTEM on one machine to a domain account that happens to be logged on there.

Why Tokens Can Be Borrowed at All

Impersonation is a deliberate Windows feature. A file server receiving a request needs to check permissions as the requesting user rather than as its own service account, so the operating system lets a thread temporarily adopt a client’s token. Four impersonation levels control how far that goes: Anonymous, Identification, Impersonation, and Delegation, with the last two sufficient to act on the client’s behalf locally or across the network.

Two privileges turn that feature into an escalation path:

Service accounts hold these by default. The IIS application pool identity, the SQL Server service account, and anything running as LOCAL SERVICE or NETWORK SERVICE all have SeImpersonatePrivilege. That is why a web shell on an IIS server is so often a short step from SYSTEM.

The Mechanics

A typical sequence calls OpenProcess on a process owned by the target account, OpenProcessToken to retrieve its token, DuplicateTokenEx to create a usable copy, and then either ImpersonateLoggedOnUser to adopt it on the current thread or CreateProcessWithTokenW to launch a new process under it. Meterpreter’s Incognito module, Mimikatz’s token::elevate, and Cobalt Strike’s steal_token all wrap these calls.

The best-known variants are the Potato family, which do not steal an existing token but coerce a privileged one into arriving:

All of them share one prerequisite: the attacker must already hold SeImpersonatePrivilege. Remove that, and the family stops working.

What It Is Not

Token impersonation is sometimes confused with neighbouring techniques. It is not pass-the-hash, which reuses credential material rather than a token object, and it is not Kerberos delegation abuse, which manipulates tickets at the protocol level. A stolen token is also local and volatile: it exists only while the owning session does, and it cannot be exported and replayed on another machine the way a hash or a ticket can. Network access from an impersonated token depends on the impersonation level, which is why Identification-level tokens are of little use to an attacker.

Detection

Reducing the Opportunity

Start with the privilege itself. Audit which accounts hold SeImpersonatePrivilege and SeAssignPrimaryTokenPrivilege through whoami /priv and Group Policy, and remove it from any custom service account that does not need to impersonate clients. Run application pools and scheduled tasks under managed service accounts with the narrowest rights that work, applying least privilege to services as rigorously as to people.

Then reduce what there is to steal. Keep administrators off servers they do not need to log into interactively, since a token only exists where a session exists; a tiered administration model does most of this work. Disable the Print Spooler where it is not required, keep Windows current so that the known Potato routes stay closed, and enable script block logging and Sysmon so the behaviour is visible when it occurs.

Our Penetration Test Services include post-exploitation testing on Windows servers, which shows how quickly a constrained service account becomes SYSTEM in your environment and whether anything notices.

FAQ – Frequently Asked Questions

What Is SeImpersonatePrivilege and Why Does It Matter?

It is the Windows privilege that allows a process to impersonate a client connecting to it, and it is held by default by service accounts such as IIS application pool identities, SQL Server, LOCAL SERVICE, and NETWORK SERVICE. Every Potato-family escalation depends on it. Auditing which custom service accounts hold it, and removing it where unnecessary, closes the entire technique family.

Can a Stolen Token Be Used on Another Machine?

Not directly. A token is a kernel object tied to a logon session on that host, so it cannot be exported and replayed elsewhere the way an NTLM hash or a Kerberos ticket can. An attacker can, however, use a Delegation-level impersonated token to authenticate outward from the compromised host, which achieves a similar result while the session lasts.

Do the Potato Attacks Still Work on Current Windows Versions?

The original JuicyPotato route was closed in Windows 10 1809 and Server 2019, but successors such as RoguePotato, PrintSpoofer, and GodPotato restored the capability using different triggers. Assume that any account holding SeImpersonatePrivilege on a current, fully patched Windows system can still reach SYSTEM, and treat such accounts as privileged in your threat model.

How Do I Detect Token Impersonation in My Logs?

Look for process creation events where a service account parent spawns a SYSTEM-level child, handle requests to privileged processes in Sysmon event 10, and named pipe activity matching known tooling in Sysmon events 17 and 18. Event 4672, special privileges assigned to a new logon, is also useful when it fires for accounts that should never receive those privileges.

Related Terms

You May Be Interested In These

What Is SCADA Security?

Cybersecurity Terms

17 November 2026

What Is SCADA Security?

Read More
What Is PowerShell Empire?

Cybersecurity Terms

17 November 2026

What Is PowerShell Empire?

Read More