Home Bandit [Level 4] - Overthewire
Post
Cancel

Bandit [Level 4] - Overthewire

ssh bandit4@bandit.labs.overthewire.org -p 2220
bandit password: 2EW7BBsr6aMMoJ2HjW067dm8EgX26xNe

Task

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

Solution

Look ten file

1
2
3
4
5
6
7
8
9
10
11
12
13
14
bandit4@bandit:~$ ls -lah inhere/
total 48K
drwxr-xr-x 2 root    root    4.0K Apr 23 18:04 .
drwxr-xr-x 3 root    root    4.0K Apr 23 18:04 ..
-rw-r----- 1 bandit5 bandit4   33 Apr 23 18:04 -file00
-rw-r----- 1 bandit5 bandit4   33 Apr 23 18:04 -file01
-rw-r----- 1 bandit5 bandit4   33 Apr 23 18:04 -file02
-rw-r----- 1 bandit5 bandit4   33 Apr 23 18:04 -file03
-rw-r----- 1 bandit5 bandit4   33 Apr 23 18:04 -file04
-rw-r----- 1 bandit5 bandit4   33 Apr 23 18:04 -file05
-rw-r----- 1 bandit5 bandit4   33 Apr 23 18:04 -file06
-rw-r----- 1 bandit5 bandit4   33 Apr 23 18:04 -file07
-rw-r----- 1 bandit5 bandit4   33 Apr 23 18:04 -file08
-rw-r----- 1 bandit5 bandit4   33 Apr 23 18:04 -file09

Use different methods to find the human-readable file and therefore, the password.

We could just print the contents of every file (cat). This is, however, not very efficient when we deal with more files. Instead, we could use the method I mentioned in the theory part. The command structure is file . Instead of using a filename, we use a wildcard to get the type for all the files. Additionally, looking at the file names, specifically at the fact, the names start with ‘-’, gives us problems. Therefore we use the same method as in Level 2.

1
2
3
4
5
6
7
8
9
10
11
bandit4@bandit:~/inhere$ file ./*
./-file00: data
./-file01: data
./-file02: data
./-file03: data
./-file04: data
./-file05: data
./-file06: data
./-file07: ASCII text
./-file08: data
./-file09: Non-ISO extended-ASCII text, with no line terminators

Yeh, Look -file07 is of type ASCII text,

1
2
bandit4@bandit:~/inhere$ cat ./-file07
lrIWWI6bB37kxfiCQZqUdOIYfr6eEeqR

==> CTF: { lrIWWI6bB37kxfiCQZqUdOIYfr6eEeqR }

This post is licensed under CC BY 4.0 by the author.

Comments powered by Disqus.

Bandit [Level 3] - Overthewire

Bandit [Level 5] - Overthewire