The inhere directory holds several similarly-named files, only one of which is actual human-readable text. The file command identifies each file's real type without opening it.
| Platform | OverTheWire Bandit |
| Category | Linux Fundamentals |
| Level | 4 → 5 |
| Difficulty | Beginner |
| Technique | File type identification |
Level 4's inhere directory contains around ten files with near-identical names (like -file00 through -file09). Only one is a plain text file — the rest are decoys with random binary data.
"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."
Log in as bandit4, move into inhere, and see what's there:
cd inhere
ls -la
-file00 -file01 -file02 -file03 -file04
-file05 -file06 -file07 -file08 -file09
Rather than opening every file by hand, ask the file command what each one actually contains — it inspects the content, not just the name:
file ./*
./-file00: data
./-file01: data
./-file02: data
...
./-file07: ASCII text
./-file08: data
./-file09: data
Only one file is reported as ASCII text — that's the password. The filenames start with a dash, so use the same ./ fix from Level 1:
cat ./-file07
[PASSWORD FOR bandit5]
The password is deliberately hidden — follow the method, you've earned it. 💪
A file's extension or name tells you nothing reliable about its actual content — file reads the real bytes and reports the true type. It's one of the fastest ways to triage a pile of unknown files before deciding which ones are worth opening.
file inspects a file's actual content, not its name or extension./* runs it against every file in the directory at once./ fix as Level 1Connect to OverTheWire's Bandit wargame over SSH and read a plaintext readme file to get your first password. The very first step into the game.
Discuss this writeup with the community on the CTFdojo Discord.
Join the Discord →