Previous Level Guide: Bandit Level 3 → 4
Access
SSH: ssh bandit4@bandit.labs.overthewire.org -p 2220
Password: 6AaC5CLQkKW4jfEizmu7h1Bq7narlA6A
Info
Description: 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: ls, cd, cat, file, du, find
Theory
To get the password, the instructions say that it's the only file thats human readable inside the inhere folder. First we'd have to use cd to enter in inhere and see whats inside the folder, because we cant get much more from this.
Solution
Now we just look for the folder:
~$ ls inhere
And we enter in the folder then see what's inside:
~$ cd inhere ~/inhere$ ls ~/inhere$ ls -a . .. -file00 -file01 -file02 -file03 -file04 -file05 -file06 -file07 -file08 -file09
Now, after looking at the manual pages for a bit, file is the exact command we need, as what it does is to guess what type of file it is by looking at it's contents, so if we use this command on all the files, we should get all data files except for one human readable file. And so, if we do that, we should get something like this:
~/inhere$ file ./* ./-file00: data ./-file01: data ./-file02: data ./-file03: data ./-file04: data ./-file05: data ./-file06: data ./-file07: ASCII text ./-file08: data ./-file09: data
As, you might have noticed, I used ./* after file instead of going one by one, this is so that it does the file command on all the files (that's why the asterisk) in the current directory (that's why the ./).
Now we just open the file that says "ASCII text", which means that it uses characters that can be understood by humans, thereby human readable, and just use cat to print the contents of the file, or well, the password and use exit to logout and go to the next level using the password we got:
~/inhere$ cat ./-file07 S5OaPLeSSUs49foWliHtl0xbrqITe1ghhttps://overthewire.org/wargames/bandit/bandit5.html
Next Level Guide: Bandit Level 5 → Level 6