15Linux Privilege Escalation: From User to Root
Enumerate sudo rules, SUID binaries, cron jobs and writable paths, then escalate — and record the hardening.
About this lab
Privilege escalation is turning the access you have into the access you want. On Linux it is almost always enumeration rather than exploitation: the misconfiguration is already there, and the work is noticing it.
The usual suspects are a sudo rule that is wider than intended, a SUID binary that can be made to do something it was not meant to, a cron job running as root from a writable path, and credentials sitting in a world-readable file.
What you will do
- Establish who you are and what you can already do, starting with
sudo -l. - Find SUID binaries and check them against known escape techniques.
- Look for cron jobs running as root, and check whether anything they touch is writable by you.
- Search configuration files and history for credentials.
- Escalate to root and record exactly which misconfiguration allowed it.
Where this is used
A shell as www-data is a finding; root on the same host is a different conversation. On the defensive side, the same checklist is a hardening review — run it against your own servers and fix what it finds.
Simulated environment — no real systems are contacted. Only ever test systems you own or are authorised in writing to test.