Previous Level Guide: Bandit Level 10 → 11
Access
SSH: ssh bandit11@bandit.labs.overthewire.org -p 2220
Password: Bs6Tmc8QChGv9uHys5wZ8MtqZ3W1KmFv
Info
Description: The password for the next level is stored in the file data.txt, where all lowercase (a-z) and uppercase (A-Z) letters have been rotated by 13 positions Commands: grep, sort, uniq, strings, base64, tr, tar, gzip, bzip2, xxd
Theory
To get the password, the instructions say that it's inside a file that is rotated by 13 positions, this is exactly what a caesar cipher is, you basically get the alphabet in order and shift all the positions, so a rotation of 3 positions would make A become D, B to E, C to F, and so on. The rotation by 13 positions, or rot13 for short, is the most common position rotation value because it does a full rotation of the letters, this means that the end and start are at the very center of the alphabet. So to do a rot13, you can do it the easy route, which is just to look up a caesar cipher online, then put the rotation to 13, or you can also do it from the terminal/shell using commands, which is what I'm gonna do in this guide. So first we are going to use tr, which is a command that lets you translate characters, so then we can use this to translate the half point of the alphabet to the beginning and viceversa, so that means A-Z goes to N-A and Z-M, it starts at N and finishes at M, goes all the way arround, also forgot to mention that we have to do this for the lowercase letters. Finally, this command doesn't work on files, so like other times that I have explained, we just use cat with a pipe character, and we get a command like this:
cat data.txt | tr 'A-Za-z' 'N-AZ-Mn-az-m'
Solution
For example, if we just use cat for the file the text will be really weird:
~$ cat data.txt Gur cnffjbeq vf b1HlSUOA4jntIPOeXBKE6HyZy43mh0uG
Now you just have to get into the level and do the command:
~$ cat data.txt | tr 'A-Za-z' 'N-AZ-Mn-az-m' The password is o1UyFHBN4wagVCBrKOXR6UlMl43zu0hT
And that's it, it worked! Now we should be good to go to the next level.
https://overthewire.org/wargames/bandit/bandit12.htmlNext Level Guide: Bandit Level 12 → Level 13