Bandit Level 4
Bandit Level 4 — find a hidden dotfile inside the inhere directory with ls -a.
Source: This content is aggregated from overthewire (MIT). Visit the original repository for the latest version.
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
Study guide
Level map: logged in as bandit3, find the password for bandit4.
What this level teaches
How Unix hides files, and why that is a convention rather than a security feature.
Key ideas
- Dotfiles. Any file or directory whose name starts with
.is skipped by a plainls. They typically hold per-user configuration such as.bashrcor.ssh/. ls -ashows “all” entries, including.(this directory) and..(the parent).- Hidden is not secret. Anyone can list the files; the dot only reduces clutter.
How to approach it
- Enter the
inheredirectory. A plainlsappears empty, which is the clue. - Use the option that includes hidden entries, then print the file that is not
.or... - Combine options such as
-lato also see permissions and sizes.
Why it matters
Malware and attackers often hide persistence in dotfiles, and incident responders list them first. You will also meet dotfiles daily when configuring tools.