OverTheWire Bandit Level 4 Writeup — Spot the Real Text File Among Junk

Misc 2026-09-24 · OverTheWire Bandit · By CTFdojo · ⏱ ... · 👁 ... views
𝕏 Share
TL;DR

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.

PlatformOverTheWire Bandit
CategoryLinux Fundamentals
Level4 → 5
DifficultyBeginner
TechniqueFile type identification

Challenge description

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."

Step 1 — List the decoy files

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

Step 2 — Identify each file's real type

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

Step 3 — Read the real text file

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]
🔑 password intentionally hidden

The password is deliberately hidden — follow the method, you've earned it. 💪

Key takeaways

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.

Resources

Related reading

Misc 2026-09-24

OverTheWire Bandit Level 0 Writeup — Find Your First Password

Connect 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.

CTFdojo
CTFdojo
Community of ethical hackers writing beginner-friendly CTF writeups and guides.

Got a question or a different approach?

Discuss this writeup with the community on the CTFdojo Discord.

Join the Discord →