MayADevBe Blog

A Blog about Computer Science

OverTheWire Bandit Level 7 -> 8 - Walkthrough

Previous Level: Level 7


Login

SSH: ssh bandit7@bandit.labs.overthewire.org -p 2220

Password: HKBPTKQnIay4Fw76bEy8PVxKEDQRKTzs

Task

Get the password from a file, next to the word millionth

A little bit of Theory

I already gave a small introduction to grep in Level 6. grep can be used to search lines that contain a specific pattern like follow grep <pattern>.

With the pipe (|), we can pipe the output of cat to grep as input to look through a text file.

Solution

Checking the file size of data.txt, we can see it is huge:

1
2
bandit7@bandit:~$ du -b data.txt 
4184396 data.txt

So simply looking through the file, would take too long and be too much effort.

Instead, we can try using grep, since the password is in the same line as the word ‘millionth’

1
2
bandit7@bandit:~$ cat data.txt | grep millionth
millionth       cvX2JJa4CFALtqS87jk27qwqGhBM9plV

https://overthewire.org/wargames/bandit/bandit8.html


Next Level: Level 9


Share on: