Level 4: File Types (Human-Readable)

← Back to Guide

Level Goal

The password for the next level is hidden among several files (-file00 through -file09) in the inhere directory. Only one is human-readable.

Step-by-Step Solution

1. Exit Level 3 and SSH into Level 4

After retrieving the Level 4 password from ...Hiding-From-You, exit the current session:

exit

Then connect as bandit4:

ssh bandit4@bandit.labs.overthewire.org -p 2220

2. List the Home Directory Contents

Once logged in as bandit4, list files:

ls

You will see a directory named inhere.

3. Change into inhere

Enter the inhere directory:

cd inhere

4. Observe All Files with Leading Dashes

Running a regular ls lists:

ls

You will see files named -file00, -file01, …, up to -file09.

5. Identify the Human-Readable File

Instead of opening each file individually, use the file command to check their types:

file ./-*

This will output each filename along with its file type. Search for the one marked ASCII text.

The human-readable file is -file07.

6. Read -file07 to Obtain the Password

Display its contents:

cat ./-file07

The output is the password for bandit5.

Summary & Key Commands

  • exit : return to local machine from Level 3.
  • ssh bandit4@bandit.labs.overthewire.org -p 2220 : connect as bandit4.
  • ls : list files; shows inhere directory.
  • cd inhere : change into inhere directory.
  • ls : list -file00 through -file09.
  • file ./-* : identify file types; locate -file07 as ASCII text.
  • cat ./-file07 : display the human-readable file; retrieve the Level 5 password.