Privilege Escalation Cheat Sheet

Goal: from low-priv to root/admin. Enumerate FIRST, act SECOND. On real boxes use linpeas/winpeas plus manual checks.

Linux — Enumerate (top 10 checks)

  1. sudo -l — NOPASSWD / whitelisted sudo commands
  2. find / -perm -4000 2>/dev/null — SUID binaries
  3. crontab -l, /etc/crontab, /var/spool/cron — writable scripts/root jobs
  4. Kernel & distro versions uname -a; cat /etc/os-release → searchsploit
  5. awk -F: '$3==0 {$1}' /etc/passwd — other UID 0 users, writable passwd
  6. Writable PATH dirs echo $PATH + check if debug binaries run from there
  7. Capabilities getcap -r / 2>/dev/null (e.g. python3 + cap_setuid)
  8. NFS no_root_squash /etc/exports writable → root squash mounts
  9. Docker group membership id → docker socket escape
  10. Writable services/systemd units (restart as root) — find /etc/systemd -writable

Linux — Exploits

Linux — Automated

curl -sL https://raw.githubusercontent.com/peass-ng/PEASS-ng/master/linPEAS/linpeas.sh | sh
./linpeas.sh -a
# also: linEnum.sh, pspy (process snooping for cron in-memory)
./pspy64

Windows — Enumerate (top 10)

  1. whoami /priv — SeImpersonatePrivilege, SeBackupPrivilege etc.
  2. whoami /groups — Admin / SID filtering for tokens
  3. sc queryex type= service state= all — unquoted paths, writable service bins
  4. Registry reg query HKLM\SOFTWARE\... autologon, SAM backups
  5. Unquoted service path wmic service get name,pathname | findstr /i /v "C:\Windows"
  6. Writable folders / AlwaysInstallElevated (MSI)
  7. Stored creds cmdkey /list, saved RDP creds reg query "HKCU\Software\Microsoft\Terminal Server Client"
  8. Kernel/software version → WinExp searchsploit
  9. Token impersonation (SeImpersonate): Potato fam (Juicy/Rogue/Sweet Potato), PrintSpoofer, Potatoes for newer — whoami /priv
  10. Backup files: dir /s /b *.bak, .kdbx, unattend.xml in C:\Windows\Panther

Windows — Exploits

Superscale Best Practice