OverTheWire Bandit Level 7 → 8 tutorial!!
Login
Log in as bandit7 using the password you just obtained from Level 6 → 7.
ssh bandit7@bandit.labs.overthewire.org -p 2220
# password: morbNTDkSW6jIlUc0ymOdMaLnOlFVAaj
Why? Each Bandit level is a separate UNIX user. To solve 7 → 8, you must be the
bandit7
user.
Task
The password for the next level is stored in the file data.txt
and is on the same line as the word millionth
.
A little bit of Theory
-
grep
searches for lines that match a pattern.- Basic:
grep PATTERN FILE
- With line numbers:
grep -n PATTERN FILE
- Match a whole word:
grep -w PATTERN FILE
- Basic:
-
The output line typically looks like:
millionth <password>
→ copy the second field. You can also extract it withawk
orcut
.
Further reading:
Solution
-
Verify the file is present
ls -l
Why? Sanity check; the challenge states
data.txt
is here.
-
Search for the keyword
grep -nw 'millionth' data.txt
Why?
-n
shows the line number;-w
forces a whole-word match. -
(Optional) Extract only the password
awk '/\bmillionth\b/ {print $2}' data.txt # or: grep -w 'millionth' data.txt | cut -d' ' -f2
Why? Prints just the second field (the password) — copy-friendly.
-
Copy the password (no extra spaces/newlines).
-
Log into the next level (bandit8)
exit ssh bandit8@bandit.labs.overthewire.org -p 2220 # paste the password you just found when prompted
Password
This is the password shown in my run; if yours differs, copy the one from your own terminal output.
dfwvzFQi4mU0wfNbFOe9RoWskMLg7eEc
Troubleshooting
grep: data.txt: No such file or directory
→ Checkpwd
; you should be in/home/bandit7
.- Multiple matches? → Use
-w
to match the whole word. - Output formatting odd? → Use
awk
/cut
as shown to isolate the second field.
Congrats 🎉 You plucked the right line out of a huge file and can now play as bandit8.
Thanks for reading!
Until next time — Otsumachi!! 💖☄️✨