Bandit Level 6 → 7
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:
ls -lshows owner and group (3rd and 4th columns).- Example:
-rw-r----- 1 bandit7 bandit6 33 ... bandit7.password → user bandit7, group bandit6, size 33. - find can search by owner and group:
-user <name>,-group <name>. - Use
-type fto restrict to regular files and-size 33cto match exactly 33 bytes (c = bytes). - Searching from
/can produce many “Permission denied” messages; redirect stderr to/dev/nullwith2>/dev/nullto 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 -->
