Linux basics with Bandit 0 → 20

Beginner · 21 levels

OverTheWire's Bandit is the classic first wargame: each level is a small Linux puzzle whose answer is the password for the next one. Work through it in order — every level builds on a command from the previous ones.

12 of 21 writeups published — more steps coming soon.

Start with Level 0 →

  1. Level 0Find Your First PasswordConnect to OverTheWire's Bandit wargame over SSH and read a plaintext readme file to get your first password. The very first step into the game.
  2. Level 1Read a File Named -A file literally named - breaks a naive cat command. How to reference it directly and read the password inside.
  3. Level 2Read a Filename With SpacesThe password file is called --spaces in this filename--: quote it for the spaces, then add ./ so cat stops reading the leading -- as an option.
  4. Level 3Find a Hidden Dotfilels shows an empty folder — until you remember dotfiles don't show by default. Uncovering a hidden password file.
  5. Level 4Spot the Real Text File Among JunkTen near-identical files, only one holds the password. Using file to spot the real text file among decoys.
  6. Level 5find -size 1033c SolutionBandit 5→6 hides the password among dozens of decoy files in inhere/. One find command with -size 1033c, -type f and ! -executable leaves only the right one.
  7. Level 6Search the Whole Filesystem by Owner and SizeThe password file this time isn't in the home directory at all — find has to search the entire filesystem, filtered by exact owner, group, and size.
  8. Level 7Find a Word Next to Another Word with grepA multi-thousand-line file holds the password on a single line, right next to a specific marker word. grep finds that one line instantly.
  9. Level 8Find the One Unique Line Among DuplicatesAlmost every line in this file repeats at least once. The password is the single line that appears exactly once — sort and uniq find it in one pipeline.
  10. Level 9Extract Readable Text from a Mostly-Binary Filedata.txt is mostly unreadable binary noise, but the password is plain text buried inside it, marked by a run of leading = characters.
  11. Level 10Decode a Base64-Encoded PasswordThe password file isn't hidden this time — it's just base64 encoded. One command decodes it straight back to plain text.
  12. Level 11Decode a ROT13-Rotated PasswordEvery letter in data.txt has been shifted 13 places through the alphabet. A single tr command rotates them back and reveals the password.
  13. Level 12Reverse a Hexdump and Unpack Nested CompressionComing soon
  14. Level 13Log In with a Private SSH Key Instead of a PasswordComing soon
  15. Level 14Send a Password to a Local Port with netcatComing soon
  16. Level 15Talk to an SSL/TLS Service with openssl s_clientComing soon
  17. Level 16Scan a Port Range and Find the Right TLS ServiceComing soon
  18. Level 17Find the One Changed Line with diffComing soon
  19. Level 18Read a File When .bashrc Logs You OutComing soon
  20. Level 19Use a setuid Binary to Read Another User's PasswordComing soon
  21. Level 20Feed a Password to a setuid Client with a netcat ListenerComing soon