OverTheWire: Bandit Level 7
This is going to be a walkthrough of Level 7 of Bandit from OverTheWire Wargames.
We found the password from level 6.
Username: bandit7
Password: HKBPTKQnIay4Fw76bEy8PVxKEDQRKTzs
The information on the website tells us that the password is stored in the file data.txt
next to the word millionth
.
Let’s start by SSH-ing into the box and we see that data.txt
is in the home directory.
The first thing we notice is that the file has 4 million bytes.
Instead of using cat
and having the screen filled with information, we can use a command less
, which limits the amount shown on screen at any time. This is the same command that is called if you were looking up a man page and makes it easy to navigate a file.
When we less
the file, we see it is filled with word password pairs and would take a long time to go through each line in search of the word millionth
.
This is where the command grep
comes in which can search a file for a particular string of characters.
So when we search the file using grep
and the string equal to millionth
, it finds the line containing millionth
and pulls out the line, including the password.
To continue, please read my Bandit 8 walkthrough. Level 8
Thank you for reading.