Monday, December 8, 2014

Bandit Level 11 to Level 12

Decoding ROT13

Host name is bandit.labs.overthewire.org 
User: bandit11
password: IFukwKGsFW8MOq3IRFqrxE1hxTNEbUPR


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.
tr - translate or delete characters.

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


Step 2.
In that data.txt file we need read some ROT13 encoded data.
http://en.wikipedia.org/wiki/ROT13
ROT13 is a simple letter substitution cipher that replaces a letter with the letter 13 letters after it in the alphabet.
Linux has a command called tr so lets type man tr to learn about this command.
We see that tr will translate, squeeze, and/or delete characters from standard input, writing to standard output. With this command we can tell it to rotate an input of characters 13 letters after by using tr with a-zA-Z n-za-mN-ZA-M.
What this does is it tells the tr command to match the input letters from a-z and A-Z (lower case and upper) to 13 characters after those being n-za-mN-ZA-M. We need to type the second part this way because the command does not know that it should go back to a after hitting z so 13 characters after a is n and so on then if it goes past z to start at a again.

Step3.
Now all we need to do is cat data.txt and pipe it to the tr command with our ROT13 cipher.
Type cat data.txt | tr a-zA-Z n-za-mN-ZA-M and our decoded ROT13 data is displayed: The password is 5Te8Y4drgCRfCx8ugdwuEX8KFC6k2EUu

No comments:

Post a Comment