Bandit Level 5 | CodeMaxx.github.io

Bandit Level 5

OverTheWire logo

Level Goal:

The password for the next level is stored in a file somewhere under the inhere directory and has all of the following properties: - human-readable - 1033 bytes in size - not executable

Commands you may need to solve this level

ls, cd, cat, file, du, find

Helpful Reading Material

None

Write-up

I cd-ed into the inhere directory to find numerous other directories within it. I looped through all the directories and searched for files of size 1033 bytes.

for x in `find . -type d -print`;
    do
        find $x -size 1033c -print;
    done

This gave me

./maybehere07/.file2
./maybehere07/.file2

Getting two exact same outputs was eerie. After some investigation I found out that find command is recursive and checks inside subdirectories on its own. Hence our loop was unecessary.

Thus a simple find inhere -size 1033c -print in the home directory would have done the job. cat ~/inhere/maybeinhere07/.file2 gives the password.

Level 6 password: DXjZPULLxYr17uwoI01bNLQbtFemEgo7

Follow @CodeMaxx
Bandit Level 4
Akash Trehan

Akash Trehan

Hacker-Developer-Geek

comments powered by Disqus
rss facebook twitter github youtube mail spotify instagram linkedin google pinterest medium -->