0Pricing
Ethical Hacking Academy · Lesson

Token Impersonation

Abuse privileges.

Token Impersonation is a free Ethical Hacking Academy lesson on CoddyKit — lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Ethical Hacking Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Windows Access Tokens

Every process carries an access token describing its user, groups, and privileges. Windows supports impersonation — a process can act under another user's token. Abusing this lets a service account become SYSTEM.

Impersonation Privileges

Two token privileges are gold for escalation: SeImpersonatePrivilege and SeAssignPrimaryTokenPrivilege. Service accounts (IIS, MSSQL) usually hold SeImpersonate, which the "Potato" family of exploits abuses.

whoami /priv
# SeImpersonatePrivilege  Enabled

The Potato Family

The Potato exploits trick a SYSTEM process into authenticating to a malicious local listener, then steal/impersonate its token. Variants: JuicyPotato, RoguePotato, PrintSpoofer, GodPotato — each suits different Windows versions.

PrintSpoofer

PrintSpoofer abuses the Print Spooler's named pipe to coerce SYSTEM authentication, then impersonates the token to run a command as SYSTEM. It works on modern Windows 10/Server 2019 where JuicyPotato was patched.

PrintSpoofer.exe -i -c cmd
# spawns a SYSTEM shell when you hold SeImpersonate

JuicyPotato

JuicyPotato abuses DCOM/BITS to relay SYSTEM authentication to a local listener. It is reliable on older Windows (pre-1809 / Server 2016) but was mitigated on newer builds, hence RoguePotato/PrintSpoofer.

JuicyPotato.exe -l 1337 -p cmd.exe -t * -c {CLSID}

How the Relay Works

Conceptually: you (a service account) trigger a privileged Windows component to authenticate to your malicious endpoint. You capture that authentication and, thanks to SeImpersonate, wrap the SYSTEM token around a new process — instant SYSTEM shell.

Rotten/Rogue Potato

RottenPotato was the original; RoguePotato updated it to bypass the post-1809 DCOM fixes by using an OXID resolver redirect. Choosing the right Potato depends on the exact build number from systeminfo.

Other Dangerous Privileges

Beyond impersonation, watch for SeBackupPrivilege/SeRestorePrivilege (read/write any file — dump SAM), SeDebugPrivilege (inject into SYSTEM processes), and SeTakeOwnership. Each is its own escalation path.

Token Theft with Meterpreter

Post-exploitation frameworks ease token abuse. Meterpreter's incognito lists and impersonates available tokens; if a SYSTEM or admin token is present in memory, you can steal it directly.

meterpreter > load incognito
meterpreter > list_tokens -u
meterpreter > impersonate_token "NT AUTHORITY\\SYSTEM"

Matching Exploit to Build

The Potato landscape is version-sensitive. Read the OS build, then pick: JuicyPotato (old), RoguePotato/PrintSpoofer (1809+), GodPotato (broad modern coverage). The right tool reliably yields SYSTEM; the wrong one simply fails.

Defenses and Ethics

Defenders limit which accounts get SeImpersonate, patch promptly, disable the Print Spooler where unneeded, and monitor for suspicious token use. Use these techniques only within authorized engagements.

Quick Check

Test your token-impersonation knowledge.

Recap

You learned token impersonation:

  • Access tokens define identity; impersonation can be abused
  • SeImpersonatePrivilege enables the Potato exploits
  • PrintSpoofer/RoguePotato for modern Windows, JuicyPotato for old
  • Other dangerous privileges: SeBackup, SeDebug, SeTakeOwnership

Next: credential harvesting.

Frequently asked questions

Is the “Token Impersonation” lesson free?

Yes — the full text of “Token Impersonation” is free to read here on the web, and the Ethical Hacking Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Ethical Hacking Academy course, upgrade to CoddyKit PRO.

What will I learn in “Token Impersonation”?

Abuse privileges. You practise Ethical Hacking Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Ethical Hacking Academy?

No prior experience is required. Ethical Hacking Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Token Impersonation” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Ethical Hacking Academy lesson?

Yes. Every Ethical Hacking Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Windows Enumeration
  2. Service Misconfigurations
  3. Token Impersonation
  4. Credential Harvesting
← Back to Ethical Hacking Academy