Lesson 1 of 9 · 24m
Enumerating Windows Privilege Paths Before You Touch Anything
Build a reliable local map of identity, privileges, services, writable locations, and execution context before attempting escalation.
The worst privilege escalation I ever saw in production was not exotic. A junior tester replaced a service binary on a shared terminal server, crashed the line-of-business application, and still missed the actual finding: the service account was domain admin. Windows escalation is not a scavenger hunt for one magic command. It is relationship analysis — identity to token, token to privilege, service to binary, binary to ACL, and configuration to execution context.
Establish identity first
Start with the identity Windows believes you have, not the username printed on the desktop:
whoami
whoami /groups
whoami /priv
whoami /allRead whoami /priv carefully. Disabled does not mean unavailable. It means the privilege is present in the token but not currently enabled; many Windows APIs enable it only when required. If SeImpersonatePrivilege, SeBackupPrivilege, or SeDebugPrivilege appears at all, that assignment is part of the attack surface.
Enumerate services as relationships
A service is four separate objects wearing one name: the Service Control Manager entry, the binary or command line, the account context, and the registry configuration. Enumerate them together:
Get-CimInstance Win32_Service |
Select-Object Name,DisplayName,State,StartMode,PathName,StartName |
Format-List
sc.exe qc spooler
sc.exe sdshow spoolerPathName tells you what runs. StartName tells you whose authority it inherits. The service DACL tells you who can start, stop, query, or reconfigure it. Treat LocalSystem, NetworkService, and domain accounts differently: LocalSystem is host authority, while a domain service account may become lateral movement material.
Check what the caller can write
The obvious question — "can I replace the binary?" — is only one branch. Ask who can write the binary, its parent directories, its working directory, configuration files, and the registry key defining it:
icacls "C:\Program Files\Vendor\agent.exe"
icacls "C:\Program Files\Vendor"
Get-Acl "HKLM:\SYSTEM\CurrentControlSet\Services\VendorAgent" |
Format-ListWindows ACL output is noisy, so focus on write-ish rights: F, M, W, WD, AD, WA, WriteData, Modify, and FullControl when granted to users or broad groups. ReadAndExecute is normal. FullControl for BUILTIN\Users under a service path is not.
Use automation as a flashlight, not a brain
WinPEAS, PowerUp, Seatbelt, and SharpUp can accelerate enumeration, but every interesting line still needs manual verification. Automated output is often stale, lacks business context, or reports theoretical write access that a control such as application whitelisting neutralizes.
Field notes
- Capture exact ACLs before changing anything. Original state is evidence, and you may need to restore it.
- Do not confuse administrative shell access with
SYSTEM; they are different authority levels with different token properties. - A stopped service can still be exploitable at next boot, reboot, or operator restart. Running state is timing, not trust.
- Record host role. Escalating on a jump box, print server, or terminal server has very different impact from a disposable endpoint.
Was this lesson helpful?