Post

OverTheWire Bandit — Level 0 to Level 10 Writeup

Writeup for OverTheWire Bandit levels 0 through 10. Covers basic Linux file reading, hidden files, find command, strings, sort/uniq, and base64 decoding.

OverTheWire Bandit — Level 0 to Level 10 Writeup

Bandit is a wargame by OverTheWire designed for absolute beginners to learn Linux basics through practical challenges. Each level gives you a clue — you have to find the password for the next level.

Connection: ssh bandit0@bandit.labs.overthewire.org -p 2220


Level 0 → Level 1

Goal: The password is stored in a file called readme in the home directory.

1
cat readme

Explanation: cat reads and prints the contents of a file to the terminal.

Bandit 00 Bandit 00


Level 1 → Level 2

Goal: The password is stored in a file called -.

1
cat ./-

Explanation: The dash (-) is interpreted by the shell as “read from stdin” instead of a file. Prefixing with ./ tells the shell it’s a file path, not a flag.

Bandit 01 Bandit 01


Level 2 → Level 3

Goal: The password is in a file called spaces in this filename.

1
cat "spaces in this filename"

Or using tab completion — type the first letter and press Tab.

Bandit 02 Bandit 02


Level 3 → Level 4

Goal: The password is in a hidden file in the inhere directory.

1
2
3
cd inhere
ls -a
cat .hidden

Explanation: In Linux, files starting with . are hidden and won’t show with a plain ls. The -a flag reveals them.

Bandit 03 Bandit 03


Level 4 → Level 5

Goal: The password is in the only human-readable file in the inhere directory.

1
2
3
cd inhere
file ./-file*
cat ./-file07

Explanation: The file command identifies the type of each file. Use it with a wildcard to check all at once — the one labeled “ASCII text” is the human-readable one.

Bandit 04 Bandit 04


Level 5 → Level 6

Goal: File is human-readable, 1033 bytes, and not executable.

1
find . -type f -readable ! -executable -size 1033c

Explanation: The find command with -readable, ! -executable, and -size 1033c (c = bytes) narrows it down precisely.

Bandit 05 Bandit 05


Level 6 → Level 7

Goal: File is owned by user bandit7, group bandit6, and is 33 bytes.

1
find / -type f -user bandit7 -group bandit6 -size 33c 2>/dev/null

Explanation: Searching from / (root) covers the whole server. 2>/dev/null redirects permission-denied errors to null so they don’t clutter the output.

Bandit 06 Bandit 06


Level 7 → Level 8

Goal: Password is in data.txt next to the word millionth.

1
grep "millionth" data.txt

Explanation: grep searches inside the file and returns only the matching line. Fast and simple.

Bandit 07 Bandit 07


Level 8 → Level 9

Goal: Password is the only line that occurs exactly once in data.txt.

1
sort data.txt | uniq -u

Explanation: sort arranges lines alphabetically so duplicates are adjacent. uniq -u then prints only lines that appear exactly once.

Bandit 08 Bandit 08


Level 9 → Level 10

Goal: Password is in data.txt among the human-readable strings, preceded by several = characters.

1
strings data.txt | grep "==="

Explanation: strings extracts all human-readable text from a binary file. Piping to grep "===" filters for lines starting with multiple = signs as described.

Bandit 09 Bandit 09


Level 10 → Level 11

Goal: Password is in data.txt which contains base64-encoded data.

1
cat data.txt | base64 -d

Explanation: base64 -d decodes base64-encoded text back to its original form.

Bandit 10 Bandit 10


If you have any questions, feel free to reach out on LinkedIn or Discord

This post is licensed under CC BY 4.0 by the author.