OverTheWire: Bandit Level 4 → Level 5


Level Goal

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.

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


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

bandit4@bandit:~$ ls

Move into the inhere/ directory. This can be done using the cd command

bandit4@bandit:~$ cd inhere/

View files that are in the directory using the ls command

bandit4@bandit:~/inhere$ ls
-file00 -file01 -file02 -file03 -file04 -file05 -file06 -file07 -file08 -file09

We know we have to find file who’s content is in Human Readable format. This check can be performed using the file command. File command returns the type of data that is found in the file

bandit4@bandit:~/inhere$ file ./*
./-file00: data
./-file01: data
./-file02: data
./-file03: data
./-file04: data
./-file05: data
./-file06: data
./-file07: ASCII text
./-file08: data
./-file09: data

Note : The * here means search all files in the directory. For more information on file globbing refer the attached reference resources

View the content of -file07 file using the cat command

bandit4@bandit:~/inhere$ cat ./-file07

We have found the password for the next level !!

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

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




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

Recommended from Medium

Customer Spotlight: ClearView Social

Week 8 — Sound for Immersion

The implications of M1 Apple Silicon for Web Developers

Why I chose Amazon Web Services (AWS) over the other Cloud Providers

CSS — background-clip VS background-origin properties

Best Practice for Using System.Timers.Timer in .NET C#

Best Practice for Using Timers in DotNet (.NET) CSharp (C#). Applying Dependency Injection (DI), Inversion of Control (IoC), Test Driven Development (TDD), Unit Testing, Coverage 100% Software Development Engineering Architecture Code Coding Programming


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

How to restrict user commands for specific user on linux

A beginner’s guide to containers - part 2

Learn the basics of Operating systems for Devops

Routers — Just The Basics