🛡️ Methodology Checklist
Global — run once per host
- Identify the Linux distribution and kernel version → Linux_PrivEsc_Enumeration
- Check for credentials in web application configuration files → Linux_PrivEsc_Enumeration
- Check interesting directories (
/opt,/var/mail,/srv, web roots) → Linux_PrivEsc_Enumeration - Check capabilities (
getcap -r / 2>/dev/null) → Linux_PrivEsc_Groups_Capabilities - Check if sudo version is vulnerable (CVE-2023-22809, Baron Samedit) → Linux_PrivEsc_Permissions_Sudo
- Internal Nmap / port scan for local-only services → Linux_PrivEsc_Enumeration
- Check PwnKit (CVE-2021-4034, pkexec) → Linux_PrivEsc_Kernel_Python
- Check LogRotate (logrotten) → Linux_PrivEsc_Misc_NFS_Logrotate
- Monitor processes for anything interesting (pspy) → Linux_PrivEsc_Services_Cron
- Look for a writable Docker socket → Linux_PrivEsc_Groups_Capabilities
- Look for tmux sessions that can be hijacked → Linux_PrivEsc_Misc_NFS_Logrotate
- Check for NFS shares with
no_root_squash→ Linux_PrivEsc_Misc_NFS_Logrotate - Check kernel exploits (DirtyCow, DirtyPipe) → Linux_PrivEsc_Kernel_Python
- Sniff traffic with tcpdump for cleartext credentials → Credential_Hunting_Network_Traffic
Per user — re-run after every shell / pivot
- Check which groups the user belongs to (
id) → Linux_PrivEsc_Groups_Capabilities - Check sudo rights (
sudo -l) → Linux_PrivEsc_Permissions_Sudo - Check environment variables (
env; printenv) → Linux_PrivEsc_Enumeration - Look for SSH keys in the home directory → Linux_PrivEsc_Enumeration
- Check for hidden files in the home directory → Linux_PrivEsc_Enumeration
- Check history files in the home directory → Linux_PrivEsc_Enumeration
- Enumerate SUID / SGID binaries (cross-ref GTFOBins) → Linux_PrivEsc_Permissions_Sudo
🎯 Operational Context
Use when: A Linux shell is obtained and you need a complete, ordered escalation procedure — not a single technique. This note is the entry point; each checklist item links to the detailed note that covers it.
Think Dumber First: Two checks before anything else: sudo -l and find / -perm -4000 -type f 2>/dev/null. They cover the highest-yield paths in seconds. Then run LinPEAS and read the red output. Only reach for kernel exploits (DirtyCow / DirtyPipe / PwnKit) when the misconfiguration paths are exhausted — they are noisier and can panic the box.
Skip when: Already root.
⚡ Tactical Cheatsheet
| Command | Tactical Outcome |
|---|---|
| (Procedure/index note — see linked notes and Master_PrivEsc_Commands for commands) |
🔬 Deep Dive & Workflow
Global vs Per-User
Split the procedure in two. Global facts (distro, kernel, capabilities, NFS exports, sudo version, running processes, listening ports) describe the host — enumerate them once. Per-user facts (groups, sudo -l, env, home-directory keys/history/hidden files) change with every identity you land as — re-run the per-user block after each lateral move or credential reuse, because a new user often unlocks a path the previous one couldn’t see.
Ordering — highest yield first
1. sudo -l → GTFOBins → instant root if NOPASSWD exists [[Linux_PrivEsc_Permissions_Sudo]]
2. id / groups → docker, lxd, disk, adm, shadow groups [[Linux_PrivEsc_Groups_Capabilities]]
3. SUID/SGID + getcap → GTFOBins for each binary / capability [[Linux_PrivEsc_Groups_Capabilities]]
4. Credentials → env, configs, history, SSH keys, web roots [[Linux_PrivEsc_Enumeration]]
5. Cron / processes → writable scripts, pspy, tmux hijack [[Linux_PrivEsc_Services_Cron]]
6. Host misconfigs → NFS no_root_squash, LogRotate, writable libs [[Linux_PrivEsc_Misc_NFS_Logrotate]] / [[Linux_PrivEsc_Shared_Libs_Wildcard_Shell]]
7. Known-CVE binaries → sudo (CVE-2023-22809), PwnKit [[Linux_PrivEsc_Permissions_Sudo]] / [[Linux_PrivEsc_Kernel_Python]]
8. Kernel exploits → DirtyCow, DirtyPipe (LAST RESORT) [[Linux_PrivEsc_Kernel_Python]]
Coverage notes
Every procedure item now resolves to a note with real content:
- PwnKit (CVE-2021-4034) — exploit steps in Linux_PrivEsc_Kernel_Python.
- Writable Docker socket (distinct from the
dockergroup) — covered in Linux_PrivEsc_Groups_Capabilities (Docker API via--unix-socket). - tmux session hijacking — covered in Linux_PrivEsc_Misc_NFS_Logrotate.
- tcpdump cleartext credential capture — covered in Credential_Hunting_Network_Traffic (also referenced from Linux_PrivEsc_Misc_NFS_Logrotate).
- Internal Nmap / local port scan — local listeners via
ss -tlnpin Linux_PrivEsc_Enumeration; pivot scanning lives in the Pivoting notes.
🛠️ Troubleshooting & Edge Cases
| Problem | Cause | Fix |
|---|---|---|
| Nothing obvious after global pass | Host hardened | Re-run the per-user block as every reachable user; one identity often unlocks a path |
sudo -l needs a password | Interactive sudo | Still check the sudo version for CVE-2023-22809 / Baron Samedit → Linux_PrivEsc_Permissions_Sudo |
| Found SUID binary, no known exploit | Non-standard binary | Check GTFOBins for every SUID/SGID/capability binary, not just well-known ones |
| Kernel exploit panics the box | Unstable PoC | Treat kernel exploits as last resort; exhaust misconfig paths first |
📝 Reporting Trigger
Finding Title: Local Privilege Escalation to root via Host/User Misconfiguration
Impact: A low-privileged user can escalate to root through misconfigured sudo rules, excessive SUID/capabilities, writable cron/service paths, insecure NFS exports, or unpatched local-privesc CVEs.
Root Cause: Host not hardened to CIS Linux Benchmark; unpatched packages (sudo, polkit, kernel); excessive privileges granted without review.
Recommendation: Patch sudo/polkit/kernel; remove unnecessary SUID/SGID bits and capabilities; audit sudo rules and cron jobs; set root_squash on NFS exports; apply CIS hardening.
🔗 Related Nodes
This note is the hub — it links to everything in the field manual on Linux privilege escalation.
Techniques (per vector)
- Linux_PrivEsc_Enumeration — systematic enumeration / LinPEAS
- Linux_PrivEsc_Permissions_Sudo — sudo rules, SUID/SGID, sudo CVEs
- Linux_PrivEsc_Groups_Capabilities — docker/lxd/disk/adm groups, writable docker.sock, capabilities
- Linux_PrivEsc_Services_Cron — cron, systemd services/timers, process monitoring
- Linux_PrivEsc_Misc_NFS_Logrotate — NFS no_root_squash, LogRotate, tmux hijack, traffic capture
- Linux_PrivEsc_Shared_Libs_Wildcard_Shell — LD_PRELOAD/library hijack, wildcard injection, shell escapes
- Linux_PrivEsc_Kernel_Python — kernel exploits (DirtyCow/DirtyPipe), PwnKit, Python hijack
Quick reference & commands
- Linux_PrivEsc_Quick_Reference — sub-5-minute quick-win checklist + automated tools
- Master_PrivEsc_Commands — full command cheat sheet (Linux + Windows)
Credentials feeding escalation
- Credential_Hunting_Linux — on-host credential hunt (configs, history, keys)
- Credential_Hunting_Network_Traffic — tcpdump / PCredz cleartext capture
- Linux_Auth_Process — /etc/passwd, /etc/shadow, hash formats for cracking