OverTheWire.org Walkthrough: Bandit

~ Level 7→8 ~

Level Description

The password for the next level is stored in the file data.txt next to the word millionth

New commands are required to be learned to complete this level, they include: grep, sort, uniq, string, base64, tr, tar, gzip, bzip2, and xxd


Research Before Solving

Based on the description for the level, we need a command that will search the document for a specific string as the password is located next to it. In the last lesson we learned that the funtionality of grep meets this criteria. Let's take a look at the syntax of grep.

Output of grep --help

We start by typing grep followed by a switch if we so desire. Then we will pass the word, phrase, or characters we would like to search for. Lastly, we provide the name of the file we would like to search.


Solution Walkthrough

Log in to the OverTheWire server as bandit7 if you haven't already. Start by listing the contents of the current directory with the ls command.

Output of ls command in home directory

A file by the name of data.txt is shown to us. The level description says this is where the password is to be found. At this point we are ready to search the file with the grep command. The documentation tells us our command should appear as so: grep millionth data.txt

Output of grep command showing level 8 password next to word millionth

If you typed in the command properly, the results will show you the word we searched for, millionth along with any text located on the same line. In this instance, it happens to be the password for the next level.

Make sure to save the password: cvX2JJa4CFALtqS87jk27qwqGhBM9plV, exit out of the session, and then proceed to the next level.