back
Bandit 05 - writeups
Sharing this writeups by following overthewire rules.
This writing is for Level 5.
Bandit Level 5 → Level 6
ssh bandit5@bandit.labs.overthewire.org -p 2220
found password: 4eQYVPkxZOOEOO5phW81FB8j8lxYHGT5
bandit5@bandit:~$ ls
inhere
bandit5@bandit:~$ cd inhere
bandit5@bandit:~/inhere$ ls
maybehere00 maybehere03 maybehere06 maybehere09 maybehere12 maybehere15 maybehere18
maybehere01 maybehere04 maybehere07 maybehere10 maybehere13 maybehere16 maybehere19
maybehere02 maybehere05 maybehere08 maybehere11 maybehere14 maybehere17
bandit5@bandit:~/inhere$ ls -la
total 88
drwxr-x--- 22 root bandit5 4096 Oct 14 09:26 .
drwxr-xr-x 3 root root 4096 Oct 14 09:26 ..
drwxr-x--- 2 root bandit5 4096 Oct 14 09:26 maybehere00
drwxr-x--- 2 root bandit5 4096 Oct 14 09:26 maybehere01
drwxr-x--- 2 root bandit5 4096 Oct 14 09:26 maybehere02
drwxr-x--- 2 root bandit5 4096 Oct 14 09:26 maybehere03
drwxr-x--- 2 root bandit5 4096 Oct 14 09:26 maybehere04
drwxr-x--- 2 root bandit5 4096 Oct 14 09:26 maybehere05
drwxr-x--- 2 root bandit5 4096 Oct 14 09:26 maybehere06
drwxr-x--- 2 root bandit5 4096 Oct 14 09:26 maybehere07
drwxr-x--- 2 root bandit5 4096 Oct 14 09:26 maybehere08
drwxr-x--- 2 root bandit5 4096 Oct 14 09:26 maybehere09
drwxr-x--- 2 root bandit5 4096 Oct 14 09:26 maybehere10
drwxr-x--- 2 root bandit5 4096 Oct 14 09:26 maybehere11
drwxr-x--- 2 root bandit5 4096 Oct 14 09:26 maybehere12
drwxr-x--- 2 root bandit5 4096 Oct 14 09:26 maybehere13
drwxr-x--- 2 root bandit5 4096 Oct 14 09:26 maybehere14
drwxr-x--- 2 root bandit5 4096 Oct 14 09:26 maybehere15
drwxr-x--- 2 root bandit5 4096 Oct 14 09:26 maybehere16
drwxr-x--- 2 root bandit5 4096 Oct 14 09:26 maybehere17
drwxr-x--- 2 root bandit5 4096 Oct 14 09:26 maybehere18
drwxr-x--- 2 root bandit5 4096 Oct 14 09:26 maybehere19
bandit5@bandit:~/inhere$ find . -type f -size 1033c ! -executable -readable
./maybehere07/.file2
bandit5@bandit:~/inhere$ cat ./maybehere07/.file2
33asnPhtq9AVKe0dmk45nab20cvUa725
Explanation:
findstarts searching from the current directory (~/inhere).-type flimits results to regular files (not directories or links).-size 1033cmatches files exactly 1033 bytes (c= bytes).! -executableexcludes executable files (logical NOT).-readableensures files are readable by your user (bandit5); the command as typed has a logical error (should be! -readableto exclude unreadable files, but it worked here since.file2is readable).