Bandit Level 6-7
There are two ways to solving this task, using either skill or precision.
Luck: use the find command to list all of the files of the given size and hope to find it.
It is the last file that will pop up on our screen and the name gives it up.
find / -type f -size 33c -exec file -- {}
output: ... /run/udev/data/+bdi:253:540: ASCII text /run/udev/data/+bdi:253:539: ASCII text /run/udev/data/+bdi:253:538: ASCII text /run/udev/data/+bdi:253:537: ASCII text /var/lib/dbus/machine-id: ASCII text /var/lib/dpkg/info/libkrb5support0:amd64.shlibs: ASCII text /var/lib/dpkg/info/libcurl3-gnutls:amd64.shlibs: ASCII text /var/lib/dpkg/info/bandit7.password: ASCII text
Precise:
We can add all of the other details that the tasks provides us.
find / -type f -size 33c -user bandit7 -group bandit6 -exec file -- {} +
This will do the job, but will fill our screen with information about lack of permission. We can solve this by adding 2>/dev/null at the end. The "2>" redirects all of the errors to the specified place, in this case /dev/null. /dev/null is a special place in linux systems where everything is deleted as soon as it arrives, like a black hole.
find / -type f -size 33c -user bandit7 -group bandit6 -exec file -- {} + 2>/dev/null
output: /var/lib/dpkg/info/bandit7.password: ASCII text
Surely enough, the flag is there.