Lion Cipher Lab

Escalate to root via a writable systemd service, then fix it

Why it matters

systemd is the init system — the first process, PID 1 — on essentially every mainstream Linux distribution, and it is what starts, stops and supervises the background services (daemons) a server runs. Each service is described by a small text file called a UNIT, and a unit's ExecStart line names the program or script that systemd launches, very often as root because services need privilege to do their jobs. That arrangement is completely safe when the thing being launched is owned by root and cannot be modified by ordinary users. It becomes a straight road to root the moment an ordinary user…

What you'll learn

Steps in this lab

  1. The one idea: whatever a root service runs, you can become
  2. Plant the misconfiguration (as admin, on your own VM)
  3. Enumerate like an attacker (as the low-privileged user)
  4. Exploit it: rewrite the script, collect a root shell (the 'before')
  5. Fix it (as admin): correct ownership and permissions
  6. Re-test and confirm the fix (the 'after')
  7. What you just did — and how to carry it

Open the full interactive lab →