OverTheWire: Bandit Level 1 → Level 2

https://overthewire.org/wargames/bandit/bandit2.html

Level Goal

The password for the next level is stored in a file called — located in the home directory

Commands you may need to solve this level

ls, cd, cat, file, du, find

> whatis ls                                                                         
ls (1) - list directory contents

> whatis cd
cd (1) - change working directory

> whatis cat
cat (1) - concatenate files and print on the standard output

> whatis file
file (1) - determine file type

> whatis du
du (1) - estimate file space usage

> whatis find
find (1) - search for files in a directory hierarchy

Note : All commands don’t have to be used to complete level

Helpful Reading Material

Solution

View the files that are present in the current working directory using the ls command

bandit1@bandit:~$ ls
-

We can view the content of file named -using the cat command

Note : Directly specifying the filename as shown in the previous level is not going to work as - in Linux refers to Standard Input/ Standard Output (STDIN/ STDOUT). We have to use the concept of redirection or specify the absolute path to the file to access it.

bandit1@bandit:~$ cat < -
CV1DtqXWVFXTvM2F0k09SHz0YwRINYA9
bandit1@bandit:~$ cat ./-
CV1DtqXWVFXTvM2F0k09SHz0YwRINYA9

We have found the password for the next level !!

To access next level logout of the current session. This can be done by typing exit or use Ctrl + D

Use password found above of user bandit2 to access next level

> ssh bandit2@bandit.labs.overthewire.org -p 2220
This is a OverTheWire game server. More information on http://www.overthewire.org/wargames
bandit2@bandit.labs.overthewire.org's password: CV1DtqXWVFXTvM2F0k09SHz0YwRINYA9

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Unraveling Spline Regression in R

Software Cancer “Overengineering”

How Much Does It Cost To Develop An Uber Like App?

● Features of Java :-

LEARN HTML TAGS  — WITH EXPLANATION — AND OUTPUT

The magic of data classes in Kotlin

Design beautiful UI for mobile app with Flutter : Calorie Plan

8 Ways in which Robotic Process Automation (RPA) Will Change IT Operations

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
David Varghese

David Varghese

More from Medium

CIS controls — where to start in securing a medium/big enterprise

VHDL sine wave oscillator

Zerotier

How to use Text-to-Speech in WSL to inform you when a job has finished

A Bash terminal with a welcome message.