Skip to content

Bandit 6 → 7

OverTheWire Linux Progressive

Goal: find the password file owned by user bandit7 and group bandit6, sized 33 bytes, somewhere on the system.

bandit6@bandit
bandit6@bandit:~$ find / -type f -size 33c -user bandit7 -group bandit6 2>/dev/null
/var/lib/dpkg/info/bandit7.password
bandit6@bandit:~$ cat /var/lib/dpkg/info/bandit7.password
The password you are looking for is: <password>
PasswordmorbNTDkSW6jIlUc0ymOdMaLnOlFVAaj

Searching from / matches by numeric owner and group metadata regardless of where the file sits, but most of the tree is unreadable to you, so find pours permission-denied messages onto stderr. Redirecting stderr to /dev/null (2>/dev/null) leaves only the valid match on stdout.