← All hands-on practice
Linux · 12 min
Three ways to root: a privilege escalation audit
A pen test found that any user on web-01 could become root in three ways. You're the admin. Find each one, close it, and watch the paths to root shut.
Start it: free, in your browser, no account
What you will do
- Search the whole server for programs with the SUID bit.
- Take the SUID bit off the program that shouldn't have it.
- Find what root runs on a schedule, and check who can change it.
- Stop everyone but root changing that script, and keep it runnable.
- Find out what dev is allowed to run with sudo.
- Remove dev's vim rule.
Exam objectives it practises
- CompTIA Security+ 4.1 Security techniques for computing resources
- CompTIA PenTest+ 4.4 Host-based attacks
Simplified: a small shell with only the commands this lab needs, one admin and one developer account, no password prompts, and illustrative file sizes and dates. The SUID programs are the ones a fresh Ubuntu 22.04 server has, plus the one that shouldn't be there. On a real server, edit sudoers with visudo, check /etc/cron.d and each user's crontab too, and confirm with an audit tool such as Lynis. Defender's view: only audit machines you're responsible for.