Skip to main content

Bandit Level 6 → 7

Shubham
Cybersecurity Enthusiast

Login : ssh bandit6@bandit.labs.overthewire.org -p 2220
password : HWasnPhtq9AVKe0dmk45nxy20cvUa6EG

task :

Find a file somewhere on the server with these properties:
-owned by user bandit7
-owned by group bandit6
-exactly 33 bytes in size

Theory lil bit:

  1. ls -l shows owner and group (3rd and 4th columns).
  2. Example: -rw-r----- 1 bandit7 bandit6 33 ... bandit7.password → user bandit7, group bandit6, size 33.
  3. find can search by owner and group: -user <name>, -group <name>.
  4. Use -type f to restrict to regular files and -size 33c to match exactly 33 bytes (c = bytes).
  5. Searching from / can produce many “Permission denied” messages; redirect stderr to /dev/null with 2>/dev/null to hide them.

solution:

bandit6@bandit:~$ find / -type f -user bandit7 -group bandit6 -size 33c 2>/dev/null
/var/lib/dpkg/info/bandit7.password
bandit6@bandit:~$ cat /var/lib/dpkg/info/bandit7.password
morbNTDkSW6jIlUc0ymOdMaLnOlFVAaj

<!-- truncate -->