OverTheWire - Bandit - Level 5 → Level 6

Connect to the server using the following credentials:

Server: bandit.labs.overthewire.org
Port: 2220
Username: bandit5
Password: koReBOKuIDDepwhWk7jZC0RTdopnAYKh

Let us have a look at the files in the current folder:

bandit5@bandit:~$ ls

A folder named "inhere" is available.
Moving into this folder and listing available files:

bandit5@bandit:~$ cd inhere/
bandit5@bandit:~/inhere$ ls
maybehere00  maybehere02  maybehere04  maybehere06  maybehere08  maybehere10  maybehere12  maybehere14  maybehere16  maybehere18
maybehere01  maybehere03  maybehere05  maybehere07  maybehere09  maybehere11  maybehere13  maybehere15  maybehere17  maybehere19

Well, those are a bunch of folders and each folder contains some files.
But from the level goal we know, that our file has following properties:

- human-readable
- 1033 bytes in size
- not executable

This can be used to parametrize the "find" command as follows:

bandit5@bandit:~$ find . -size 1033c ! -executable

The results is:

bandit5@bandit:~/inhere$ find . -size 1033c ! -executable

Output the content of this file:

bandit5@bandit:~/inhere$ cat ./maybehere07/.file2

Another way is to search a string with the length between 32-33 with "alnum" characters.

Alphanumeric characters: ‘[:alpha:]’ and ‘[:digit:]’; in the ‘C’ locale and ASCII character encoding, this is the same as ‘[0-9A-Za-z]’.

Source: https://www.gnu.org/software/grep/manual/html_node/Character-Classes-and-Bracket-Expressions.html
bandit5@bandit:~/inhere$ grep -Irw '[[:alnum:]]{32,33}' .
Show Comments