Freebootin.com

Page updated:


Preface

These are my writeups for the Bandit wargame. This does contain spoilers, but not passwords.

Level 0

You are supplied with a username bandit0, a host bandit.labs.overthewire.org a port number 2220, and a password bandit0.


Level 1

The password for the next level is stored in a file called - located in the home directory.

You cannot open - directly with cat like in level0.


Level 2

The password for the next level is stored in a file called spaces in this filename located in the home directory.

This is fundimentally the same problem as level 1. This time surround the filename in quotes. Bash autocompletion will actually do this for you.


Level 3

The password for the next level is stored in a hidden file in the inhere directory.


Level 4

The password for the next level is stored in the only human-readable file in the inhere directory.


Level 5

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

find -type f -size 1033c ! -executable breaks down to: - -type f look for a file. - -size 1033c it should be 1033 bytes in size. - ! -executable file should NOT(!) be executable.


Level 6

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

This is very similar to the last level.


Level 7

The password for the next level is stored in the file data.txt next to the word millionth.


Level 8

The password for the next level is stored in the file data.txt and is the only line of text that occurs only once.


Level 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.


Level 10

The password for the next level is stored in the file data.txt, which contains base64 encoded data.


Level 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.


Level 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.

This level was more annoying than difficult.


Level 13

The password for the next level is stored in /etc/bandit_pass/bandit14 and can only be read by user bandit14.


Level 14

The password for the next level can be retrieved by submitting the password of the current level to port 30000 on localhost.


Level 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 encryption.

This is a lot like level 14, except a different client program is used.


Level 16

The credentials for the next level can be retieved 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 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.


Level 17

There are 2 files in the home directory: 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.


Level 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.


Level 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.


Level 20

There is a setuid binary in the home directory 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).