Skip to content
PURPLEDUEL

Final audit: the hotel's chain

Privilege Escalation · hard level · 5 objectives · 900 XP in total

The Hotel Belvedere keeps the till receipts in a digital safe. No password is written in a file and no program is SUID, yet a chain of small mistakes is enough: search the logs, get in where you are let in, find who has a power too many and collect the pieces. Only the last step leads to the report.

Lab 9 of 9 in the Privilege Escalation path. If you get stuck you have 3 hints, from the vaguest to the most precise: they cost 0, 80 and 200 XP.

What you learn

Objectives complete themselves while you work in the terminal; each one is worth experience points:

  • Isolate the invalid “user names” in the login log (100 XP)
  • Get into the maintenance panel (150 XP)
  • List the capabilities assigned to programs (getcap) (150 XP)
  • Read the safe key with the program that has too many powers (200 XP)

Topics: privesc, log, capabilities, audit, boss.

Commands you will use

The terminal is simulated and understands about forty Linux commands. In this lab you will mostly need these:

  • cat: prints the contents of a file: the most direct way to read configurations, notes and logs.
  • grep: finds the lines that contain a word, even across whole folders with -r. It is the main tool for analysing text and logs.
  • curl: makes HTTP requests from the terminal and shows the server’s raw answer, headers included.

The simulated environment

You work in a simulated Linux shell, in the home folder of the user runner: invented files and folders, no network target.

Besides the home folder there is a complete simulated system, with configuration files, logs, users and permissions to examine.

Local services also run on the machine:

  • SSH: encrypted remote command-line access; it is protected with keys instead of passwords and without direct root login.
  • Web (HTTP): a web server with pages, APIs or admin panels: the most exposed part of almost every organisation.

The defensive lesson

Once the lab is solved, the write-up explains what went wrong and how to protect yourself:

No single link opened the safe: a password typed in the wrong place and left in the log, a panel that says too much, a program with one capability too many that reads the key. Together they form a chain. Defensive lesson: audit jointly, not one check at a time; no invalid user names in clear text in the logs, internal panels with a second factor and without lists of accounts and programs, capabilities cut to the minimum and rechecked with getcap, keys rotated and protected by a different access from the one of the program that reads them.

Before and after this lab

To unlock it you must have solved:

It is one of the final labs: no other lab requires it.

The Privilege Escalation path

Privilege Escalation is an audit path here: you are on a server as a normal user and you check whether some misconfiguration lets you gain more privileges than you should have. You examine sudo rules, programs with the SUID bit, credentials forgotten in the history and in files, and secrets passed as process arguments. These are the same checks that people who harden systems run, and each lab ends with the principle that sums them all up: least privilege.

All labs in the Privilege Escalation path

Learn more with the guides

All guides