Linux Privilege Escalation Enumeration Tools
Automated scripts identify misconfigurations, credential leaks, and exploitable binaries. Use them early:but always verify findings manually before exploitation.
Getting tools onto the target
When the target has no internet access, serve tools from your attack box and pull them down. Always set up a transfer method before running enumeration tools.
Serving HTTP on 0.0.0.0 port 8080 ...
LinPEAS (recommended)
Modern, actively maintained, and comprehensive. Start here on all engagements.
Download and run:
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
Interpretation:
Focus on red and orange highlighted lines. Red background means critical: likely directly exploitable.
Within red findings, prioritise in this order:
sudorules withNOPASSWD, SUID binaries in non-standard paths (/opt,/usr/local, home directories), writable cron or systemd unit files, Linux capabilities on binaries, and plaintext credentials in config files or history.Ignore informational blue/green output unless context suggests relevance: these are not escalation vectors on their own.
Notice
LinPEAS is allowed in OSCP and most exams. It does not exploit:only enumerates.
pspy (process snooping for cron and timers)
Use this when you suspect scheduled tasks, short-lived jobs, or secrets passed on the command line. pspy can show commands executed by other users without needing root.
Get it onto the target
On your box, download a release binary once and reuse it across engagements.
pspy64/pspy32: static, most compatiblepspy64s/pspy32s: smaller, depends on libc
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
Wait at least 2-3 minutes. Watch for UID=0 processes firing on a regular cadence.
Catch file events and tune scanning
If you're missing fast jobs, enable file events and slow down the proc scan to reduce noise:
When you see root running a script or binary, immediately check whether any part of that execution path is writable by you: the script itself, any sourced config, the working directory, or any file it creates that gets executed later.
Where to go next based on what you see:
Root running a script on a schedule → Cron Job Privilege Escalation
Root triggering a systemd service → Systemd Unit and Timer Privilege Escalation
Root calling a command without an absolute path → Writable PATH Hijacking
Credentials or tokens in command-line arguments → use them immediately, then find where they are stored on disk
SUID3NUM (SUID-focused)
Identifies custom SUID binaries and cross-references them with GTFOBins automatically.
Download and run:
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
Output includes:
Default SUID binaries (safe, ignore)
Custom SUID binaries (investigate)
GTFOBins matches with exploitation commands
For the full SUID exploitation workflow including binary analysis see SUID Binary Privilege Escalation.
Warning
The -e auto-exploit flag modifies the system and is not allowed in OSCP. Use only for manual verification.
linux-exploit-suggester (kernel CVE matching)
Compares kernel version and package metadata against known kernel privilege escalation CVEs. Run before attempting any kernel exploit: it narrows the candidate list significantly and avoids wasted time on patched versions.
Always verify the specific patch level with dpkg -l linux-image* or rpm -qa kernel* before attempting any suggested exploit. Distributions backport patches without changing the version number shown by uname -r, so suggester output is a starting point: not a guarantee.
For the full kernel exploitation workflow see Kernel Local Privilege Escalation.
lse.sh (Linux Smart Enumeration)
Lightweight alternative when Python is unavailable or script size matters.
Run:
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
Focuses only on high-yield privilege escalation vectors. Output uses red/yellow/green severity tags.
Works in ash, dash, and minimal shells. Ideal for embedded or restricted targets.
Increase verbosity for more detail: ./lse.sh -l 2
BeRoot
Python tool that validates common misconfigurations with clear exploit suggestions.
Run:
Checks for:
Abusable sudo rules
Writable system files
PATH hijacking
LD_PRELOAD abuse
LinEnum (legacy)
Older Bash-based enumerator. Still functional but outdated.
Run with thorough mode and keyword search:
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
Warning
LinEnum is deprecated. Last updated in 2020. Lacks coverage for capabilities, containers, systemd, and modern kernel exploits. Use only if newer tools fail to execute.
unix-privesc-check (minimalist)
Single-file shell script focused on file permissions, sudoers, and process inspection. Works in restricted environments.
Run:
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
CMD: UID=0 PID=2142 | /bin/sh -c /opt/backup.sh CMD: UID=0 PID=2145 | tar -czf /var/backups/site.tgz /var/www/html
checksec (binary/kernel hardening)
Identify exploit mitigations that affect kernel or binary exploitation viability.
Install if missing:
Run full system check:
For a specific SUID binary found during enumeration, check its mitigations individually before attempting exploitation:
Key outputs:
Kernel ASLR, SMAP/SMEP, KPTI: determine if kernel exploits are feasible. See Kernel Local Privilege Escalation.
PIE, RELRO, Canaries, NX: affect userland binary exploitation. No PIE combined with no stack canary on a custom SUID binary means a simple overflow may work without any bypass. See SUID Binary Privilege Escalation.
Use this to decide whether to pursue kernel exploits or focus on configuration-based escalation.
References
-
Official releases and documentation
-
Process monitoring without root for scheduler discovery
-
Auto SUID enumeration and GTFOBins matching
-
linux-exploit-suggester GitHubREPO: linux-exploit-suggester GitHub, github.com/mzet-/linux-exploit-suggester (opens in new tab)
Kernel vulnerability identification against running system metadata
-
lse.sh GitHubREPO: lse.sh GitHub, github.com/diego-treitos/linux-smart-enumeration (opens in new tab)
Lightweight privilege escalation enumeration
-
BeRoot Linux GitHubREPO: BeRoot Linux GitHub, github.com/AlessandroZ/BeRoot/tree/master/Linux (opens in new tab)
Misconfiguration validator for privilege escalation
-
Legacy Bash-based enumeration script
-
unix-privesc-check GitHub (1_x branch)REPO: unix-privesc-check GitHub (1_x branch), github.com/pentestmonkey/unix-privesc-check/tree/1_x (opens in new tab)
Minimal shell-based privilege escalation checker
-
Binary and kernel security feature detection