Fingerprints that can be guessed
A company's user database has fallen into a stranger's hands: inside there are not the passwords but their fingerprints (hashes). Are they really safe? Find out how long an old fingerprint takes to reveal its password.
Lab 10 of 10 in the Encodings & secrets path. If you get stuck you have 3 hints, from the vaguest to the most precise: they cost 0, 50 and 150 XP.
What you learn
Objectives complete themselves while you work in the terminal; each one is worth experience points:
- Read the old user database (80 XP)
- Isolate the fingerprint of the account to check with grep (120 XP)
- Look the fingerprint up in the precomputed table (200 XP)
Topics: codici, hash, password, sale.
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
The target is an invented host on a simulated private network: you can only reach it from the game terminal.
The target exposes these services:
- 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:
A hash is a one-way fingerprint: it is computed from the password in an instant, but you cannot go back from the fingerprint by calculation. Yet it can be guessed: if the password is among the common ones, whoever has already computed the fingerprints of millions of passwords (rainbow tables) finds the stolen one with a simple search, as you did with grep. Unsalted MD5 is the example not to follow: it is extremely fast to compute and identical for everyone. Here the director had not changed his password and the old file, left on the disk, revealed it. Defense: store passwords with a slow, salted hash made for the purpose (Argon2id, bcrypt, scrypt): a random salt per user makes the tables useless and forces one attempt at a time; forbid common passwords and reuse; delete old databases after a migration and make people change their passwords; use two-factor authentication, so that a password alone is not enough.
Before and after this lab
To unlock it you must have solved:
- The final riddle (Encodings & secrets, hard)
- The token that talks (Encodings & secrets, hard)
It is one of the final labs: no other lab requires it.
The Encodings & secrets path
Encodings & secrets teaches a distinction that saves a lot of data: encoding is not encrypting. Base64, hexadecimal, ROT13 and mirrored text change how information looks but do not protect it, because anyone can turn it back into plain text without a key. In the labs you recognise these formats by their look, peel them off one layer at a time even when they are stacked, extract readable text from a compiled program and understand why real protection needs real encryption, salted hashes and a secrets manager.