Wednesday, December 3, 2014

Bandit Level 5 to Level 6

Find and display human readable files by size in bytes and not executable.

Host name is bandit.labs.overthewire.org 
User: bandit5
password: koReBOKuIDDepwhWk7jZC0RTdopnAYKh

Commands used for this level:
ls - List information about the FILE's (the current directory by default).
cd - change directory.
man - an interface to the on-line reference manuals
find - search for files in a directory.
/ -  here we use it to search man pages
cat - used to view contents of a file.

Step 1.
 After logging in type ls
You will see a directory named inhere (you can tell its a directory instead of a file because it is a different color).


Step 2.
Type ls and we will see multiple directories that we need to search for a human readable file, that is 1033 bytes, and is not executable.

To do this we need to use the find command with some options.
2a. Type man find to view the man page for find command.
 To make finding this solution easier we can search the man page by typing    forward slash (/) once in the man page (the / is used to open the search option). Now type readable after the / and we see how to use the -readable option.
2b. We also need to find how to use size and executable options so press / again and search for size. This shows we need to use -size n (n being the size we are looking for followed by "c" to use bytes).
2c. Now press / again and search for executable and we see we need to use -executable as our last option but remember that we are looking for not executable so we will use ! in front of the -executable option (! is the computer programming symbol for NOT)
From our searching we now know our command will be find -readable -size 1033c ! -executable
Type find -readable - size 1033c ! -executable
We see our only file that fits our search options displayed is  ./maybehere07/.file2 


Step3.
 Last step is simply to display our found file.
 Type cat ./maybehere07/.file2 and the password for level 6 is displayed.
 DXjZPULLxYr17uwoI01bNLQbtFemEgo7




No comments:

Post a Comment