Writeup - OverTheWire Bandit5

Writeup - OverTheWire Bandit5

This level is kind of an expansion on the previous one, where we began learning how to utilize different commands to filter search results.

In this exercise, the password for the next level is found in a file that is 1) human-readable, 2) 1033 bytes in size, and 3) is not executable.

That may seem like a lot, but once broken down, it's quite simple.

The first step, after ssh'ing into the level and using ls -la to view the available files, is to cd into the inhere directory. On viewing the contents of this directory, we see 22 other directories!

We could go through each one individually, but that would take an insane amount of time. So let's see if we can formulate a request to send that will filter out the exact file we need. We used the file command last time, but this time we'll use find instead.

If we look at the man page for find (man find), we see that it has all the options we need to craft this request. Here's what it looks like:

find -readable -size 1033c \! -executable

This searches the files in the current directory and filters by those that are 1) readable, 2) 1033 bytes (c) in size, and 3) non-executable (signified by the exclamation point before the -executable tag).

Good luck!

Here's a link to the man page for the find command!