Explore our new Cybersecurity Terms Glossary, explained by our experts.
Cybersecurity Terms Glossary
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.

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.
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.
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.
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.
lsass.exe or to privileged processes with token-related access masks.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.
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.
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.
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.
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.
You May Be Interested In These
We use a few cookies that are needed to make this website work, and they are always on. We would also like to set analytics cookies, to see which pages are useful; functional cookies, so that our live chat works; and advertising cookies, to measure our campaigns. We will not set any of those until you say yes, and you can change your mind at any time from the Cookie Settings link in the footer.
Choose the cookies you are happy for us to use. Strictly necessary cookies are always on; everything else is off until you turn it on.
These cookies keep the website working: they hold your security checks, your form submissions and the choice you make here. The site cannot run without them, so they are always on.
These let our live chat open and remember your conversation, and let the newsletter sign-up work. Switch them off and the chat window will not appear.
These tell us which pages are read and how people find us, so that we can improve the site. The reports are about groups of visitors, never about you personally.
These let us measure our advertising and show you our adverts on other websites, such as LinkedIn, Google and Meta. Switch them off and you will still see adverts, but they will be less relevant.