OVERTHEWIRE – BANDIT LEVEL 7 -> LEVEL 8
ssh bandit7@localhost
HKBPTKQnIay4Fw76bEy8PVxKEDQRKTzs
Moving on through the bandit universe, let’s see how we can get to level 8.
The password for the next level is stored in the file data.txt next to the word millionth. Seems simple enough, right?
Let’s login as bandit7 (remember that if you disconnect after solving a level you will need to use ssh bandit[number]@bandit.labs.overthewire.org -p 2220, otherwise use the above command).
First thing we do after we login is to pwd to print working directory and ls it’s contents.

The file is in the working directory so the search for the file ends here. As we’ve seen before all we have to do now is use the cat command get the password and move to the next level. But if we run cat data.txt it returns many rows and we would have to go through each one of them.

In order to avoid this situation we will use the grep command (here is a link to the man page of the grep command and the wiki page) along with cat.
cat data.txt | grep "millionth"
grep - is used for searching plain-text data sets for lines that match a regular expression

