Bandit 6 → 7
Goal: find the password file owned by user bandit7 and group bandit6, sized 33 bytes, somewhere on the system.
Approach
Section titled “Approach”bandit6@bandit:~$ find / -type f -size 33c -user bandit7 -group bandit6 2>/dev/null/var/lib/dpkg/info/bandit7.passwordbandit6@bandit:~$ cat /var/lib/dpkg/info/bandit7.passwordThe password you are looking for is: <password>Password
morbNTDkSW6jIlUc0ymOdMaLnOlFVAajWhy it works
Section titled “Why it works”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.