Skip to content
PURPLEDUEL

The inherited server

Linux Fundamentals · hard level · 5 objectives · 1000 XP in total

You take over from a colleague who left the server with no documentation at all. To find the recovery key you need three answers, each hidden in a different place and found with a different tool: put them together and open the right key.

Lab 13 of 13 in the Linux Fundamentals path. If you get stuck you have 3 hints, from the vaguest to the most precise: they cost 0, 60 and 200 XP.

What you learn

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

  • Find the access log with find (100 XP)
  • Count the active settings with wc (150 XP)
  • Rank the addresses with sort and uniq (200 XP)
  • Compare the old and the new configuration (150 XP)

Topics: linux, audit, find, pipe.

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.
  • find: searches for files by name, type or permissions across a whole folder tree; in an audit it turns up keys, forgotten copies and programs with dangerous permissions.
  • grep: finds the lines that contain a word, even across whole folders with -r. It is the main tool for analysing text and logs.
  • wc: counts lines, words and characters: it tells you how big a file is before you open it.
  • cut: extracts one column from each line using a chosen separator, to isolate a specific field of a log.
  • sort: sorts lines, numerically (-n) or in reverse (-r) too.
  • uniq: removes repeated adjacent lines and counts them with -c: together with sort it builds rankings, such as the most insistent addresses.
  • head: shows only the first lines of a file, handy for understanding a log format without reading all of it.
  • diff: compares two files line by line and shows the differences, for example between a configuration and the recommended one.
  • base64: encodes and decodes Base64, the format that turns bytes into text. It protects nothing: it can be undone without a key.
  • |: the vertical bar | chains commands: the output of the first becomes the input of the next, so small tools form a complete analysis.

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.

The defensive lesson

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

An audit always starts from simple questions: what is active, who keeps insisting, what has changed. You answer them with small tools chained together: grep -v removes the noise, wc counts, cut, sort and uniq build the ranking, diff finds the differences. Beware of almost-right answers: the most present address is not the one with the most failed logins, and counting the comments too gives another number. Defense: keep logs and configurations (better if versioned), hand over with a written checklist, spot the addresses that keep insisting with the same chain of commands and block repeated attempts (attempt limits, tools such as fail2ban), and keep recovery keys away from the servers they protect.

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 Linux Fundamentals path

Linux Fundamentals is the starting point. Almost every server, network device and security tool runs on Linux, and anyone who defends a system (or tests it with permission) spends much of their time in a terminal. Here you learn to move around the filesystem, find hidden files, read huge logs piece by piece, search for words with grep, chain commands with pipes and understand permissions, environment variables and history: the basics you will use in every other path.

All labs in the Linux Fundamentals path

Learn more with the guides

All guides