PATCH//NOTES Open it in the app
← 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

  1. Search the whole server for programs with the SUID bit.
  2. Take the SUID bit off the program that shouldn't have it.
  3. Find what root runs on a schedule, and check who can change it.
  4. Stop everyone but root changing that script, and keep it runnable.
  5. Find out what dev is allowed to run with sudo.
  6. 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.