Bandit Level 6 Solution

Bandit level 6 in an extension to level 4 and level 5 where you how to use find command to search for files owner by users and groups.

Let’s start by logging into bandit level 6 machine

ssh bandit6@bandit.labs.overthewire.org -p 2220

with the password that we got from our previous level.

DXjZPULLxYr17uwoI01bNLQbtFemEgo7

let’s list all the files that in our home directory

Since there’s nothing interesting, then let’s search the whole server.

Let’s structure the find command ( i will structure part of it, as the size is too specific :D)

find / -type f -group bandit6 -user bandit7 -size 33c 

you should get the following results

now there are a lot of “permission denied” errors, let’s make our results a bit cleaner.

find / -type f -group bandit6 -user bandit7 -size 33c 2> /dev/null

Now, let’s explain what is the command above

  • “/” is for root directory
  • -type f is for the type which is “file”
  • -size is to specify the size of the file we’re searching for
  • c is for bytes
  • -group to specify the group name
  • -user is to specify the user
  • 2> /dev/null to not display errors

now let’s read our file

and we should get level 7 password

HKBPTKQnIay4Fw76bEy8PVxKEDQRKTzs