Level5

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

Solution

root@0xCAB: /writeups/overthewire/bandit/level5/

$ find inhere/ \! -executable -size 1033c -exec grep -I . {} \; -print
P4L4vucdmLnm8I7Vl7jG1ApGSfjYKqJU
inhere/maybehere07/.file2

$

The find utility is used to search for files in a directory structure. The first option “inhere/” defines the starting point for the search which is the inhere directory. The “! -executable” expression is looking for files that are not executable. The “-size 1033c” expression is looking for files that are 1033 bytes in size. For each file find is processing, it will execute the command “grep -I” on it which processes binary files as if they did not contain matching data. See the find and grep man pages to read more.