Privilege Escalation
Check Permissions
cacls C:\Path\To\Check\F
Full control
R
Read & execute
C
Read, write, execute, & delete
W
Write
PATH Variable Hijacking
The %PATH% variable is constructed from two locations:
User -
HKEY_CURRENT_USER\Environment(user can modify)Machine -
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment(admin only)
User processes use Machine + User paths. System processes use only Machine paths.
env
cacls C:\Python313\Scripts\If a directory in PATH is writable by standard users, you can place a malicious executable there.
Service Exploits
Search Order Hijacking
Place malicious executable where service will find it first.
Unquoted Service Paths
Exploit unquoted paths with spaces.
If you cannot start/stop the service, wait for reboot or trigger one.
Weak Service Binary Permissions
Replace the actual service executable.
Weak Service Registry Permissions
Modify service configuration via registry.
DLL Search Order Hijacking
Typical DLL search order:
The executing directory
The System32 directory
The 16-bit System directory
The Windows directory
The current working directory
Directories in PATH
UAC Bypass (Medium → High Integrity)
Prerequisite: Must be member of local Administrators group
Check current integrity:
elevate Command
svc-exe
Get SYSTEM via service
uac-schtasks
Bypass via SilentCleanup
uac-token-duplication
Token duplication bypass
runasadmin Command
Execute arbitrary commands with elevation.
uac-cmstplua
CMSTPLUA COM interface
uac-eventvwr
eventvwr.exe bypass
uac-schtasks
SilentCleanup bypass
uac-token-duplication
Token duplication
uac-wscript
wscript.exe bypass
CMSTPLUA UAC Bypass
Requirement: Beacon process must be in
C:\Windows\*
Spawn a new Beacon:
Generate PowerShell one-liner:
Right-click Beacon → Access > One-liner
Select tcp-local listener
Execute bypass:
Quick Reference
PATH Hijack
Writable dir in PATH
Place malicious EXE
Search Order Hijack
Writable service directory
Place malicious DLL/EXE
Unquoted Path
Space in unquoted service path
Place EXE at path break
Weak Binary
Writable service executable
Replace EXE
Weak Registry
Writable service registry key
Modify ImagePath
DLL Hijack
Writable dir in DLL search order
Place malicious DLL
UAC Bypass
Medium integrity + local admin
elevate/runasadmin
Last updated