OverTheWire – Bandit Level 4 Solution

I figured it may be fun to go through all of the OverTheWire Bandit Wargames, which are aimed at absolute beginners who want to start learning about security principles.

My aim will be to provide a very simple explanation of how each game is played, which will hopefully expand my own knowledge and help a few of you at the same time.

All posts in this serial have been tagged #OverTheWire.

Level Goal

The password for the next level is stored in the only human-readable file in the inhere directory. Tip: if your terminal is messed up, try the “reset” command.

Commands you may need to solve this level

ls, cd, cat, file, du, find


The goal here isn’t as clear as most of the other levels, but effectively what they’re actually looking for is for you to find the only file that has an ASCII text data type. Which can be done using the file command.

  1. Type ‘ls’ to list all files and directories. You should find a directory called “inhere”.
  2. Navigate into the “inhere” directory by typing “cd inhere”.
  3. Type ‘ls’ to list all files again.
  4. We can see there are 10 files, but to figure out which file is correct let’s return the type of file.
  5. Type “file ./-file*” which will return the data type of all files in the directory.
  6. A single file “-file07” has ASCII text, which seems to be the file we’re looking for.
  7. Type “cat ./-file07” to output the contents of the file.
  8. You should find the password for the next level is “koReBOKuIDDepwhWk7jZC0RTdopnAYKh”.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.