Monday, July 31, 2017

OverTheWire-Bandit (Level 2 -> Level 3) - Walkthrough


Objective : 

The password for the next level is stored in a file called spaces in this filename located in the home directory.

Procedures : 

(a) Once logged into the new level, let us check whether we are inside the home directory or not.If not we will try to figure out the home directory and navigate using the path.

Checking For Home Directory


 pwd - Is used to know the current directory where we are in
/home/bandit2 - Home directory for the user bandit2

(b) Now we will look out for a file called spaces in this filename as mentioned in the objective by listing the files present in the home directory.

Displaying List Of Files Present In Current Directory
ls - Is used to display list of files in current directory.

Note : In-order to avoid the confusion in number of files present inside the directory, I would recommend to use switch -l along with ls command. Here switch -l is used to list all the files along with file properties.

(c) After finding the file, we want to read the contents of the file.

Reading Of File Contents

cat - Is used to read the contents of the file.
Since the name of the file contains white spaces. We would require something different technique to read the contents of the file. Hence used forward slash (\) and then white space.

The content displayed is the password for the next level.

Solution : UmHadQclWmgdLOKQ3YNgjWxGoRMb5luK

(d) Now we will use this password to login to next level using the below command 

ssh bandit3@bandit.labs.overthewire.org -p 2220

bandit3 - Is the username
UmHadQclWmgdLOKQ3YNgjWxGoRMb5luK - Is the password.

No comments:

Post a Comment

Thanks for reading the post! Please leave your feedback here :)