Hexadecimal
A traffic recorder captured a message and saved it as a long string of digits and letters from a to f. Learn to read hexadecimal, turn the capture back into text and recover the flag.
Lab 2 of 6 in the Encodings & secrets 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 README (50 XP)
- Look at a file in hexadecimal with xxd (100 XP)
- Turn the capture back into text (xxd -r -p) (100 XP)
Topics: codici, hex.
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.xxd: shows a file in hexadecimal and can also turn hexadecimal back into text.
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:
Hexadecimal is just another way of writing bytes: it hides nothing, and xxd -r -p turns it back into text in an instant. You find it everywhere (network dumps, memory, firmware, tokens), so a secret "written in hex" is a secret in plain text, visible to anyone who captures the traffic. You defend by encrypting the traffic (TLS) and not relying on data merely looking unreadable.
Before and after this lab
To unlock it you must have solved:
- Base64 is not a secret (Encodings & secrets, easy)
After this lab you can move on to:
- Caesar's cipher (Encodings & secrets, medium)
- Secrets inside an executable (Encodings & secrets, medium)
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.