Level6

Level Goal

The password for the next level is stored somewhere on the server and has all of the following properties:

owned by user bandit7
owned by group bandit6
33 bytes in size

Solution

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

$ find / -user bandit7 -group bandit6 -size 33c 2>/dev/null
/var/lib/dpkg/info/bandit7.password

$ cat /var/lib/dpkg/info/bandit7.password
z7WtoNQU2XfjmMtWA8u5rN4vzqu4v99S

$

The find utility supports the -user, -group, and -size tests. Those test were used to find a file matching the given properties. “2>/dev/null” is redirecting any error messages to /dev/null to suppress them. See the find man page and the bash documenation on redirection to read more.