OverTheWire: Bandit Level 4

Akash Ambashankar
1 min readNov 27, 2020

In the last post, we gained access to bandit3. Let’s now find the password for bandit4.

Level 4

Level Goal

The password for the next level is stored in a hidden file in the inhere directory.

Commands you may need to solve this level

ls, cd, cat, file, du, find

Let’s first use ls and see what we have in our current directory.

bandit3@bandit:~$ ls
inhere

We see that there’s a directory named inhere (depending on your terminal, a directory will have some indication to distinguish it from a file).

The password for the next level is stored in a hidden file in the inhere directory.

So we need to get into the inhere directory. Let’s change our current directory to inhere by using the cd command.

bandit3@bandit:~$ cd inhere
bandit3@bandit:~/inhere$

And we now see that our terminal has changed from bandit3@bandit:~$ to bandit3@bandit:~/inhere$.

This means that we have successfully changed directories.

Now let’s find out what’s there in the inhere directory.

bandit3@bandit:~/inhere$ ls
bandit3@bandit:~/inhere$

Nothing? Let’s read the Level Goal again.

The password for the next level is stored in a hidden file in the inhere directory.

So, the file we’re looking for is hidden.

To view hidden files, run the ls command with the -a flag which enables viewing of all files in a directory.

bandit3@bandit:~/inhere$ ls -a
. .. .hidden

Now, we see a file named .hidden (files whose names begin with a ‘.’ are usually hidden).

Now let’s read the contents of .hidden

bandit3@bandit:~/inhere$ cat .hidden
pIwrPrtPN36QITSp3EQaw936yaFoFgAB

And we have the password for bandit4!

pIwrPrtPN36QITSp3EQaw936yaFoFgAB

Happy Hacking!

--

--