The Goal
The password for Level 4 is stored in a hidden file inside a directory called inhere.
The Approach
In Linux, files and directories whose names begin with . are hidden by default.
The standard ls command does not show them. Navigating into inhere
and running a plain ls returns nothing. Using ls -a reveals all files
including hidden ones:
bandit3@bandit:~$ ls
inhere
bandit3@bandit:~$ cd inhere/
bandit3@bandit:~/inhere$ ls
(no output)
bandit3@bandit:~/inhere$ ls -a
. .. ...Hiding-From-You
bandit3@bandit:~/inhere$ ls -l -a
total 12
drwxr-xr-x 2 root root 4096 Oct 14 09:26 .
drwxr-xr-x 3 root root 4096 Oct 14 09:26 ..
-rw-r----- 1 bandit4 bandit3 33 Oct 14 09:26 ...Hiding-From-You
bandit3@bandit:~/inhere$ cat ...Hiding-From-You
password
Commands Covered
ls -a, list all files, including hidden ones (those starting with.)ls -l -a, long listing with hidden files, showing permissions and ownership