Finding files
The office archive is a maze of folders. A file with an exact name holds the key to the server room locker: don't hunt for it by hand, let the shell do the searching.
Lab 6 of 9 in the Linux Fundamentals path. If you get stuck you have 3 hints, from the vaguest to the most precise: they cost 0, 40 and 150 XP.
What you learn
Objectives complete themselves while you work in the terminal; each one is worth experience points:
- Find istruzioni.md with find -name (100 XP)
- Read the instructions (100 XP)
- Find every copy of the key (150 XP)
Topics: linux, find.
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.base64: encodes and decodes Base64, the format that turns bytes into text. It protects nothing: it can be undone without a key.
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:
find searches by name, type, size and more through a whole tree of folders: it is the fastest way to track down a file and, for someone analyzing a machine, to dig out forgotten keys, backups and configuration files (*.key, *.bak, *.conf). Defense: old copies of keys and credentials must be destroyed and rotated, not archived: even an expired key reveals a lot about how the new ones are made, and a forgotten backup may still be valid.
Before and after this lab
To unlock it you must have solved:
- Searching text (Linux Fundamentals, medium)
After this lab you can move on to:
- Pipes and filters (Linux Fundamentals, medium)
- Permissions and owners (Linux Fundamentals, medium)
- Executables with the SUID bit (Privilege Escalation, medium)
- Hardening SSH (Blue Team / Defense, medium)
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.