BB

technology and craziness.

BB

technology and craziness.

OverTheWire - Bandit - Level 5 → Level 6

Warning: This post contains a solution!
Only continue if:
1.) you want to see a possible alternative solution or
2.) you are stuck and need a hint!

Connect to the server using the following credentials:

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

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

1
2
bandit5@bandit:~$ ls
inhere

A folder named “inhere__ is available.
Moving into this folder and listing available files:

1
2
3
4
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:

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

The results is:

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

Output the content of this file:

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

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

‘[:alnum:]’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

1
2
bandit5@bandit:~/inhere$ grep -Irw '[[:alnum:]]{32,33}' .
./maybehere07/.file2:DXjZxxxxxxxxxxxxxxxxxxxxxxxxxxxx