Skip to content

I’m¶

OverTheWire¶


OverTheWire CTF Contents
OverTheWire Bandit Levels

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

Level Password Level Goal Solution Level Link
0 bandit0 The goal of this level is for you to log into the game using SSH. The host to which you need to connect isĀ bandit.labs.overthewire.org, on port 2220. The username isĀ bandit0Ā and the password isĀ bandit0. Once logged in, go to theĀ Level 1Ā page to find out how to beat Level 1. 1) ls -a

2) cat readme
https://overthewire.org/wargames/bandit/bandit0.html
1 ZjLjTmM6FvvyRnrb2rfNWOZOTa6ip5If The password for the next level is stored in a file calledĀ readmeĀ located in the home directory. Use this password to log into bandit1 using SSH. Whenever you find a password for a level, use SSH (on port 2220) to log into that level and continue the game. 1) cat ./- https://overthewire.org/wargames/bandit/bandit1.html
2 263JGJPfgU6LtdEvgfWU1XP5yac29mFx The password for the next level is stored in a file calledĀ spaces in this filenameĀ located in the home directory 1) cat "spaces in this filename" https://overthewire.org/wargames/bandit/bandit2.html
3 MNk8KNH3Usiio41PRUEoDFPqfxLPlSmx The password for the next level is stored in a hidden file in theĀ inhereĀ directory. 1) cd inhere

2) cat ...Hiding-From-You
https://overthewire.org/wargames/bandit/bandit3.html
4 2WmrDFRmJIq3IPxneAaMGhap0pFhF3NJ
The password for the next level is stored in the only human-readable file in theĀ inhereĀ directory. Tip: if your terminal is messed up, try the ā€œresetā€ command. 1) cd inhere

2) ls -all

3) file ./*

4) cat ./-file07
https://overthewire.org/wargames/bandit/bandit4.html
5 4oQYVPkxZOOEOO5pTW81FB8j8lxXGUQw The password for the next level is stored in a file somewhere under theĀ inhereĀ directory and has all of the following properties:
- human-readable
- 1033 bytes in size
- not executable
1) cd inhere

2) ls ./* -all

3) cat ./maybehere07/.file2
https://overthewire.org/wargames/bandit/bandit5.html
6 HWasnPhtq9AVKe0dmk45nxy20cvUa6EG The password for the next level is storedĀ somewhere on the serverĀ and has all of the following properties:

- owned by user bandit7
- owned by group bandit6
- 33 bytes in size
1) find /* -group bandit6 -user bandit7 2>/dev/null

2) cat /var/lib/dpkg/info/bandit7.password
https://overthewire.org/wargames/bandit/bandit6.html
7 morbNTDkSW6jIlUc0ymOdMaLnOlFVAaj The password for the next level is stored in the fileĀ data.txtĀ next to the wordĀ millionth 1) cat ./data.txt | grep "millionth" https://overthewire.org/wargames/bandit/bandit7.html
8 dfwvzFQi4mU0wfNbFOe9RoWskMLg7eEc The password for the next level is stored in the fileĀ data.txtĀ and is the only line of text that occurs only once https://overthewire.org/wargames/bandit/bandit8.html
9 The password for the next level is stored in the fileĀ data.txtĀ in one of the few human-readable strings, preceded by several ā€˜=’ characters. https://overthewire.org/wargames/bandit/bandit9.html
10 The password for the next level is stored in the fileĀ data.txt, which contains base64 encoded data https://overthewire.org/wargames/bandit/bandit10.html
11 The password for the next level is stored in the fileĀ data.txt, where all lowercase (a-z) and uppercase (A-Z) letters have been rotated by 13 positions https://overthewire.org/wargames/bandit/bandit11.html
12 The password for the next level is stored in the fileĀ data.txt, which is a hexdump of a file that has been repeatedly compressed. For this level it may be useful to create a directory under /tmp in which you can work. Use mkdir with a hard to guess directory name. Or better, use the command ā€œmktemp -dā€. Then copy the datafile using cp, and rename it using mv (read the manpages!) https://overthewire.org/wargames/bandit/bandit12.html
13 The password for the next level is stored inĀ /etc/bandit_pass/bandit14 and can only be read by user bandit14. For this level, you don’t get the next password, but you get a private SSH key that can be used to log into the next level.Ā Note:Ā localhostĀ is a hostname that refers to the machine you are working on https://overthewire.org/wargames/bandit/bandit13.html
14 The password for the next level can be retrieved by submitting the password of the current level toĀ port 30000 on localhost. https://overthewire.org/wargames/bandit/bandit14.html
15 The password for the next level can be retrieved by submitting the password of the current level toĀ port 30001 on localhostĀ using SSL/TLS encryption.

Helpful note: Getting ā€œDONEā€, ā€œRENEGOTIATINGā€ or ā€œKEYUPDATEā€? Read the ā€œCONNECTED COMMANDSā€ section in the manpage.
https://overthewire.org/wargames/bandit/bandit15.html
16 The credentials for the next level can be retrieved by submitting the password of the current level toĀ a port on localhost in the range 31000 to 32000. First find out which of these ports have a server listening on them. Then find out which of those speak SSL/TLS and which don’t. There is only 1 server that will give the next credentials, the others will simply send back to you whatever you send to it.

Helpful note: Getting ā€œDONEā€, ā€œRENEGOTIATINGā€ or ā€œKEYUPDATEā€? Read the ā€œCONNECTED COMMANDSā€ section in the manpage.
https://overthewire.org/wargames/bandit/bandit16.html
17 There are 2 files in the homedirectory:Ā passwords.old and passwords.new. The password for the next level is inĀ passwords.newĀ and is the only line that has been changed betweenĀ passwords.old and passwords.new

NOTE: if you have solved this level and see ā€˜Byebye!’ when trying to log into bandit18, this is related to the next level, bandit19
https://overthewire.org/wargames/bandit/bandit17.html
18 The password for the next level is stored in a fileĀ readmeĀ in the homedirectory. Unfortunately, someone has modifiedĀ .bashrcĀ to log you out when you log in with SSH. https://overthewire.org/wargames/bandit/bandit18.html
19 To gain access to the next level, you should use the setuid binary in the homedirectory. Execute it without arguments to find out how to use it. The password for this level can be found in the usual place (/etc/bandit_pass), after you have used the setuid binary. https://overthewire.org/wargames/bandit/bandit19.html
20 There is a setuid binary in the homedirectory that does the following: it makes a connection to localhost on the port you specify as a commandline argument. It then reads a line of text from the connection and compares it to the password in the previous level (bandit20). If the password is correct, it will transmit the password for the next level (bandit21).

NOTE:Ā Try connecting to your own network daemon to see if it works as you think
https://overthewire.org/wargames/bandit/bandit20.html
21 A program is running automatically at regular intervals fromĀ cron, the time-based job scheduler. Look inĀ /etc/cron.d/Ā for the configuration and see what command is being executed. https://overthewire.org/wargames/bandit/bandit21.html
22 A program is running automatically at regular intervals fromĀ cron, the time-based job scheduler. Look inĀ /etc/cron.d/Ā for the configuration and see what command is being executed.

NOTE:Ā Looking at shell scripts written by other people is a very useful skill. The script for this level is intentionally made easy to read. If you are having problems understanding what it does, try executing it to see the debug information it prints.
https://overthewire.org/wargames/bandit/bandit22.html
23 A program is running automatically at regular intervals fromĀ cron, the time-based job scheduler. Look inĀ /etc/cron.d/Ā for the configuration and see what command is being executed.

NOTE:Ā This level requires you to create your own first shell-script. This is a very big step and you should be proud of yourself when you beat this level!

NOTE 2:Ā Keep in mind that your shell script is removed once executed, so you may want to keep a copy around…
https://overthewire.org/wargames/bandit/bandit23html
24 A daemon is listening on port 30002 and will give you the password for bandit25 if given the password for bandit24 and a secret numeric 4-digit pincode. There is no way to retrieve the pincode except by going through all of the 10000 combinations, called brute-forcing.
You do not need to create new connections each time
https://overthewire.org/wargames/bandit/bandit24.html
25 Logging in to bandit26 from bandit25 should be fairly easy… The shell for user bandit26 is notĀ /bin/bash, but something else. Find out what it is, how it works and how to break out of it.

NOTE: if you’re a Windows user and typically use Powershell toĀ sshĀ into bandit: Powershell is known to cause issues with the intended solution to this level. You should use command prompt instead.
https://overthewire.org/wargames/bandit/bandit25.html
26 Good job getting a shell! Now hurry and grab the password for bandit27! https://overthewire.org/wargames/bandit/bandit26.html
27 There is a git repository atĀ ssh://bandit27-git@localhost/home/bandit27-git/repoĀ via the portĀ 2220. The password for the userĀ bandit27-gitĀ is the same as for the userĀ bandit27.

Clone the repository and find the password for the next level.
https://overthewire.org/wargames/bandit/bandit27.html
28 There is a git repository atĀ ssh://bandit28-git@localhost/home/bandit28-git/repoĀ via the portĀ 2220. The password for the userĀ bandit28-gitĀ is the same as for the userĀ bandit28.

Clone the repository and find the password for the next level.
https://overthewire.org/wargames/bandit/bandit28.html
29 There is a git repository atĀ ssh://bandit29-git@localhost/home/bandit29-git/repoĀ via the portĀ 2220. The password for the userĀ bandit29-gitĀ is the same as for the userĀ bandit29.

Clone the repository and find the password for the next level.
https://overthewire.org/wargames/bandit/bandit29.html
30 There is a git repository atĀ ssh://bandit30-git@localhost/home/bandit30-git/repoĀ via the portĀ 2220. The password for the userĀ bandit30-gitĀ is the same as for the userĀ bandit30.

Clone the repository and find the password for the next level.
https://overthewire.org/wargames/bandit/bandit30.html
31 There is a git repository atĀ ssh://bandit31-git@localhost/home/bandit31-git/repoĀ via the portĀ 2220. The password for the userĀ bandit31-gitĀ is the same as for the userĀ bandit31.

Clone the repository and find the password for the next level.
https://overthewire.org/wargames/bandit/bandit31.html
32 After all thisĀ gitĀ stuff, it’s time for another escape. Good luck! https://overthewire.org/wargames/bandit/bandit32.html
33 At this moment, level 34 does not exist yet. https://overthewire.org/wargames/bandit/bandit33.html