Course contentsShow
← Security
Lesson 2149 of 3,05242. Penetration Testing and Red TeamingFree lesson

Linux Privilege Escalation Enumeration

Using LinPEAS, LinEnum, and manual techniques to systematically discover escalation vectors.

Linux Privilege Escalation Enumeration

What you'll learn: How to systematically discover privilege escalation opportunities on Linux systems using automated tools and manual techniques.

Enumeration is the reconnaissance phase of privilege escalation—it's where you gather intelligence about the system's configuration, permissions, and potential weaknesses. Think of it as mapping out a building before planning your entry: you need to know where the doors, windows, and security gaps are.

Why Enumeration Matters

You can't exploit what you don't know exists. A misconfigured sudo rule, a writable cron job, or an SUID binary are only valuable if you find them first. Comprehensive enumeration is the difference between a quick win and hours of frustrated guessing.

Automated Enumeration Tools

LinPEAS (Linux Privilege Escalation Awesome Script) is the Swiss Army knife of Linux enumeration. It runs hundreds of checks automatically, looking for kernel exploits, SUID binaries, sudo misconfigurations, writable paths, credentials in files, and more. It color-codes results by severity, helping you prioritize.

LinEnum is another popular script that performs similar enumeration but with a different output format and check coverage. It's useful as a second opinion or when LinPEAS is flagged by defenses.

Manual Enumeration Techniques

Automated tools are excellent, but manual enumeration teaches you what to look for:

  • Check sudo -l to see what commands you can run with elevated privileges
  • Search for SUID/SGID binaries with find / -perm -4000 -type f 2>/dev/null
  • Review /etc/crontab and user cron jobs for writable scripts
  • Examine environment variables with env for sensitive data or PATH manipulation opportunities
  • List file capabilities with getcap -r / 2>/dev/null
  • Check for writable service configurations or init scripts

The Systematic Approach

Start broad with automated tools to quickly identify low-hanging fruit, then pivot to manual enumeration for deeper analysis of interesting findings. Document everything—you may need to chain multiple small weaknesses together.

Key Takeaway: Effective Linux privilege escalation begins with thorough enumeration using tools like LinPEAS and LinEnum combined with manual investigation to systematically discover exploitable misconfigurations and vulnerabilities.