OverTheWire Bandit Level 0 -> Level 1 - Walkthrough

 Introduction

In this article, I will give you a walkthrough of the Bandit wargame Level 0 -> Level 1. In this level, the player is required to use few basic Linux commands like pwd, cat, ls, etc. and interact with the filesystem. I have given a brief info about the used commands in the further sub section of this article which is enough to understand their use and clear the level. However, I suggest you to go through the man pages of these commands and search on the internet to know in depth.


Goal

Get the password for Level 1 from readme file after logging into bandit0 and login to bandit1 using SSH.


Details Provided

Server - bandit.labs.overthewire.org

Port - 2220

Username - bandit1


Theory

When you login to bandit0 in Level 0, you land up in the home directory of the logged in user. The home directory is denoted by ~ in Linux and you can use this to navigate to the home directory from any other directory.

Login to bandit0 using the command "ssh bandit0@bandit.labs.overthewire.org -p 2220" and password "bandit0". For a detailed explanation, please check the Level 0 walkthrough.

Below is brief information about the commands used-:

pwd - Using this command, you can find the directory in which you are. It will print the full pathname of the current directory.

ls - This command lists the files present in the current directory(if the directory is not specified) or the specified directory. Couple of optional flags that are useful with this command are -l, which prints the files/directories in a long format displaying detailed information about them and -a, which also displays the hidden files/directories.

cat - This command helps you to read the file and output the contents to the console


Solution

We login to the home directory of the user bandit0 on completing the Level 0. We can check the home directory by the command pwd.

Next step is to check the contents of the home directory in order to find the readme file using the command ls. This will output the files present in the home directory. In our case, only readme file is present.

Now you can open the readme file using the cat command to get the password-:

The output string is the password for user bandit1


Now login to bandit1 using the below details -:

SSH - ssh bandit1@bandit.labs.overthewire.org -p 2220

Password - output from readme file


This completes the Level 1 walkthrough.

Comments

Popular Posts