Level 1 -> Level 2
Level 1 -> Level 2 is much the same as Level 0 -> Level 1 but this time the file containing the password is simply named ‘-‘, if you try to cat the file now nothing happens…
This is because ‘-‘ is often used to refer to stdin, so cat – would simply display the standard input (in this case the keyboard). This is shown when text is entered into the command line and enter is pressed, whatever text was inputted is simply repeated back to you.
The way around this is to specify that ‘-‘ is actually a file and the easiest way to do this is to give it a path with the prefix ./ . Now if cat ./- is entered the password will be revealed
Level 2 -> Level 3
This level presents a problem as the file in which the password is stored is named ‘spaces in this filename’, if we were to simply enter cat spaces in this filename, then the system would try to output the files ‘spaces’, ‘in’, ‘this’ and ‘filename’ separately.
We can tell the system that we want it to see the text as one string by adding quotation marks around the filename. By entering cat “spaces in this filename” we obtain the password and can move on to the next level.