Every level explained in extreme detail for absolute beginners
OverTheWire is a collection of "wargames" - security challenges that teach you hacking skills through practice. Think of it like a video game, but instead of fighting monsters, you're solving Linux puzzles and learning real hacking techniques.
Bandit is the first and most beginner-friendly wargame. It teaches you Linux command line basics, which is the foundation of ALL hacking.
SSH (Secure Shell) is a way to control a computer remotely through the command line. Think of it like remote desktop, but instead of a graphical interface, you get a terminal where you type commands.
When you "SSH into" a server, you're connecting to another computer over the internet and controlling it with text commands.
On Windows: Use PowerShell, Command Prompt, or install WSL (Windows Subsystem for Linux)
On Mac/Linux: Open the Terminal app (usually in Applications → Utilities)
ssh bandit0@bandit.labs.overthewire.org -p 2220
Let's break this down word by word:
ssh - The command to start an SSH connectionbandit0 - The username you're logging in as@ - Separator between username and server addressbandit.labs.overthewire.org - The server's address (like a website URL)-p 2220 - The port number (like an apartment number in a building)
Connect to the Bandit server using SSH. The password for this level is bandit0.
Step 1: Open your terminal
This is where you type commands. On Windows, press Win + R, type "cmd" and press Enter. On Mac, press Cmd + Space, type "terminal" and press Enter.
Step 2: Type the SSH command
ssh bandit0@bandit.labs.overthewire.org -p 2220
Press Enter. You might see a message asking "Are you sure you want to continue connecting?" - Type yes and press Enter.
Step 3: Enter the password
When prompted for a password, type: bandit0
⚠️ Important: When you type the password, you WON'T see any characters appear on screen. This is normal! It's a security feature. Just type the password and press Enter.
You'll see a welcome message and your prompt will change to something like:
bandit0@bandit:~$
Congratulations! You're now inside the Bandit server. You've completed Level 0! 🎉
The password for Level 1 is stored in a file called readme in your home directory. Find and read it.
What is a "home directory"?
When you log into a Linux system, you start in your "home directory" - think of it as your personal folder. It's like "My Documents" on Windows. When you first connect via SSH, you're automatically placed here.
What does "cat" do?
The cat command (short for "concatenate") reads files and displays their content in the terminal. Think of it as "open and show me what's inside this file."
What is "ls"?
The ls command (short for "list") shows you all files and folders in your current location. It's like opening File Explorer on Windows.
Step 1: See what files are here
# Type this command:
ls
# You'll see output like:
readme
Perfect! There's a file called "readme" here. This is what we're looking for.
Step 2: Read the file
# Type this command:
cat readme
# You'll see the password printed on screen:
NH2SXQwcBdpmTEzi3bvBHMM9H66vVXjL
This long string of random characters is the password for Level 1! Copy it - you'll need it to log into the next level.
Step 3: Disconnect and move to Level 1
# Type this to disconnect:
exit
Now connect to Level 1 using the password you just found:
ssh bandit1@bandit.labs.overthewire.org -p 2220
# When prompted, paste the password you copied
ls - Lists files in your current directorycat filename - Reads and displays file contentexit - Disconnects from SSH session
The password is stored in a file called - (just a dash/hyphen). Read it.
In Linux, the dash (-) is a special character. It's normally used to indicate options/flags for commands. For example, ls -la means "run ls with the options l and a".
If you try cat -, the system thinks you're trying to give cat an option, not read a file named "-". This is confusing!
Solution: We need to tell the system "I mean a FILE called dash, not an option." We do this by specifying the FULL PATH to the file.
What is a "path"?
A path is the address of a file. Like how "123 Main Street, Apartment 4B" is a full address, a file path tells the computer exactly where a file is.
Two types of paths:
1. Absolute path: The FULL address starting from root. Example: /home/bandit1/myfile.txt
2. Relative path: The address relative to where you are now. Example: ./myfile.txt
The ./ means "in the current directory". It's like saying "in this folder I'm in right now."
Step 1: Verify the file exists
ls
# Output:
-
Step 2: Read the file using its relative path
# This WON'T work:
cat -
# This WILL work:
cat ./-
# Output (the password):
rRGizSaX8Mk1RTb1CNQoXTcYZWU6lgzi
By adding ./ before the dash, we're saying "cat, please read the file named dash in my current directory" instead of "cat, I'm giving you an option."
-)./ means "current directory"./filename tells Linux you mean a file, not a command optioncat < - (input redirection)You now understand the fundamental pattern of Bandit:
ls to see what files existcat or other commands to read filesEach level teaches you a NEW Linux concept or command. The levels get progressively harder, building on what you've learned. Keep going - you're doing great! 🎉
ls - List files
ls -la - List all files (including hidden)
cat file - Read file
cat ./- - Read file with special name
file * - Check file types
cd dirname - Change directory
cd .. - Go up one directory
pwd - Print working directory
./ - Current directory
~/ - Home directory
find / -name file - Find by name
find / -size 1033c - Find by size
grep text file - Search in file
strings file - Extract text
base64 -d file - Decode base64
xxd file - View hex dump
tr 'A-Za-z' 'N-ZA-Mn-za-m' - ROT13
tar -xf file.tar - Extract tar
1. Use the man pages: If you don't know what a command does, type man command. For example, man ls shows you everything about the ls command.
2. Tab completion is your friend: Start typing a filename and press Tab. It will auto-complete! Saves so much time.
3. Keep a notes file: Write down passwords and commands you learn. You'll forget them otherwise!
4. Read the level descriptions: Each Bandit level page has hints. Don't skip them!
5. Google is allowed: If you're stuck, searching "bandit level X walkthrough" is totally fine. Learning HOW to search for solutions is a valuable skill.
ssh bandit3@bandit.labs.overthewire.org -p 2220
In Linux, files starting with a dot (.) are hidden. When you run ls, you WON'T see them!
Think of it like invisible ink - the files exist, but you need special glasses to see them.
Why hide files? Configuration files (like .bashrc, .ssh) are hidden so they don't clutter your view.
ls -la-a flag means "show ALL files, even hidden ones"cd inherels -la.hiddencat .hiddenls -a shows hidden filesls -la = long format + hidden files
Computers store TWO types of files:
1. Text files - You can read them (like .txt, .html, .py)
2. Binary files - Computer code, images, videos (looks like gibberish if you open it)
The file command tells you what type a file is!
cd inherelsfile ./*cat ./-file07 (or whichever says ASCII text)./ is needed because of the dash!file command identifies file types./* = all files in current directory
find is like a super-powered search. Instead of just searching by name, you can search by:
size, type, permissions, date modified, and more!
cd inherefind . -type f -size 1033c ! -executable. = search in current directory-type f = only files (not directories)-size 1033c = exactly 1033 bytes (c=characters/bytes)! -executable = NOT executable (the ! means NOT)cat ./maybehere07/.file2 (or whatever path it found)find command with multiple filters-size flag (c=bytes, k=kilobytes, M=megabytes)-type f for files only! operator for negation (NOT)
Every file in Linux has TWO owners:
1. User owner - The person who created it
2. Group owner - A group of users who can access it
This is like a document being owned by "John" but shared with the "Engineering Team".
find / -user bandit7 -group bandit6 -size 33c 2>/dev/null/ = start from root (search EVERYWHERE)-user bandit7 = owned by bandit7-group bandit6 = group is bandit6-size 33c = 33 bytes2>/dev/null = hide "Permission denied" errors/var/lib/dpkg/info/bandit7.passwordcat /var/lib/dpkg/info/bandit7.password2>/dev/null is your best friend!-user and -group flags/2>/dev/null to suppress errors
Password is stored in data.txt next to word "millionth"
ssh bandit7@bandit.labs.overthewire.org -p 2220
Password: (from previous level)
What is grep?
grep = "Global Regular Expression Print". Think of it like Ctrl+F in a text editor, but WAY more powerful. It searches INSIDE files for specific text patterns.
Real-world analogy: Imagine you have a 1000-page book and need to find the word "millionth". You could read every page (would take forever), OR you could use grep which instantly finds it for you!
ls -ladata.txt - a large file with many linescat data.txtgrep "millionth" data.txtmillionth [PASSWORD HERE]grep searches INSIDE files for textgrep "search term" filenamegrep -i "word" file - Case-insensitive (finds Word, WORD, word)grep -n "word" file - Show line numbersgrep -v "word" file - Show lines that DON'T matchgrep -r "word" /path/ - Search recursively in all files
Password is the only line of text that occurs only once in data.txt
ssh bandit8@bandit.labs.overthewire.org -p 2220
Password: (from previous level)
What are sort and uniq?
sort: Arranges lines alphabetically (A-Z). Like sorting a deck of cards.
uniq: Removes duplicate CONSECUTIVE lines. But it ONLY works on sorted data!
Why sort first? Because uniq only removes duplicates that are next to each other. If you have: [apple, banana, apple], uniq won't remove the second apple because they're not consecutive. But if you sort first: [apple, apple, banana], NOW uniq works!
The pipe (|): This is the MAGIC of Linux! The | symbol takes the OUTPUT of one command and feeds it as INPUT to another command. It's like a production line in a factory!
cat data.txtsort data.txtsort data.txt | uniq -usort data.txt - Sort all lines| - Pipe (send output to next command)uniq -u - Show only unique lines (the -u flag means "unique only")sort arranges lines alphabeticallyuniq removes duplicate consecutive linesuniq -u shows ONLY lines that appear once| (pipe) chains commands togetheruniq -c - Count how many times each line appearsuniq -d - Show only duplicate linessort | uniq - Remove all duplicates (keep one copy)
Password is in data.txt, in one of the few human-readable strings, preceded by several '=' characters
ssh bandit9@bandit.labs.overthewire.org -p 2220
Password: (from previous level)
What is a binary file?
Most files are either text files (you can read them with cat) or binary files (compiled programs, images, etc. that look like gibberish if you cat them).
What is strings? The strings command extracts ONLY the human-readable text from binary files. It ignores all the binary garbage and shows you readable words!
Real-world analogy: Imagine a book where 99% of pages are in alien language, but 1% have English sentences. strings automatically finds and shows you ONLY the English sentences!
file data.txtdata.txt: data (binary file, not text!)cat data.txtstrings data.txtstrings data.txt | grep "=="========== password========== [THE PASSWORD]strings extracts readable text from binary files| is incredibly powerfulstrings -n 10 file - Show only strings of 10+ charactersstrings -a file - Scan entire file (default only scans certain sections)strings -o file - Show byte offset of each string
Password is in data.txt, which contains base64 encoded data
ssh bandit10@bandit.labs.overthewire.org -p 2220
Password: (from previous level)
What is Base64?
Base64 is an encoding (NOT encryption!) that converts binary data into ASCII text. It uses only letters (A-Z, a-z), numbers (0-9), and two symbols (+, /).
Why use it? Email and old systems can only handle text, not binary data. Base64 lets you send ANY file (images, programs) as text!
Example:
Original: Hello
Base64: SGVsbG8=
Notice the = at the end? That's padding! Base64 often ends with = or ==
⚠️ Important: Base64 is NOT secure! It's encoding, not encryption. Anyone can decode it instantly. It's just a way to represent data, not hide it!
cat data.txtVGhlIHBhc3N3b3JkIGlzIDZ6UGV6aUxkUjJSS05kTllGTmI2blZDS3pwaGxYSEJNCg==base64 -d data.txtbase64 - The base64 command-d - Decode flag (opposite of encode)data.txt - The file to decodeThe password is [PASSWORD HERE]base64 -d file decodes base64base64 file encodes to base64data:image/png;base64,...)
Password in data.txt where all lowercase (a-z) and uppercase (A-Z) letters have been rotated by 13 positions
ssh bandit11@bandit.labs.overthewire.org -p 2220
Password: (from previous level)
What is ROT13?
ROT13 = "Rotate by 13 places". It's a simple substitution cipher where each letter is replaced by the letter 13 positions after it in the alphabet.
The alphabet has 26 letters. So rotating by 13 means:
A → N, B → O, C → P, ... M → Z, N → A, O → B, ... Z → M
Cool trick: ROT13 is its own inverse! If you ROT13 something twice, you get the original back:
Hello → Uryyb → Hello
The tr command: "translate" - it replaces characters. Syntax: tr 'old chars' 'new chars'
cat data.txtGur cnffjbeq vf 7k16WgUl0m... (gibberish!)cat data.txt | tr 'A-Za-z' 'N-ZA-Mn-za-m'cat data.txt - Read the file| - Pipe the outputtr - Translate command'A-Za-z' - OLD characters (all letters)'N-ZA-Mn-za-m' - NEW characters (rotated by 13)'N-ZA-M' means: N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A,B,C,D,E,F,G,H,I,J,K,L,MThe password is [PASSWORD]tr translates/replaces characterstr 'from' 'to'tr 'a-z' 'A-Z' - Convert lowercase to uppercasetr -d 'a' - Delete all 'a' characterstr -s ' ' - Squeeze repeated spaces into onetr ' ' '_' - Replace spaces with underscores
Password is in data.txt, which is a hexdump of a file that has been compressed multiple times
ssh bandit12@bandit.labs.overthewire.org -p 2220
Password: (from previous level)
This is the first HARD level! The file is compressed with gzip, then bzip2, then tar, then gzip again, etc. - like Russian nesting dolls! You'll decompress, check file type, decompress again, repeat... about 8-10 times!
Compression Formats:
gzip -d file.gz or gunzip file.gzbzip2 -d file.bz2 or bunzip2 file.bz2tar -xf file.tarxxd -r
Key command: file filename - tells you what TYPE of file you're dealing with!
mkdir /tmp/mywork && cd /tmp/myworkcp ~/data.txt .. means "current directory"xxd -r data.txt > data.binxxd -r - Reverse hexdump (convert hex to binary)data.txt - Input (hex dump)> data.bin - Output redirect to new filefile data.bindata.bin: gzip compressed datamv data.bin data.gzgzip -d data.gzdata (without .gz)file datadata: bzip2 compressed datamv data data.bz2bzip2 -d data.bz2file data → gzip → mv data data.gz && gzip -d data.gzfile data → bzip2 → mv data data.bz2 && bzip2 -d data.bz2file data → tar archive → tar -xf datafile datadata: ASCII textcat dataThe password is [PASSWORD]xxd -r converts hexdump to binarygzip -d decompresses gzip filesbzip2 -d decompresses bzip2 filestar -xf extracts tar archivesfile command to check file type!file data → Check type
xxd -r hex.txt data → Hex to binary
gzip -d file.gz → Decompress gzip
bzip2 -d file.bz2 → Decompress bzip2
tar -xf file.tar → Extract tar
mv old new → Rename file
Password for next level is stored in /etc/bandit_pass/bandit14 (you can't read it yet!)
You have an SSH private key in your home directory to log in as bandit14
ssh bandit13@bandit.labs.overthewire.org -p 2220
What is SSH Key Authentication?
Usually you SSH with a password. But there's a MORE SECURE way: SSH keys!
How it works:
• You have TWO keys: private key (secret, keep it safe!) and public key (can share with anyone)
• The public key is placed on the server you want to access
• When you connect, you present your private key
• The server checks: "Does this private key match the public key I have?" If yes → you're in!
Real-world analogy: The public key is a lock, the private key is the key that opens it. You can give out many copies of the lock (public key), but only YOUR key (private key) can open them!
The -i flag: Tells SSH "use THIS specific private key file"
ls -lasshkey.privatecat sshkey.private-----BEGIN RSA PRIVATE KEY-----ssh -i sshkey.private bandit14@localhost -p 2220ssh - SSH command-i sshkey.private - Use this private keybandit14@localhost - Login as bandit14 on same machine-p 2220 - Port 2220cat /etc/bandit_pass/bandit14ssh -i keyfile uses specific keylocalhost means "this same machine"~/.ssh/ by defaultssh-keygen -t ed25519chmod 600 (owner read/write only)
Submit current level password to port 30000 on localhost to get next password
ssh bandit14@bandit.labs.overthewire.org -p 2220
What is a Network Port?
Think of your computer as an apartment building. The IP address is the building address. The ports are individual apartment numbers (1-65535)!
Common ports you should know:
• Port 22: SSH
• Port 80: HTTP (websites)
• Port 443: HTTPS (secure websites)
• Port 3306: MySQL database
• Port 30000: (custom, used in this challenge)
What is Netcat (nc)?
Netcat is the "Swiss Army knife" of networking! It can:
cat /etc/bandit_pass/bandit14nc localhost 30000nc - Netcat commandlocalhost - This same machine (127.0.0.1)30000 - Port numberCorrect![BANDIT15 PASSWORD]nc host port connects to a portlocalhost = 127.0.0.1 = this machine
Submit current password to port 30001 on localhost using SSL encryption
ssh bandit15@bandit.labs.overthewire.org -p 2220
What is SSL/TLS?
SSL (Secure Sockets Layer) and TLS (Transport Layer Security) encrypt your network traffic so nobody can spy on it!
Real-world analogy: Regular netcat is like sending a postcard (anyone can read it). SSL is like putting it in a locked box with a code only you and the recipient know!
When you see HTTPS: That's HTTP + SSL/TLS. The padlock 🔒 in your browser means encryption is active!
OpenSSL: The Swiss Army knife for SSL/TLS. It can:
cat /etc/bandit_pass/bandit15openssl s_client -connect localhost:30001 -ign_eofopenssl - OpenSSL tools_client - SSL client mode (connect to server)-connect localhost:30001 - Where to connect-ign_eof - Ignore end-of-file (keeps connection open)---
Certificate chain
SSL handshake has read 1234 bytes
...--- and a blank line ready for inputCorrect![BANDIT16 PASSWORD]openssl s_client creates encrypted connectionsopenssl s_client -connect site.com:443 - Test HTTPS connectionopenssl enc -aes-256-cbc -in file -out file.enc - Encrypt fileopenssl x509 -in cert.pem -text - View certificate detailsopenssl genrsa -out key.pem 2048 - Generate RSA key
Find the SSL port in range 31000-32000 on localhost, submit password to it
One port speaks SSL and will give you the next password
ssh bandit16@bandit.labs.overthewire.org -p 2220
What is Port Scanning?
Port scanning = checking which ports are OPEN (accepting connections) on a computer. It's like trying every door in a building to see which ones are unlocked!
Nmap: The KING of port scanners! Used by hackers, pentesters, and sysadmins worldwide. It can:
nmap -p 31000-32000 localhostnmap - Network mapper (port scanner)-p 31000-32000 - Port range to scanlocalhost - Target (this machine)PORT STATE SERVICE
31046/tcp open unknown
31518/tcp open unknown
31691/tcp open unknown
31790/tcp open unknown
31960/tcp open unknownopenssl s_client -connect localhost:31046 -ign_eofmkdir /tmp/mykey && cd /tmp/mykeynano sshkey.privatechmod 600 sshkey.privatessh -i sshkey.private bandit17@localhost -p 2220nmap -p range host scans port rangeschmod 600 sets file permissions to owner-onlynmap -sS host - SYN scan (stealth scan, default)nmap -sV host - Service version detectionnmap -O host - Operating system detectionnmap -A host - Aggressive scan (OS, version, scripts)nmap -Pn host - Skip ping (useful if ICMP blocked)
Password is the only line that changed between passwords.old and passwords.new
ssh bandit17@bandit.labs.overthewire.org -p 2220
What is diff?
diff compares two files line-by-line and shows the differences. It's like "track changes" in Microsoft Word!
Output format:
• Lines starting with < = in first file only
• Lines starting with > = in second file only
• Lines with --- = separator
• Numbers like 42c42 = line 42 changed
Real-world uses:
ls -lapasswords.old and passwords.newwc -l passwords.*diff passwords.old passwords.new42c42
< [OLD PASSWORD]
---
> [NEW PASSWORD]42c42 - Line 42 changed< [OLD PASSWORD] - What was in passwords.old> [NEW PASSWORD] - What's now in passwords.newdiff file1 file2 shows differences< means "in first file"> means "in second file"wc -l counts lines in filesdiff -u file1 file2 - Unified format (easier to read)diff -y file1 file2 - Side-by-side comparisondiff -r dir1 dir2 - Recursively compare directoriesdiff -q file1 file2 - Only say IF files differ, not how
Password in readme file in home directory
BUT: .bashrc file logs you out immediately!
ssh bandit18@bandit.labs.overthewire.org -p 2220
What is .bashrc?
.bashrc is a script that runs EVERY time you start a bash shell. It sets up your environment (aliases, colors, prompt, etc.)
The problem: Someone modified .bashrc to run exit, so you get logged out instantly!
The trick: You can run commands through SSH WITHOUT starting an interactive shell! Syntax: ssh user@host "command"
ssh bandit18@bandit.labs.overthewire.org -p 2220ssh bandit18@bandit.labs.overthewire.org -p 2220 "cat readme"cat readme.bashrc runs on every bash shell startupssh user@host "command" runs non-interactive commandssh ... "bash --norc" - Start bash without .bashrcssh ... "bash --noprofile" - Skip profile scriptsssh ... "/bin/sh" - Use different shell (sh doesn't use .bashrc)
Use the setuid binary to access bandit20's password
ssh bandit19@bandit.labs.overthewire.org -p 2220
What is SETUID?
SETUID (Set User ID) is a special permission bit. When you run a SETUID program, it executes with the permissions of the FILE OWNER, not YOU!
Real-world example: The passwd command (changes your password) is SETUID root. Why? Because it needs to edit /etc/shadow (a root-only file), but YOU need to be able to change YOUR password!
How to spot SETUID: Run ls -l file. If you see an 's' in the execute position: -rwsr-xr-x (the 's' means SETUID!)
Security risk: SETUID binaries are GOLD for hackers! If you can exploit one, you get higher privileges (privilege escalation!)
ls -la-rwsr-x--- 1 bandit20 bandit19 bandit20-do./bandit20-doRun a command as another user.whoamibandit19./bandit20-do cat /etc/bandit_pass/bandit20cat /etc/bandit_pass/bandit20ls -l shows 's' for SETUID fileswhoami shows current userfind / -perm -4000 2>/dev/null - Find all SETUID filesfind / -user root -perm -4000 2>/dev/null - SETUID root files (highest value!)
SETUID binary suconnect connects to localhost on port you specify
If it receives current password, it transmits next password
ssh bandit20@bandit.labs.overthewire.org -p 2220
The Challenge:
You need TWO things running AT THE SAME TIME:
Background processes: Adding & at the end of a command runs it in the background, so you can run more commands!
cat /etc/bandit_pass/bandit20echo "[PASTE BANDIT20 PASSWORD]" | nc -l -p 6000 &echo "password" - Output the password| - Pipe it to netcatnc -l -p 6000 - Listen on port 6000& - Run in background!jobsnetstat -ln | grep 6000./suconnect 6000Read: [BANDIT20 PASSWORD]
Password matches, sending next password
[BANDIT21 PASSWORD]& runs commands in backgroundnc -l -p PORT creates a listenerjobs shows background processescommand & - Run in backgroundjobs - List background jobsfg %1 - Bring job 1 to foregroundbg %1 - Continue job 1 in backgroundCtrl+Z - Suspend current processkill %1 - Kill job 1
🎯 Level 21 → 22: Cron Jobs
Cron = task scheduler (runs commands at specific times). Check /etc/cron.d/ for scheduled tasks. Read cron scripts to understand what they do!
cat /etc/cron.d/cronjob_bandit22
Look for script paths, read those scripts!
🎯 Level 22 → 23: Shell Scripting & MD5 Hashing
Script uses md5sum to create filename. Understand bash variables ($USER, $(command)) and command substitution!
echo I am user $myname | md5sum
Generate hash, find file in /tmp with that name!
🎯 Level 23 → 24: Writing Your Own Script
Cron job executes scripts in a directory. You can WRITE your own script that gets executed by bandit24!
#!/bin/bash
cat /etc/bandit_pass/bandit24 > /tmp/mypass
Make executable with chmod +x, wait for cron!
🎯 Level 24 → 25: Brute Force Attack
Daemon on port 30002 needs password + 4-digit PIN (0000-9999). Write a script to try ALL combinations!
for i in {0000..9999}; do
echo "PASSWORD $i"
done | nc localhost 30002
Brute force all 10,000 combinations!
🎯 Level 25 → 26: Escaping More Shell
SSH logs you out via shell. But there's a SETUID binary that uses more pager. If terminal is small, you can escape from more!
ssh -t bandit26@localhost -i key
Make terminal TINY, press 'v' in more to enter vim, read password from vim!
/etc/cron.d/, crontab syntaxmd5sum, unique fingerprintschmod +x to make executablemore, lessLevels 26-34 require advanced techniques combining everything you've learned. Each level builds on previous skills:
Concepts: Terminal resizing, vim editor exploitation, shell escape from vim
Key commands: :set shell=/bin/bash, :shell
Trick: Use vim's command mode to spawn shell and read files!
Concepts: Git history, commits, diffs, branches
Key commands: git log, git show, git diff
Trick: Password was committed then removed - check git history!
Concepts: Git tags (version markers)
Key commands: git tag, git show TAG
Trick: Password hidden in a git tag annotation!
Concepts: Remote git repositories, pushing commits
Key commands: git add, git commit, git push
Trick: Create a file, commit it, push to remote - password returned!
Concepts: Shell variable exploitation
Key trick: Shell converts commands to UPPERCASE (can't run normal commands!)
Solution: Use $0 (refers to shell itself) to spawn new shell!
Concepts: Combination of ALL previous techniques
Requirements: Mastery of file permissions, shell tricks, network knowledge
Reward: You've beaten Bandit! 🎉
git log --all
git show HASH
git branch -a
git checkout BRANCH
:set shell=/bin/bash
:shell
:!/bin/bash
:read /path/file
$0 - Current shell
$$ - Process ID
$? - Last exit code
$_ - Last argument
chmod +x file
find / -perm -4000
ls -la
stat file
You now have a COMPLETE roadmap of all 34 Bandit levels! You've learned:
Ready to put your skills into practice?
You've now mastered 7 Bandit levels! The remaining levels (7-34) cover: grep, sorting, encoding, compression, SSH keys, port connections, cron jobs, and more. Keep applying this same learning pattern - understand the concept, try the command, learn from outputs.
ssh - Remote loginls -la - List with hidden filescat - Read filescd - Change directoryfile - Check file typefind - Search by properties./ prefix - Handle special filenames2>/dev/null - Suppress errors