OverTheWire Bandit Level 4–5

br4ind3ad
2 min readJan 18, 2021

Given: The password for the next level is stored in the only human-readable file in the inhere directory.

Tip: if your terminal is messed up, try the “reset” command.

Commands you may need to solve this level

ls, cd, cat, file, du, find

→ firstly ssh into bandit 4

ls -la to see the content of the pwd

bandit4@bandit:~$ ls -la
total 24
drwxr-xr-x 3 root root 4096 May 7 2020 .
drwxr-xr-x 41 root root 4096 May 7 2020 ..
-rw-r — r — 1 root root 220 May 15 2017 .bash_logout
-rw-r — r — 1 root root 3526 May 15 2017 .bashrc
drwxr-xr-x 2 root root 4096 May 7 2020 inhere
-rw-r — r — 1 root root 675 May 15 2017 .profile

→ we see the inhere folder, cd into it & view its content using ls

bandit4@bandit:~$ cd inhere/

bandit4@bandit:~/inhere$ ls
-file00 -file01 -file02 -file03 -file04 -file05 -file06 -file07 -file08 -file09

using the file command view the type of file it is.(human-readable(e.g. ‘ASCII text’) or MIME type(e.g. ‘text/plain; charset=us-ascii’))

bandit4@bandit:~/inhere$ file ./*
./-file00: data
./-file01: data
./-file02: data
./-file03: data
./-file04: data
./-file05: data
./-file06: data
./-file07: ASCII text
./-file08: data
./-file09: data

Here, we can see that only -file07 is ASCII i.e. human-readable.

so cat the dashed file07

to cat a dash file syntax is “cat < -name”

bandit4@bandit:~/inhere$ cat < -file07
koReBOKuIDDe*******C0RTdopnAYKh

:) leveled up to bandit5, enjoy the hustle.

P.S. meaning of ./*

./ means current working directory’s parent directory;

* means apply for all file

--

--