Showing posts with label #overthewire. Show all posts
Showing posts with label #overthewire. Show all posts

Thursday, August 3, 2017

OverTheWire-Bandit (Level 5 -> Level 6) - Walkthrough


Objective :

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

Procedure :

(a) Lets first check and understand with the directory structure and the files present inside the directory.

Understanding Overall Of The Directory Structure

cd - Used to change directory
ls - Used to list the directory contents
.. - Along with cd command, it is used to go back to the previous directory.

(b) After having an idea of the directory structure, lets find the file with the criteria mentioned in the objective.

Finding Of The File As Per Criteria Mentioned In The Objective

find - Command used to search for a file
size - Is switch present in find command used to fetch files with file size . Suffix 'c' is used to denote bytes.
type - Is swich present in find command use to fetch files with file type. Suffix 'f' is used to denote regular file(i.e. not executable file).

(c) Now after retrieving the desired output, lets check whether the respective file is human readble file or not.

Checking Whether File Is Human Readable Or Not

file - This command is used to determine the file type.

(d) After checking file with all criteria as mentioned in the objective lets read the content of the file.

Reading Contents Of Human Readable File

cat
- Is used to read the contents of the file.

The content displayed is the password for the next level.

Solution : DXjZPULLxYr17uwoI01bNLQbtFemEgo7

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

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

bandit6 - Is the username
DXjZPULLxYr17uwoI01bNLQbtFemEgo7 - Is the password.

OverTheWire-Bandit (Level 4 -> Level 5) - Walkthrough


Objective : 

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.

Procedure : 

(a) First lets traverse in the inhere directory and see how many files are present.

Displaying List Of Directory Contents Present In Current Directory

cd - Used to change directory
ls - Used to list directory contents

(b) Now we have to find a file which is human readable file.
Finding Human Readable File Consisting Of ASCII Encoding Text

file - This command is used to determine the file type
./-file0* - Is used to navigate each and every file which starts with -file0x. Where x is number from 0 to 9.

(c) Once we know human readable file, we will try to read its content.

Reading Contents Of Human Readable File

cat - Is used to read the contents of the file.

The content displayed is the password for the next level.

Solution : koReBOKuIDDepwhWk7jZC0RTdopnAYKh

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

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

bandit5 - Is the username
koReBOKuIDDepwhWk7jZC0RTdopnAYKh - Is the password.

Monday, July 31, 2017

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


Objective : 

The password for the next level is stored in a hidden file in the inhere directory.

Procedures : 


(a) Once logged into the next level, lets list all the files and directories present inside the current directory.

Displaying List Of Directory Contents Present In Current Directory
ls - Used to list the files present in the current directory.

(b) Now we will navigate inside the inhere directory

Changing Directory to inhere Directory
cd - Is used to change the directories.


(c) Now the password is stored in hidden file as mentioned in the objective. In-order to list all hidden files and folders we need to use ls command with -a and -l switches.

Displaying List Of Contents Inside Directory Including Hidden Contents
ls - Is used to display list of files in current directory.

Note : You can also use the manual page for the commands in order to understand their respective switches. 
Syntax : man <command>

(d) Now lets read the content of the hidden file.

Reading Contents Of The Hidden File
cat - Is used to read the contents of the file.


The content displayed is the password for the next level.

Solution : pIwrPrtPN36QITSp3EQaw936yaFoFgAB

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

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

bandit4 - Is the username

pIwrPrtPN36QITSp3EQaw936yaFoFgAB - Is the password.

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.

Friday, July 28, 2017

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


Objective : 

The password for the next level is stored in a file called - 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/bandit1 - Home directory for the user bandit1

(b) Now we will look out for a file called - 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.

(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 is a special character. We would require something different technique to read the contents of the file. Hence used './-'

The content displayed is the password for the next level.

Solution : CV1DtqXWVFXTvM2F0k09SHz0YwRINYA9

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

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

bandit2 - Is the username
CV1DtqXWVFXTvM2F0k09SHz0YwRINYA9 - Is the password.



Thursday, July 27, 2017

OverTheWire-Bandit (Level 0 -> Level 1) - Walkthrough


Objective : 

The password for the next level is stored in a file called readme located in the home directory. Use this password to log into bandit1 using SSH. Whenever you find a password for a level, use SSH (on port 2220) to log into that level and continue the game.

Procedure : 

(a) After completing level 0 we will first check which directory we are in ? The reason behind checking is to know whether we are in home directory or not.

Checking For Home Directory
 pwd - Is used to know the current directory where we are in
/home/bandit0 - Home directory for the user bandit0

(b) Now we will look out for a file readme 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.

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

Reading Of File Contents
cat - Is used to read the contents of the file.

Solution : boJ9jbbUNNfktd78OOpsqOltutMc3MY1

(d) Now we will use this password to login to next level.

Login To Next Level With Help Of Solution As Password
ssh bandit1@bandit.labs.overthewire.org -p 2220

bandit1 - Is the username
boJ9jbbUNNfktd78OOpsqOltutMc3MY1 - Is the password

Now we are logged in to the next level with user bandit1.

Wednesday, July 26, 2017

OverTheWire-Bandit (Level 0) - Walkthrough




Now onward I will be posting solutions for the war game called 'OverTheWire-Bandit' consisting of multiple levels with the explanation for the beginners in order to grasp knowledge.So no more talking !!! Happy Hacking 😈😈!!!!

Objective: 
The goal of this level is for you to log into the game using SSH. The host to which you need to connect is  bandit.labs.overthewire.org, on port 2220. The username is bandit0 and the password is bandit0. Once logged in, go to the Level 1 page to find out how to beat Level 1.

Procedure: 

(a)Login into the wargame with the given credentials using ssh.


Level 0 Walkthrough
Walkthrough - Level 0


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

ssh - Protocol using which we will login.
where username is bandit0 and the password is bandit0
bandit.labs.overthewire.org is the server where we are going to login. It can also be an ip address. Port 22 is the default port for ssh
2220 - Is the customized port for ssh which is open on the server.