OverTheWire: Bandit Level 2 → Level 3

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

Level Goal

The password for the next level is stored in a file called spaces in this filename 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

bandit2@bandit:~$ ls
spaces in this filename

View the content of the file named spaces in this filename using the cat command

Note : We command directly open this file as there are spaces in the filename. The spaces in the name can be escaped using \ , another approach is to enclosing the filename in ".." (quotes)

Note : The name of any file on the system can be auto completed using the Tab key.

bandit2@bandit:~$ cat spaces\ in\ this\ filename
UmHadQclWmgdLOKQ3YNgjWxGoRMb5luK
bandit2@bandit:~$ cat "spaces in this filename"
UmHadQclWmgdLOKQ3YNgjWxGoRMb5luK

We have found the password for the next level !!

Logout of current session and use password of user bandit3 to access next level

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

--

--

--

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

Recommended from Medium

Ruby vs Go | How to achieve Oops feature in Go.

GUI Barcode Reader: Porting .NET Framework to .NET Core

How to Print Alphabet P in Python?

Your Guide to Azure SQL Pricing

How to create repository using git and GitHub for beginners.

Key Value Coding and Key Value Observing

Geo Folder — a distributed data storage

How will users utilize MKY Token and reward?

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

Why Linux is better for Programming?

Physical location of files persisted in docker volumes on windows docker-desktop running on…

Cryptography and how it is used to secure today’s WIFI networks — part 01

How Origin code behaves in BGP