OverTheWire Bandit Level 7->Level 8 - Walkthrough
In this post, I will be giving you a walkthrough to the Bandit wargame Level 7->Level 8. We will be using the "grep" command to find the password and clear the level. The grep command is a great utility in Linux and can be utilized in various ways. I would highly recommend you to explore on the usage of grep command and make yourself familiar with it.
Goal
Get the password for Level 8 from the file data.txt written next to the word millionth.
Login Details
Server - bandit.labs.overthewire.org
Port - 2220
Username - bandit7
Password - z7WtoNQU2XfjmMtWA8u5rN4vzqu4v99S
Theory
We can use the cat command to read the contents of the file and find the word "millionth" and get the password. However, the file contains thousands of words so it is not the efficient way to search a specific word in a file. Instead, we will be using the command "grep" to clear this level efficiently.
grep is used to find patterns in files. It returns the line that contains the pattern and thus we can have the password. Please go through this article to know more about the grep command.
Solution
SSH into the user bandit7 using the command "ssh bandit7@bandit.labs.overthewire.org -p 2220" and the above password. Type ls to see the file "data.txt" present in the home directory of the user.
Type the command "cat data.txt" and notice that there are many words present in the file.
Therefore, to find the password type the command "grep "millionth" data.txt"
This completes this level as we have got the password. Please post your doubts and suggestions in the comment section.






Comments
Post a Comment