projects/bandit-ctf
Eneuss / OverTheWire-CTF-Report

OverTheWire Bandit CTF

A documented walkthrough of every level of the OverTheWire Bandit wargame.

LinuxBashSSHNetworkingGitCTF
overview

Bandit is a beginner wargame from OverTheWire where each level hides the password for the next one on a Linux server you reach over SSH. I completed every level (0 → 33) and documented each one: the goal, the commands I used and why the approach works.

What I covered

  • Linux basics: SSH and key-based login, navigating the file system, awkward filenames and hidden files.
  • Finding and filtering data: find, grep, sort, uniq, strings and diff.
  • Encoding and archives: base64, ROT13, hexdumps and a file compressed many times over with gzip, bzip2 and tar.
  • Networking: talking to services with nc and ncat (including SSL/TLS) and scanning ports with nmap.
  • setuid and cron: binaries that run as another user, and scheduled jobs that run scripts.
  • Git: secrets hidden in history, branches and tags.
  • Restricted-shell escapes: getting a real shell when the login shell is designed to stop you.

Highlights

  • Level 24 → 25: brute-forced a 4-digit PIN with a Bash loop that sends all 10,000 attempts over a single nc connection instead of reconnecting each time.
  • Level 23 → 24: a cron job ran any script dropped into a folder as bandit24, so I wrote my own script that copied bandit24's password into a file I could read.
  • Level 25 → 26: the login shell showed a file with more and exited. Shrinking the terminal kept more paused, pressing v opened vim, and :set shell=/bin/bash then :shell gave me a real shell.

What I learned

Cron jobs and setuid binaries showed me how much permissions matter and how a misconfigured system can be abused. The git levels showed that a secret deleted in a new commit still lives on in the history, branches and tags. More than anything, it taught me to read carefully, test step by step and stay curious.

The full level-by-level walkthrough is in the report on GitHub.