logo

Practical Computing Advice and Tutorials

Tue: 23 Jul 2019


Site Content

Programming
&
Development


Technical Knowhow


Command Line Interface


Security

OverTheWire | Bandit

While you can try and learn to use any CLI command, using the systems that you have to hand, motivation can be an issue and reading about something is way less stimulating than doing it.

There are a few of pages, here on my site, that cover some of the more common commands, but I've found a rather interesting on-line challenge game site called OverTheWire, the introductory challenge is called Bandit.

It's not new (established in 2014, I think), but it is very useful if you want to learn about some CLI stuff. The format is that you're given the address of a server and you'll need to connect to it using an SSH client. I've covered the basics in my CLI Introduction page, but if you'd like some comprehensive reading, I'd recommend this site.


Bandit – Levels 0 to 9

This game consists of 34 Levels. To get from one level to the next, you'll need to find the password needed for the next. Start here.

On each page, you'll be given some clues, including some reference reading, about how to retrieve the password (or key) for the next level and each level will be a little more of a challenge. While it's very tempting to charge through them as fast as you can, I encourage you to make notes as you go. Remember, this is a learning opportunity. By making notes as you go, you'll be able to refer back to them as and when. Also, as you progress from level to level, you'll find the need to combine some of the things that have gone before.

I'm not going to publish any of the keys for any of the levels, but I will offer up some tips and links to extra reading as I progress through this.

Although there is plenty of help out there, I'm also offering any help that I can, to any of my visitors.
Please use my Forum to ask me any questions. You can either create an account or use the guest account. Also, don't forget about the man pages that come with a Linux OS. If you're using a MS Windows OS to do this, don't forget that you'll be logging into a Linux OS, so once you're logged into any of the bandit accounts, you could use the man command, while you're logged in.

Level 0 → Level 1

This is really not too difficult and is an introduction to the basic tool that you'll need to use (ssh) as well as some tools that you can use to display a text file. The OTW website does not mention that one can also use the more command to display a text file, as well as the commands that are listed on that page.

Level 1 → Level 2

This is a small test, as you'll need to know how to display a so-called dash file; it's not hard, once you know how. Follow the directions on the OTW website.

Level 2 → Level 3

In this exercise you'll learn how to use the CLI to view the contents a file that has been named with spaces.
As a b.t.w; it's bad practise to use spaces in file names and/or directory names, but with the advent of GUIs, it's a hard habit to get out of.

Level 3 → Level 4

To get the key for Level 4, you'll not only have to know how to change to another directory, but also what options (or switches) one can use with the ls command to reveal hidden files. The man ls pages are well worth reading.

Level 4 → Level 5

The thing to remember with this level, is that we need to find a file that is human-readable or ASCII formatted. While you could simply display each of the ten dash files, there is a better way to discover which one is ASCII. The command for this is on the OTW web page.

Level 5 → Level 6

Here you'll see that there are 18 possible directories in which the key file could be, each one containing a number of files; some are dash files, some are named with spaces and some are hidden. Doing a manual search would take hours. The commands you need to quickly locate the key file, along with three clues to what you are looking for, are on the OTW web page. In fact the key file can be found using any one of three ways, given in the clues. If you really want to learn, then discover the three ways with which the key file can be located.

Level 6 → Level 7

If you're learning as you go, then finding the key for Level 7 should not take long. As with Level 6, there's more than one way, so suss them out and you'll enhance your skills.

Level 7 → Level 8

To get to Level 8, you'll need to find the key from within a 4Mb file; all but impossible by hand. You'll need to learn a new tool for this one, unless you're already familiar with it. If not, the man page is the way to go.

Level 8 → Level 9

For the final Level (for now), again we have a data.txt file, but it's somewhat smaller at just 33Kb. As the OTW web page says, we're looking for the only key that occurs just once, so we'll need to sort this out before we can move on.

Levels 10 → 19