Skip to content
PURPLEDUEL

What has changed?

Linux Fundamentals · easy level · 5 objectives · 300 XP in total

Since this morning the office website has been acting strangely and nobody admits to touching anything. You have yesterday's copy of the configuration and today's: compare them and find out what was changed behind the scenes.

Lab 10 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, 30 and 100 XP.

What you learn

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

  • Read the LEGGIMI (40 XP)
  • Compare two files with diff (60 XP)
  • Find the file that has changed (80 XP)
  • Decode the text hidden in the added line (60 XP)

Topics: linux, diff, integrità.

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.
  • diff: compares two files line by line and shows the differences, for example between a configuration and the recommended one.
  • grep: finds the lines that contain a word, even across whole folders with -r. It is the main tool for analysing text and logs.
  • cut: extracts one column from each line using a chosen separator, to isolate a specific field of a log.
  • 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:

diff compares two versions of a file and shows only what changed: it is the quickest way to notice an unauthorized change to a configuration. Here, besides a tweaked value, there was an added line holding base64 text, which is not a secret: it decodes in a moment. Defense: keep a reference copy of important configurations (better still in a version control system such as git) and compare them with diff regularly or automatically; use tools that check file integrity and raise an alert when something changes (file hashes, AIDE, Tripwire); limit who can write to configurations and log who changes them.

Before and after this lab

To unlock it you must have solved:

After this lab you can move on to:

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