Foundations ยท Chapter 2

Working through OverTheWire Bandit

A companion for OverTheWire Bandit: what the wargame teaches, how to work through it without burning out, and how to take notes that last.

About 4 min read

Bandit is a free wargame: you connect to a shared Linux server over SSH, and each level hides the password for the next one. The official site gives the goal of every level plus the commands worth reading about. This chapter adds what the site doesn't: how to approach it, what each group of levels is really training, and how to keep notes you'll use for years.

Why Bandit first

Every later skill sits on the shell. Web testing needs it for tooling, CTFs need it for files and scripts, and defense needs it for logs. Bandit teaches the shell by making you need it, and that sticks better than reading a manual.

How to work a level

  1. Read the level goal twice. Most stuck moments come from missing one word ("human-readable", "only once", "somewhere on the server").
  2. Read the man pages it suggests. The site lists them on purpose. man find for five minutes beats twenty minutes of guessing.
  3. Try, read the error, adjust. Errors are information. Write them down.
  4. Timebox. Stuck for 30 minutes? Take a hint: re-read the goal, check the suggested commands, or ask Claude for a nudge (not the answer).
  5. Write the lesson in one sentence before moving on.

What the levels train, in groups

You don't need a spoiler to know what's coming. Bandit roughly builds these skills in order:

Stage Skill being trained Why it matters later
Early levels Reading files, awkward file names, hidden files Every foothold starts with "what's in this directory?"
Search levels find by size, owner, type; silencing errors Locating configs, keys and backups on a large system
Text levels grep, sort, uniq, strings Log analysis, the core of defense work
Encoding levels Base64, ROT13, hexdumps, compression Forensics and decoding tokens in web work
Network levels SSH keys, nc, TLS clients, local port scanning Talking to services directly, without a browser
Permission levels SUID programs, cron jobs Understanding how Linux privileges work, and how they're misconfigured
Later levels Restricted shells, git history How secrets leak and how configuration constrains users

The last row is a lesson every developer should learn: git never forgets. A secret removed in a later commit is still in the history. If one ever reaches a repository, rotate it; deleting the line isn't enough.

House rules

  • Bandit is shared by thousands of people. No heavy scanning, no filling disks, no bothering other players.
  • Don't publish passwords or full solutions. It spoils the game for others, and OverTheWire asks you not to.
  • Your home directory is read-only. Make a scratch space with mktemp -d.

The notes template

Copy this for every level. It feels slow on level 3, and it's priceless on level 25.

## Bandit N โ†’ N+1
Goal (in my words):
Commands I read about:
What I tried (and why it failed):
What worked:
One-sentence lesson:
Password: (store in a password manager, not in a public note)

Keep the lessons in one list. By the end you'll have a personal Linux cheat sheet built from experience.

Signs you're ready to move on

  • You can find a file anywhere on a system by owner, size or permission without looking up the syntax.
  • You can explain what a SUID bit does and why an administrator should audit them.
  • You recognise Base64 and hex on sight.
  • You've used nc and openssl s_client to talk to a service by hand.

When those feel natural, start TryHackMe (chapter 4). Read chapter 3 first, because networking is the other half of the foundation.

Defender's corner

Each thing Bandit makes you find is something a sysadmin should audit:

find / -perm -4000 -type f 2>/dev/null   # review SUID programs: is each one needed?
ls -la /etc/cron.d /etc/cron.daily        # who runs what, and can others edit it?
git log -p | grep -i -E "password|secret|api[_-]?key"   # secrets in history?

Run the last one on your own repositories this week. Tools like gitleaks and trufflehog do it more thoroughly.

Practise only on systems you own or are explicitly allowed to test: your home lab, CTF platforms and authorized engagements. Testing anyone else's system without permission is a crime in most countries, including under the US Computer Fraud and Abuse Act. Your reading progress stays in this browser.