The password for the next level is stored in a hidden file in the inhere directory.
ls , cd , cat , file , du , find
bandit3@bandit:~$ ls
inhere
bandit3@bandit:~$ cat inhere
cat: inhere: Is a directory
We already know the commands `ls` and `cat`. However, this time, `inhere` is not a file; it's a directory, so we can't use the `cat` command. Therefore, we are going to move inside the `inhere` directory..
bandit3@bandit:~$ cd inhere/
bandit3@bandit:~/inhere$ ls
bandit3@bandit:~/inhere$
Using the `cd` command, we can move to another directory. However, even if we use the `ls` command, we won't find any files because it's a hidden file. Let's check the options of the `ls` command.
bandit3@bandit:~/inhere$ man ls
LS(1) User Commands LS(1)
NAME
ls - list directory contents
SYNOPSIS
ls [OPTION]... [FILE]...
DESCRIPTION
List information about the FILEs (the current directory by default). Sort entries alphabetically if none of
-cftuvSUX nor --sort is specified.
Mandatory arguments to long options are mandatory for short options too.
-a, --all
do not ignore entries starting with .
We can check the options using the `man` command. There, if we want to include entries starting with `.`, we can use the `-a` option.
bandit3@bandit:~/inhere$ ls -a
. .. ...Hiding-From-You
bandit3@bandit:~/inhere$ cat ...Hiding-From-You
2WmrDFRmJIq3IPxneAaMGhap0pFhF3NJ
Finally, we can find the hidden file! On Wikipedia, they explain hidden files as follows:
In Unix-like operating systems, any file or folder that starts with a dot character, commonly called a dot file or dotfile, is to be treated as hidden – that is, the ls command does not display them unless the -a or -A flags (ls -a or ls -A) are used.
Ref) https://en.wikipedia.org/wiki/Hidden_file_and_hidden_directory
Next Level : Level 4 -> 5
Bandit Level 5 -> Level 6 (0) | 2024.08.16 |
---|---|
Bandit Level 4 -> Level 5 (0) | 2024.08.12 |
Bandit Level 2 -> Level 3 (0) | 2024.08.07 |
Bandit Level 1 -> Level 2 (0) | 2024.08.05 |
Bandit Level 0 -> Level 1 (0) | 2024.08.04 |