Friday, December 5, 2014

Bandit Level 9 to Level 10

Find a string of human-readable lines in a text file.

Host name is bandit.labs.overthewire.org 
User: bandit9
password: UsvVyFSfZZWbi6wgC7dAFyFuR6jQQUhR

Commands used for this level:
ls - List information about the FILE's (the current directory by default).
cat - used to view contents of a file.
strings - print the strings of printable characters in files.
grep - print lines matching a pattern.

Step 1.
After logging in type ls
You will see a file data.txt

Step 2.
In that data.txt file we need to find a string that is human-readable and starts with the = character. Lets do a cat on the data.txt file to see what the data looks like.
Type cat data.txt
We see that we have a file with mostly garbled data. Now we could just scroll up through the data and look for the = characters along with the only human-readable text to find the password but lets use some tools to find our password.

Step 3.
We know we are looking for a string of characters so lets do a man strings.
We see that strings prints the printable character sequences that are at least 4 characters long. Perfect for looking for a string of character that would be our password.
Type strings data.txt
We can clearly see our password here but lets narrow it down to be sure.

Step 4.
We know we are looking for a string that starts with = characters and grep is a tool that we can use to print lines of a matching character. Lets do a man grep.
We see that grep searches the named input file for lines containing a match to a given pattern. Lets pipe our strings command to grep with a "=" as a search pattern.
Type strings data.txt | grep "=" and our password for level 10 is displayed but we can shorten our ouput even more by using "==" as a search pattern for grep.
4a. Type strings data.txt | grep "==" and we get our full desired output.
truKLdjsbJ5g7yyJ2X2R0o3a5HQJFuLk

1 comment:

  1. I thought this hacking thing was a joke until I needed someone to hack into my inheritance. I was introduced to skytocryptohacker@gmail.com by a Friend , He hacked through my cheating wifes Facebook account and Instagram dm to reveal her secrets, first he shows you proof and guarantee that your job will be done. He has helped most of my friends whose name i can't mention on here, feel free to reach him.he is a very real professional hacker who has worked for me so many times in this past month. He is very good at hacking. He offers legit services such as clearing of bad records online without it being traced backed to you, he clones phones, hacks facebook

    ReplyDelete