Bandit level 11
Level Goal
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
Now the difficulty is taken up a notch, with the need to decipher the text in the file. To solve this I would reccomend taking a look at rot13 on wikipedia. It is a very simple encryption technique. But if this is your first time using deciphering techniques you might get the same feeling that Alan Turing got when he cracked the enigma.
Useful commands:
- ls
- cat
- tr
Solution - Spoiler Alert!
To solve the rot13 algorithm we need to shift each letter over 13 times. So grab your pen and paper and write two alphabets, with one of them shifted 13. Or maybe we can use a new command? According to the man pages of tr
its job is to 'translate or delete characters', and translating is exactly what we need to do. Instead of just asking AI to give us the command, we will build it our self for better understanding of how it works.
Let's take the first word as an example, which is 'Gur'. So let's translate that to 'Aaa' as a proof of concept. cat data.txt | tr 'Gur' 'Aaa'
now we can see that G translates to A, and the two other become a. So lets up the powers of the command with using range of characters. cat data.txt | tr 'A-Za-z' 'N-ZA-Mnz-a-m'
in the second part of the N-Z
part of the command we shift the first letters 'A-M' up in to the 'N-Z' space. So for the 'N-Z' to not be shifted in to nothing, we tell it to jump to A with A-M
, and the same goes for the lower case ones.
and with that command we have solved the flag.
Bonus tip: You can alias the tr
command by putting alias rot13="tr 'A-Za-z' 'N-ZA-Mn-za-m'"
in your .bashrc file.
Comments ()