Previous Level Guide: Bandit Level 8 → 9
Access
SSH: ssh bandit9@bandit.labs.overthewire.org -p 2220
Password: iwUb1RZFttts3xdhYfIgrWKjVxGJaJDY
Info
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. Commands: grep, sort, uniq, strings, base64, tr, tar, gzip, bzip2, xxd
Theory
To get the password, the instructions say that it's inside a binary file with a bunch of binary data, and in one of the few human readable parts is the password followed by a couple equals. So, I'd guess from this that we need the strings command, because not only it's the perfect fit for this, but it's the next command in the command list up there. Reading through its manual pages, it states that it goes byte by byte of the specified file checking that it's human readable, aka that it's on the ASCII table. And the other part of the instruction says that it's followed by various equal characters, so for that we can use the pipe character and grep, which is a command to find specific characters in large texts or files, that will become useful in the coming levels. Anyways, with all of this, we get a command like this:
strings data.txt | grep ===
You also might have realized that I'm using three of these equal signs, this is to reduce the amount of results from grep, because it says several, it must be 2 or more. Let's just see if it works.
Solution
Now you just have to get into the level and do the command:
~$ strings data.txt | grep === }========== the 3JprD========== passwordi ~fDV3========== is D9========== 4YQe2WV1KdZ0OZBCHdfi1XKijQnRc5LE
And that's it, it worked! Now we should be good to go to the next level.
https://overthewire.org/wargames/bandit/bandit10.htmlNext Level Guide: Bandit Level 10 → Level 11