Wargame Walkthrough: Bandit level 7

This is a walkthrough to the bandit wargame made by OverTheWire. It can be found on their website at https://overthewire.org/wargames/bandit

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

This level is pretty easy if you know what you’re doing. After logging in to the level you can ‘cat’ the data.txt file to see that it has lots of lines filled with possible passwords next to random words.

Output of ‘cat’ command

We can find the word we want, millionth, by using ‘grep’. Grep takes the input you give it and cuts out every line but the ones with the thing you tell it to search for. In order to give grep something to search through, we have to use a pipe(|). A pipe takes the output of the command on the left of it and feeds it to the command on the right. Therefore the command would be: “cat data.txt | grep ‘millionth'”. This way we specify what we want grep to search through and what we want it to search for. When we do this we see the only line of text in the data file that contains the word millionth, and next to it is the password we are looking for. Save this password in your passwords file and move on to the next level!

This wargame can be found on https://overthewire.org/wargames/bandit
Check them out for more wargames and the rest of the levels.

Leave a Reply