Dev.to Security 🔐 Cybersecurity 👁 0 📖 1 min read

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

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. Platform: OverTheWire Bandit Category: Linux Fundamentals Level:

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.

  • Platform: OverTheWire Bandit
  • Category: Linux Fundamentals
  • Level: 7 → 8
  • Difficulty: Beginner
  • Technique: grep 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.

  • grep word file prints every line in file containing word
  • A large file is a cue to search, not to open in an editor
  • The matching line's other fields (here, the password) come along with the match for free

Originally published on CTFdojo — join the CTFdojo Discord to discuss writeups and get notified about new ones.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.