data.txt is mostly binary data, but the password is one of the few human-readable strings inside it, preceded by several = characters — strings pulls out the readable text, and grep narrows to the marked line.
- Platform: OverTheWire Bandit
- Category: Linux Fundamentals
- Level: 9 → 10
- Difficulty: Beginner
- Technique: strings + grep for a marker pattern
Challenge description
This file looks like garbage when opened directly — mostly non-printable binary bytes. Somewhere inside it, a handful of human-readable strings survive, and the level says the password is one of them, marked by leading equals signs.
"Level Goal: The password for the next level is stored in the file data.txt in one of the few human-readable strings, preceded by several '=' characters."
Step 1 — See why opening it directly doesn't work
Try viewing the raw file and notice it's mostly unprintable binary noise — cat or opening it in a plain editor produces garbled output:
file data.txt
data.txt: data
Step 2 — Extract just the readable text
strings scans a file and prints only the sequences of printable characters, skipping the binary noise around them:
strings data.txt
(a short list of readable strings scattered among the output)
Step 3 — Narrow to the marked line
The level told you the real string is preceded by several = characters — grep for a line starting with one or more of them:
strings data.txt | grep '^='
========== [PASSWORD FOR bandit10]
🔑 password intentionally hidden
The password is deliberately hidden — follow the method, you've earned it. 💪
Key takeaways
strings is the standard first move on any file that looks like binary garbage — it doesn't care what the file format actually is, it just reports every run of printable characters it finds. Combined with a targeted grep, it turns "needle in a haystack of binary noise" into a one-line command.
-
stringsextracts printable text from any file, regardless of its actual format -
^=in a grep pattern anchors the match to the start of the line - This combination —
stringspiped into a targetedgrep— reappears constantly in reversing and forensics challenges, not just this one
Originally published on CTFdojo — join the CTFdojo Discord to discuss writeups and get notified about new ones.
Top comments (0)