Skip to main content

Privilege Escalation

Privilege Escalation (PrivEsc) is the process of gaining higher-level permissions on a system than initially grantedβ€”usually moving from a limited user to administrative (Windows: Administrator, SYSTEM; Linux: root).

In red teaming and adversary simulations, this is a critical post-exploitation milestone, enabling control, persistence, and pivoting within a network.


πŸ’‘ Why Privilege Escalation Matters​

Initial access often lands an operator in a restricted context:

  • Limited shell from a phished user
  • Web app RCE as www-data
  • Initial C2 beacon running as a service account

With these constraints, the attacker can't:

  • Install persistence mechanisms in protected areas
  • Access credential stores (e.g., SAM, LSA secrets, LSASS)
  • Dump memory or sensitive logs
  • Manipulate system services or security settings
  • Move laterally across boundaries like UAC, domains, or containers

PrivEsc unlocks post-ex capabilities, turning a foothold into a beachhead.


πŸ” Types of Privilege Escalation​

🧭 Horizontal vs Vertical​

TypeDescription
VerticalLow β†’ High (e.g., user β†’ SYSTEM)
HorizontalLateral in scope, gaining access to another user’s account with equivalent privileges, often for access to different resources

πŸͺŸ On Windows​

CategoryExamples
Unquoted Service PathsServices with spaces in path without quotes
Insecure Registry PermissionsWriteable keys in HKLM\SYSTEM\...
DLL HijackingAbuse of DLL load order in services or apps
Token ImpersonationSteal or impersonate tokens (e.g., Incognito, PrintSpoofer)
UAC BypassMasquerading as trusted binaries (fodhelper.exe, eventvwr.exe)
Scheduled TasksAbuse of misconfigured or writable tasks
AlwaysInstallElevatedMisconfigured installer policies

🐧 On Linux/macOS​

CategoryExamples
SUID BinariesFind misconfigured files with find / -perm -4000
Cron JobsWritable or weakly configured scheduled tasks
Shell EscapesFrom limited shells into full TTYs
Weak PermissionsWritable system scripts run by root
Kernel Exploitse.g., Dirty COW, Dirty Pipe, Stack Clash
PATH HijackingReplace binaries in PATH if running as root

πŸ›  Tools & Techniques​

Popular enumeration and escalation tools include:

These tools automate the detection of misconfigs and exploitation pathways.


🧠 OPSEC Considerations​

Privilege escalation often involves:

  • Writing to disk (exploits, binaries)
  • Loading unsigned code or DLLs
  • Triggering EDR-monitored events (e.g., reg add, schtasks, seclogon)

Mitigation:

  • Use in-memory techniques (e.g., Cobalt Strike’s Beacon, Sliver’s BOFs)
  • Abuse native tools and avoid spawning child processes
  • Clean up logs and artifacts after testing exploitability

🎯 Goals After Escalation​

Once escalation is successful:

  • Dump credentials from LSASS or SAM
  • Pivot to sensitive services (SQL, RDP, AD tools)
  • Establish persistence with higher integrity
  • Modify or disable AV/EDR settings
  • Hijack network-bound processes

🧭 Where Does PrivEsc Fit?​

Initial Access β†’ Execution β†’ [ Post-Ex Recon ] β†’ [ Privilege Escalation ] β†’ Persistence β†’ Lateral Movement β†’ Objectives

It often occurs early in the post-exploitation phase, enabling or enhancing the effectiveness of all other actions.


πŸ“Œ Summary​

Privilege escalation isn’t just about admin rightsβ€”it’s about control. It widens your operational scope, enhances stealth and durability, and sets the stage for deeper access and broader compromise.

Whether you're simulating adversaries or defending real networks, understanding escalation is foundational.