Bandit Level 5-6@overthewire.org
Description
The password for the next level is stored in a file somewhere under the inhere directory and has all of the following properties:
- human-readable
- 1033 bytes in size
- not executable
Current level credentials
Key | Value |
---|---|
Server-name: | bandit.labs.overthewire.org |
Port: | 2220 |
User: | bandit5 |
Password: | lrIWWI6bB37kxfiCQZqUdOIYfr6eEeqR |
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)
In the manpage for find
, look up what options you need to use to find a file with the specified attributes.
One option needs to be negated, consult the man page to learn how to negate options.
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 33 34 |
|
- use find with necessary options and pipe the output to grep
- use
tr
to remove the empty spaces
Like in the previous level, we use the find
command but with additional options.
Using man find
, we search for the necessary options.
- 1033 bytes -
-size 1033c
- not executable -
! -executable
, using the options!
or-not
, we negate the executable flag - human readable -
find ..... -exec file {} + | grep ASCII
.
We run the file
command on each file we find, then pipe the output to grep. Since ASCII
is human readable, we display that filename if the output of that piped command contains it. We cat
that filename. The output has a large number of empty spaces, therefore we use the command tr -d " "
to remove them all.
Resources
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