Bandit11->12
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.
Commands useful to solve the level
Helpful Reading Material
Where to start?
By running file on our file data.txt, we know that our file contains ASCII text we can now safely work with it. We know from the Level Goal
that our file contains rot13 encoded data. Let's first run head on our file
You should get an output close to this one :
Gur cnffjbeq vf cnffjbeq_fgevat
Part 1 : Describing our transformation
ROT13 is the rotation of all the alphabetic characters of half the alphabet (13 positions). The goal of this part is to describe the starting set and the ending set of letters as two strings. It will be useful for translating our rotated string back to its original form.
Hint
Using the information you got about ROT13 by reading the wikipedia page and assuming that the base set is the alphabet (first the Uppercase and then the lowercase letters),
set that we will represent like this : A-Za-z which represents the string ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz. How would you represent the set of the
translated characters by ROT13?
Solution
The set of the translated characters can be represented as N-ZA-Mn-za-m which is to be understood as the
string NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm
Part 2 : Translating our data back to its original form
Now that we described the starting and ending set of the ROT13 transformation, we need to know how to actually
translate our data back to its original form. One thing we know from studying the rot13 behavior
(and reading the wikipedia page) is that rot13 is a
reciprocal cipher.
Which means that rot13 applied to itself gives back the original message.
Let's take our two sets of strings and see if there is a tool that could help us do the translation.
Hint
By taking a look at the section 9 of the gnu coreutils documentation, try to see we can use one of the tool described there to achieve the desired outcome.
Solution
By reading the section 9.1.2
we can see that the tr utility is the right tool for us. By using it with the two sets of character
we deduced in the previous part and by
redirecting
the input from our data.txt file, we can achieve the desired outcome.
Here is the full command :
tr 'A-Za-z' 'N-ZA-Mn-za-m' < data.txt
The password is password_string
Full Solution
tr 'A-Za-z' 'N-ZA-Mn-za-m' < data.txtis the command we use to translate our string back to its original form.
You can now jump to the next level