Linux privilege escalation is the set of techniques an attacker uses to go from a normal user to root. The common paths are SUID/SGID binaries, misconfigured sudo rules, dangerous Linux capabilities, writable or attacker-controlled cron jobs, PATH hijacking, exposed credentials, and kernel exploits. It is mostly an enumeration problem: list the system carefully, find the one misconfiguration that grants root, and use it. Resources like GTFOBins map which standard binaries can be turned into an escalation.
The goal: become root
On Linux the superuser is root (UID 0), and root can do anything. An attacker with a normal shell wants to become root so they can read every file (including /etc/shadow), install persistence, and harvest credentials.
They rarely need a single exotic exploit. They need one of many possible misconfigurations to line up.
The common escalation paths
The recurring Linux privesc vectors, each with its own page:
- SUID/SGID binaries: programs that run as their owner (often root). Details.
- sudo misconfiguration: over-broad or NOPASSWD rules. Details.
- Linux capabilities: fine-grained root powers on a binary. Details.
- Cron jobs: scheduled tasks running as root that trust writable scripts. Details.
- PATH hijacking: a privileged program calling a binary by name. Details.
- Kernel exploits: an unpatched kernel with a public exploit. Details.
- Writable /etc/passwd: adding your own root user. Details.
Enumeration: where it starts
Every Linux escalation starts with enumeration. A few of the first commands an attacker (or tester) runs:
idandsudo -lto see current rights and sudo permissionsfind / -perm -4000 -type f 2>/dev/nullto list SUID binariesgetcap -r / 2>/dev/nullto list capabilitiesuname -ato check the kernel version- inspect
/etc/crontaband writable files
The PEAS script linpeas automates this sweep. The skill is reading the output and recognising which finding actually leads to root.
References
- [1]MITRE ATT&CK: Privilege Escalation (TA0004)(MITRE)
- [2]NIST SP 800-115 Technical Guide to Security Testing(NIST)
- [3]Linux man-pages: setuid(2)(man7.org)