OverTheWire Bandit Level 7 Writeup — Find a Word Next to Another Word with grep

Misc 2026-10-01 · OverTheWire Bandit · By CTFdojo · ⏱ ... · 👁 ... views
𝕏 Share
TL;DR

The file data.txt is large, but the password sits on the one line containing the word "millionth" — grep finds it directly, no need to read the file.

PlatformOverTheWire Bandit
CategoryLinux Fundamentals
Level7 → 8
DifficultyBeginner
Techniquegrep for a known marker word

Challenge description

Level 7 gives a large text file and tells you the password sits next to a specific word on one of its lines — rather than scrolling through thousands of lines, search for that word directly.

"Level Goal: The password for the next level is stored in the file data.txt next to the word 'millionth'."

Step 1 — Check the file's size

Log in as bandit7 and see what you're dealing with:

wc -l data.txt
(several thousand lines)

Step 2 — grep for the marker word

Rather than opening a file this large in an editor, search for the exact word the level description gave you:

grep millionth data.txt
millionth	[PASSWORD FOR bandit8]

Step 3 — Read off the value next to it

grep prints the whole matching line — the password is the second field on that line, separated from the word "millionth" by whitespace.

🔑 password intentionally hidden

The password is deliberately hidden — follow the method, you've earned it. 💪

Key takeaways

When a challenge tells you a distinctive word or string to look for, that's a direct instruction to grep for it rather than search manually — the whole point of a large-file level like this is testing whether you reach for the right tool instead of scrolling.

Resources

CTFdojo
CTFdojo
Community of ethical hackers writing beginner-friendly CTF writeups and guides.

Got a question or a different approach?

Discuss this writeup with the community on the CTFdojo Discord.

Join the Discord →