Bandit Level 6
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 file somewhere under the inhere directory and has all of the following properties: - human-readable - 1033 bytes in size - not executable
Commands you may need to solve this level¶
ls , cd , cat , file , du , find
Study guide¶
Level map: logged in as bandit5, find the password for bandit6.
What this level teaches¶
Searching a directory tree by properties instead of by name, with find.
Key ideas¶
find PATH testswalks a tree and prints entries matching every test you list. Tests include-type f(regular files),-sizeand-executable.- Size units matter. In
-size, a suffix selects the unit and a missing suffix means 512-byte blocks, not bytes. Checkman findfor the byte suffix before trusting a result. - Negation. A leading
!inverts a test, which is how you say "not executable". - Tests are combined with an implicit AND.
How to approach it¶
- Start broad (
find inhere -type f) and add one test at a time, watching the output shrink. - When exactly one file remains, check it with
filebefore reading it.
Why it matters¶
Locating files by size, owner or modification time is core incident-response work, for example finding recently changed files or unexpected setuid binaries.