Author: Muhammad Sadiq
Date: 2026
Platform: OverTheWire Bandit
Levels Completed: 0 — 6
Focus: Linux CLI, SSH, Permissions, File Management
These skills are directly applicable to# OverTheWire Bandit Walkthrough: Levels 0-13
A comprehensive guide to solving the first 14 levels of the Bandit wargame.
Bandit is a wargame from OverTheWire designed to teach Linux command-line skills and security concepts. This walkthrough covers levels 0 through 13, providing step-by-step solutions and explanations for each challenge.
Prerequisites:
- SSH client installed on your local machine
- Basic understanding of Linux command line
- Terminal access
Connection Information:
- Host:
bandit.labs.overthewire.org - Port:
2220 - Protocol: SSH
**
The password for the next level is stored in a file called readme located in the home directory.
Establish an SSH connection to the Bandit server and read the file.
ssh bandit0@bandit.labs.overthewire.org -p 2220Password: bandit0
Once connected, list the files and read the readme file:
bandit0@bandit:~$ ls
readme
bandit0@bandit:~$ cat readme6y2kwnwK6grgvwvpvLaa2T1cpFEKOhNR
This level introduces basic SSH connectivity and the cat command for reading files.
The password is stored in a file called - located in the home directory.
Connect using the password from the previous level:
ssh bandit1@bandit.labs.overthewire.org -p 2220Password: 6y2kwnwK6grgvwvpvLaa2T1cpFEKOhNR
The challenge involves reading a file with a hyphen in its name. In Linux, a hyphen alone is interpreted as a command option, so it cannot be referenced directly. Use the ./ prefix to specify the file explicitly.
bandit1@bandit:~$ cat ./-PK8fYLZg2hnHSz83plBL1iEPKdD3QToB
This level demonstrates how to handle filenames that begin with special characters, particularly the hyphen which is typically used for command options.
The password is stored in a file called spaces in this filename located in the home directory.
Connect as bandit2:
ssh bandit2@bandit.labs.overthewire.org -p 2220Password: PK8fYLZg2hnHSz83plBL1iEPKdD3QToB
The filename contains spaces, which need to be escaped or quoted. You can either:
- Use quotes around the filename
- Escape each space with a backslash
bandit2@bandit:~$ ls
spaces in this filename
bandit2@bandit:~$ cat ./"spaces in this filename"Alternatively, using escape characters:
bandit2@bandit:~$ cat spaces\ in\ this\ filename7ZZ2LFrykP2zEyvBl4m3clcL7tGYJPME
This level teaches how to handle filenames with spaces, a common issue in Linux systems.
The password is stored in a hidden file inside the inhere directory.
Connect as bandit3:
ssh bandit3@bandit.labs.overthewire.org -p 2220Password: 7ZZ2LFrykP2zEyvBl4m3clcL7tGYJPME
Navigate to the inhere directory and list all files including hidden ones:
bandit3@bandit:~$ ls
inhere
bandit3@bandit:~$ cd inhere
bandit3@bandit:~/inhere$ ls -laThe hidden file begins with a dot (.). Read it:
bandit3@bandit:~/inhere$ cat .hiddenxzTXq1rDJQVVAzdv5cHq1TQytTWufAMq
This level introduces hidden files in Linux, which start with a dot and can be viewed using the -a flag with ls.
The password is stored in a file in the inhere directory. The file is not human-readable, but among several files, one contains the password in ASCII.
Connect as bandit4:
ssh bandit4@bandit.labs.overthewire.org -p 2220Password: xzTXq1rDJQVVAzdv5cHq1TQytTWufAMq
Navigate to inhere and examine the files:
bandit4@bandit:~$ ls
inhere
bandit4@bandit:~$ cd inhere
bandit4@bandit:~/inhere$ ls
-file00 -file01 -file02 -file03 -file04 -file05 -file06 -file07 -file08 -file09Use the file command to identify file types and find the one containing text:
bandit4@bandit:~/inhere$ file ./-file*
./-file00: data
./-file01: data
./-file02: data
./-file03: data
./-file04: data
./-file05: data
./-file06: data
./-file07: ASCII text
./-file08: data
./-file09: dataThe ASCII text file contains the password:
bandit4@bandit:~/inhere$ cat ./-file076C7h9GD8M6ai5nr7wo1RonrzFjj9yIrG
This level teaches how to identify file types using the file command, useful when dealing with binary or data files.
The password is stored in a file with specific properties: human-readable, 1033 bytes in size, and not executable.
Connect as bandit5:
ssh bandit5@bandit.labs.overthewire.org -p 2220Password: 6C7h9GD8M6ai5nr7wo1RonrzFjj9yIrG
Navigate to the inhere directory which contains many folders and files:
bandit5@bandit:~$ cd inhere
bandit5@bandit:~/inhere$ ls
maybehere00 maybehere01 maybehere02 maybehere03 maybehere04 maybehere05 maybehere06 maybehere07 maybehere08 maybehere09 maybehere10 maybehere11 maybehere12 maybehere13 maybehere14 maybehere15 maybehere16 maybehere17 maybehere18 maybehere19Use the find command to locate files with the specified properties:
bandit5@bandit:~/inhere$ find . -type f -size 1033c -exec file {} \;Or use xargs to process the output:
bandit5@bandit:~/inhere$ find . -type f -size 1033c | xargs stringspXa26xhMWaC2SvDotA4r9EgZkulOeSBW
This level introduces the powerful find command with filters for file type (-type), size (-size), and combining it with xargs for processing results.
The password is stored somewhere on the server with specific properties:
- Owned by user
bandit7 - Owned by group
bandit6 - Size of 33 bytes
Connect as bandit6:
ssh bandit6@bandit.labs.overthewire.org -p 2220Password: pXa26xhMWaC2SvDotA4r9EgZkulOeSBW
Search from the root directory (/) with the specified conditions:
bandit6@bandit:~$ find / -type f -user bandit7 -group bandit6 -size 33c 2>/dev/null -exec cat {} \;The 2>/dev/null redirects error messages (permission denied) to null, making the output cleaner.
Bmnnvf82KzQlfxgAI2d1zYbr1u9pr3E3
This level demonstrates more advanced find usage with user, group, and size filters, and introduces error redirection.
The password is stored in the file data.txt next to the word millionth.
Connect as bandit7:
ssh bandit7@bandit.labs.overthewire.org -p 2220Password: Bmnnvf82KzQlfxgAI2d1zYbr1u9pr3E3
Search for the word millionth in the file:
bandit7@bandit:~$ ls
data.txt
bandit7@bandit:~$ cat data.txt | grep millionthVR1ljMayciFxbnUokuQmJFw6QC9VKtub
This level introduces the grep command for searching text patterns within files.
The password is stored in data.txt and appears only once. The file contains many lines of text and passwords.
Connect as bandit8:
ssh bandit8@bandit.labs.overthewire.org -p 2220Password: VR1ljMayciFxbnUokuQmJFw6QC9VKtub
Sort the file and find the unique line that appears only once:
bandit8@bandit:~$ sort data.txt | uniq -uEjmOSvuAu7sGAHqHVcBDPirRe9T03kxl
This level teaches how to use sort and uniq together to find unique lines in a file.
The password is stored in data.txt among several human-readable strings preceded by one or more = characters.
Connect as bandit9:
ssh bandit9@bandit.labs.overthewire.org -p 2220Password: EjmOSvuAu7sGAHqHVcBDPirRe9T03kxl
Use strings to extract human-readable text and grep to find lines with =:
bandit9@bandit:~$ strings data.txt | grep '='B0s2khmbT9u0geKuOoVGW3JZKhndE3BG
This level introduces the strings command to extract readable text from binary files.
The password is stored in data.txt in Base64 format.
Connect as bandit10:
ssh bandit10@bandit.labs.overthewire.org -p 2220Password: B0s2khmbT9u0geKuOoVGW3JZKhndE3BG
Decode the Base64 encoded data:
bandit10@bandit:~$ strings data.txt | base64 -dpYfOY6HwUsDj5rL9UvyhU7MCmv8vN5Ro
This level demonstrates Base64 encoding and decoding, a common data encoding method.
The password is stored in data.txt where all lowercase and uppercase letters are rotated 13 positions (ROT13).
Connect as bandit11:
ssh bandit11@bandit.labs.overthewire.org -p 2220Password: pYfOY6HwUsDj5rL9UvyhU7MCmv8vN5Ro
Apply the ROT13 transformation using tr:
bandit11@bandit:~$ cat data.txt | tr 'A-Za-z' 'N-ZA-Mn-za-m'GROozWPO8QyN0mGrjUkID0WCYkZiQxrN
This level introduces ROT13 cipher and the tr command for character translation.
The password is stored in data.txt, which is a hexdump of a file that has been compressed multiple times.
Connect as bandit12:
ssh bandit12@bandit.labs.overthewire.org -p 2220Password: GROozWPO8QyN0mGrjUkID0WCYkZiQxrN
Create a working directory and process the hexdump:
bandit12@bandit:~$ cd /tmp
bandit12@bandit:/tmp$ mkdir bandit12_solution
bandit12@bandit:/tmp$ cd bandit12_solution
bandit12@bandit:/tmp/bandit12_solution$ cp ~/data.txt .Reverse the hexdump to binary:
bandit12@bandit:/tmp/bandit12_solution$ xxd -r data.txt > data.binIdentify file type and decompress repeatedly:
bandit12@bandit:/tmp/bandit12_solution$ file data.bin
data.bin: gzip compressed data, was "data2.bin", ...
bandit12@bandit:/tmp/bandit12_solution$ mv data.bin data.gz
bandit12@bandit:/tmp/bandit12_solution$ gzip -d data.gz
bandit12@bandit:/tmp/bandit12_solution$ file data
data: bzip2 compressed data, block size = 900k
bandit12@bandit:/tmp/bandit12_solution$ mv data data.bz2
bandit12@bandit:/tmp/bandit12_solution$ bzip2 -d data.bz2
bandit12@bandit:/tmp/bandit12_solution$ file data
data: gzip compressed data, was "data4.bin", ...
bandit12@bandit:/tmp/bandit12_solution$ mv data data.gz
bandit12@bandit:/tmp/bandit12_solution$ gzip -d data.gz
bandit12@bandit:/tmp/bandit12_solution$ file data
data: POSIX tar archive (GNU)
bandit12@bandit:/tmp/bandit12_solution$ mv data data.tar
bandit12@bandit:/tmp/bandit12_solution$ tar -xf data.tar
bandit12@bandit:/tmp/bandit12_solution$ file data5.bin
data5.bin: POSIX tar archive (GNU)
bandit12@bandit:/tmp/bandit12_solution$ mv data5.bin data5.tar
bandit12@bandit:/tmp/bandit12_solution$ tar -xf data5.tar
bandit12@bandit:/tmp/bandit12_solution$ file data6.bin
data6.bin: bzip2 compressed data, block size = 900k
bandit12@bandit:/tmp/bandit12_solution$ mv data6.bin data6.bz2
bandit12@bandit:/tmp/bandit12_solution$ bzip2 -d data6.bz2
bandit12@bandit:/tmp/bandit12_solution$ file data6
data6: POSIX tar archive (GNU)
bandit12@bandit:/tmp/bandit12_solution$ mv data6 data6.tar
bandit12@bandit:/tmp/bandit12_solution$ tar -xf data6.tar
bandit12@bandit:/tmp/bandit12_solution$ file data8.bin
data8.bin: gzip compressed data, was "data9.bin", ...
bandit12@bandit:/tmp/bandit12_solution$ mv data8.bin data8.gz
bandit12@bandit:/tmp/bandit12_solution$ gzip -d data8.gz
bandit12@bandit:/tmp/bandit12_solution$ file data8
data8: ASCII text
bandit12@bandit:/tmp/bandit12_solution$ cat data8qQYQiHOBPR8zR61qxYqX45quvihF2uzk
This level teaches:
- Hexdump reversal using
xxd -r - File type identification with
file - Decompression of multiple formats:
gzip,bzip2, andtar - Recursive file processing
The password for level 14 is stored in /etc/bandit_pass/bandit14 and can only be read by user bandit14. A private SSH key is provided to connect as bandit14.
Connect as bandit13:
ssh bandit13@bandit.labs.overthewire.org -p 2220Password: qQYQiHOBPR8zR61qxYqX45quvihF2uzk
The SSH key is located in the home directory:
bandit13@bandit:~$ ls
sshkey.privateFrom your local machine (after exiting the SSH session), copy the key:
scp -P 2220 bandit13@bandit.labs.overthewire.org:sshkey.private ~/bandit14_keySet proper permissions and connect as bandit14:
chmod 600 ~/bandit14_key
ssh -i ~/bandit14_key bandit14@bandit.labs.overthewire.org -p 2220Read the password file:
bandit14@bandit:~$ cat /etc/bandit_pass/bandit14MU4VWeTyJk8ROof1qqmcBPaLh7lDCPvS
This level introduces:
- SSH key-based authentication
scpfor copying files- Permission management with
chmod - Direct password file access
| Level | Password |
|---|---|
| 0→1 | 6y2kwnwK6grgvwvpvLaa2T1cpFEKOhNR |
| 1→2 | PK8fYLZg2hnHSz83plBL1iEPKdD3QToB |
| 2→3 | 7ZZ2LFrykP2zEyvBl4m3clcL7tGYJPME |
| 3→4 | xzTXq1rDJQVVAzdv5cHq1TQytTWufAMq |
| 4→5 | 6C7h9GD8M6ai5nr7wo1RonrzFjj9yIrG |
| 5→6 | pXa26xhMWaC2SvDotA4r9EgZkulOeSBW |
| 6→7 | Bmnnvf82KzQlfxgAI2d1zYbr1u9pr3E3 |
| 7→8 | VR1ljMayciFxbnUokuQmJFw6QC9VKtub |
| 8→9 | EjmOSvuAu7sGAHqHVcBDPirRe9T03kxl |
| 9→10 | B0s2khmbT9u0geKuOoVGW3JZKhndE3BG |
| 10→11 | pYfOY6HwUsDj5rL9UvyhU7MCmv8vN5Ro |
| 11→12 | GROozWPO8QyN0mGrjUkID0WCYkZiQxrN |
| 12→13 | qQYQiHOBPR8zR61qxYqX45quvihF2uzk |
| 13→14 | MU4VWeTyJk8ROof1qqmcBPaLh7lDCPvS |
| Command | Purpose |
|---|---|
ssh |
Connect to remote servers |
ls |
List directory contents |
cat |
Display file contents |
cd |
Change directory |
file |
Determine file type |
find |
Search for files |
grep |
Search text patterns |
sort |
Sort lines |
uniq |
Filter unique lines |
strings |
Extract text from binaries |
base64 |
Encode/decode Base64 |
tr |
Translate characters |
xxd |
Hexdump/undo hexdump |
gzip |
Compress/decompress |
bzip2 |
Compress/decompress |
tar |
Archive files |
scp |
Copy files over SSH |
chmod |
Change permissions |
The Bandit wargame provides an excellent foundation in Linux command-line skills and security concepts. By completing these levels, you've learned:
- Basic navigation and file operations (levels 0-3)
- Handling special characters and hidden files (levels 1-4)
- File identification and searching (levels 4-8)
- Text manipulation and encoding (levels 7-11)
- Compression and archive formats (level 12)
- SSH key authentication (level 13)
Continue with levels 14 and beyond to further develop your skills in networking, scripting, and system administration. penetration testing, SOC analysis, and system administration.
Next Steps:
- Continue to Bandit Levels 7-14
- Start TryHackMe rooms
- Build a home lab
- Practice CTFs regularly
The Bandit wargame is an excellent foundation for anyone starting in cybersecurity. These first 6 levels cover:
✅ Basic SSH connections
✅ File navigation
✅ Hidden files
✅ Special filenames
✅ File properties
✅ Data extraction
📧 Email: muhammadsadiq.cyber@gmail.com
🔗 LinkedIn: linkedin.com/in/muhammadsadiqcyber
🐙 GitHub: github.com/muhammadsadiqX1
🏴 TryHackMe: tryhackme.com/p/muhammadsadiqX1
"Break things, learn faster, secure better." 🔴
Made with ❤️ by Muhammad Sadiq | Red Team Operator in Training