Bandit Level 9-10@overthewire.org
Description
The password for the next level is stored in the file data.txt in one of the few human-readable strings, preceded by several "=" characters.
Current level credentials
Key | Value |
---|---|
Server-name: | bandit.labs.overthewire.org |
Port: | 2220 |
User: | bandit9 |
Password: | EN632PlfYiZbn3PhVK3XOGSlNInNE00t |
Current level login
Log in
1 |
|
sshpass
before using it. The ssh
command can also be used on its own. If so, copy-paste the password when requested.
Hints And Solution
Hint(s)
The data looks messed up when displayed with cat
. Determine the file's data type. There is a command for that.
A command exists to extract human-readable strings from a binary file.
Because the output isn't that large, you can examine it in this case. But what if the output was significantly longer? How would you filter the output to show only the lines you require? According to the description, the password is preceded by several =
characters. That could be an option for a filter.
Use pipes |
. Use grep
to filter the output.
Solution
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
|
- the output from
cat
is unreadable - the
data.txt
file has the data typedata
- we can extract some human-readable strings with the command
strings
- using
grep
, we can further filter the output to find the password. - the password for the next level
ls -al
shows that the file data.txt
is in the home directory. When we use the command cat
to display the file's content, we get characters we can't read. It is a (binary) data file, as can be seen if we use the command file
to determine the file type. With the command strings
, we may extract human-readable strings from binary files. If we take into consideration the level description ("preceded by several =
characters") and pipe the output from strings
to grep
with the search string, for instance,===
, we get some readable strings, and the password is in the last line.
Additional information:
How do you know the password is on the last line? There are two indicators. If you read the readable strings from first to last, it says "the password is xxxxxxxx." The password's length serves as the second indicator. All passwords up until this point have been 32 characters long. This password is also. The command wc -c
can be used to determine the length of a string. echo -n abcdefghijklmnoprstuvwxyz1234567 | wc -c
, for instance.
Resources
Resources
Bandit-level9@overthewire
file @linux.die.net
strings @linux.die.net
wc @linux.die.net
grep @linux.die.net
Comments
Any feedback and suggestions are welcome. This website was created using mkdocs and the material plugin. If you want, you can make a pull request. The repository is https://github.com/dabonzo/itsec_hp