The web speaks in percent
In the request log of an online shop someone sent a message hidden in a search written entirely in codes with the % symbol, hoping the site's filter would not recognize it. Find the request and bring it back to plain text.
Lab 8 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, 40 and 120 XP.
What you learn
Objectives complete themselves while you work in the terminal; each one is worth experience points:
- Read the README (40 XP)
- Isolate the requests of the reported address with grep (100 XP)
- Remove the % symbols with tr (150 XP)
- Bring the hexadecimal back to text with xxd (110 XP)
Topics: codici, url-encoding, esadecimale.
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.cut: extracts one column from each line using a chosen separator, to isolate a specific field of a log.tr: replaces characters with others: with the right rules it applies or undoes ROT13.xxd: shows a file in hexadecimal and can also turn hexadecimal back into text.|: 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:
Percent encoding (URL encoding) writes a byte as % followed by two hexadecimal digits (%20 is the space): it lets special characters travel in links, but it protects nothing, and attackers use it to make a request look unreadable or harmless. It is undone with the same tools as hexadecimal. Defense: filters (web application firewalls, antivirus, alert rules) must normalize, that is decode the input before checking it, even several times because it can be encoded twice; logs should be read already decoded; and never put passwords and tokens in the address, because they end up in logs, in the browser history and in proxies.
Before and after this lab
To unlock it you must have solved:
- Layer upon layer (Encodings & secrets, medium)
After this lab you can move on to:
- The token that talks (Encodings & secrets, hard)
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.