The password for the next level is stored in a file called spaces in this filename located in the home directory
ls , cd , cat , file , du , find
bandit2@bandit:~$ cat spaces in this filename
cat: spaces: No such file or directory
cat: in: No such file or directory
cat: this: No such file or directory
cat: filename: No such file or directory
It doesn't work like a before challenge. It treats 'spaces', 'in', 'this', 'filename' as different filenames.
There are a few ways to deal with this problem.
bandit2@bandit:~$ cat "spaces in this filename"
MNk8KNH3Usiio41PRUEoDFPqfxLPlSmx
bandit2@bandit:~$ cat 'spaces in this filename'
MNk8KNH3Usiio41PRUEoDFPqfxLPlSmx
First, we can enclose a file name with a single or double quotes to indicate that all names belong to one file name.
bandit2@bandit:~$ cat spaces\ in\ this\ filename
MNk8KNH3Usiio41PRUEoDFPqfxLPlSmx
Second, we can also represent the spaces with a backslash (\).
bandit2@bandit:~$ find . -name "spaces in this filename" -exec cat {} \;
MNk8KNH3Usiio41PRUEoDFPqfxLPlSmx
Finally, we can utilize the 'find' command and the exec option to display the file.
Next Level : Level 3 -> 4
Bandit Level 4 -> Level 5 (0) | 2024.08.12 |
---|---|
Bandit Level 3 -> Level 4 (0) | 2024.08.10 |
Bandit Level 1 -> Level 2 (0) | 2024.08.05 |
Bandit Level 0 -> Level 1 (0) | 2024.08.04 |
Bandit Level 0 (0) | 2024.08.02 |