Wednesday, July 8, 2015

OverTheWire - Bandit - Cheat Sheet

Since going through the bandit levels I found I was referencing a kind of cheat sheet with my hints and what the password is. Here is that same sheet in post form. Warning: Spoilers Imminent!

Bandit 1 - Level Goal

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 to log into that level and continue the game.

» Click to Show Solution - Click Again to Hide... «
» Click to Show Password - Click Again to Hide... «

Bandit 2 - Level Goal

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

» Click to Show Solution - Click Again to Hide... «
» Click to Show Password - Click Again to Hide... «

Bandit 3 - Level Goal

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

» Click to Show Solution - Click Again to Hide... «
» Click to Show Password - Click Again to Hide... «

Bandit 4 - Level Goal

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

» Click to Show Solution - Click Again to Hide... «
» Click to Show Password - Click Again to Hide... «

Bandit 5 - Level Goal

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.

» Click to Show Solution - Click Again to Hide... «
» Click to Show Password - Click Again to Hide... «

Bandit 6 - Level Goal

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

» Click to Show Solution - Click Again to Hide... «
» Click to Show Password - Click Again to Hide... «

Bandit 7 - Level Goal

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

» Click to Show Solution - Click Again to Hide... «
» Click to Show Password - Click Again to Hide... «

Bandit 8 - Level Goal

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

» Click to Show Solution - Click Again to Hide... «
» Click to Show Password - Click Again to Hide... «

Bandit 9 - Level Goal

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

» Click to Show Solution - Click Again to Hide... «
» Click to Show Password - Click Again to Hide... «

Bandit 10 - Level Goal

The password for the next level is stored in the file data.txt in one of the few human-readable strings, beginning with several '=' characters.

» Click to Show Solution - Click Again to Hide... «
» Click to Show Password - Click Again to Hide... «

Bandit 11 - Level Goal

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

» Click to Show Solution - Click Again to Hide... «
» Click to Show Password - Click Again to Hide... «

Bandit 12 - Level Goal

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.

» Click to Show Solution - Click Again to Hide... «
» Click to Show Password - Click Again to Hide... «

Bandit 13 - Level Goal

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 using mkdir. For example: mkdir /tmp/myname123. Then copy the datafile using cp, and rename it using mv (read the manpages!)

No easy solution for this one, check the link tutorial or just use the password spoiler.
» Click to Show Password - Click Again to Hide... «

Bandit 14 - Level Goal

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.

» Click to Show Solution - Click Again to Hide... «
» Click to Show Password - Click Again to Hide... «

Bandit 15 - Level Goal

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

» Click to Show Solution - Click Again to Hide... «
» Click to Show Password - Click Again to Hide... «

Bandit 16 - Level Goal

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.

» Click to Show Solution - Click Again to Hide... «
» Click to Show Password - Click Again to Hide... «

Bandit 17 - Level Goal

The password for the next level can be retrieved by submitting the password of the current level to a port on localhost in the range of 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 it.

» Click to Show Solution - Click Again to Hide... «
» Click to Show Password - Click Again to Hide... «

Bandit 18 - Level Goal

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

NOTE: if you have solved this level and see 'Byebye!' when trying to log into bandit18, this is related to the next level, bandit19.

» Click to Show Solution - Click Again to Hide... «
» Click to Show Password - Click Again to Hide... «

Bandit 19 - Level Goal

The password for the next level is stored in a file readme in in the home directory. Unfortunately, someone has modified the .bashrc to log you out when you log in with SSH.

» Click to Show Solution - Click Again to Hide... «
» Click to Show Password - Click Again to Hide... «

Bandit 20 - Level Goal

To gain access to the next level, you should use the setuid binary in the home directory. 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/bandit20), after you have used the setuid binary.

» Click to Show Solution - Click Again to Hide... «
» Click to Show Password - Click Again to Hide... «

Bandit 21 - Level Goal

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 command line 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: To beat this level, you will need to log in twice: once to run the setuid command, and once to start a network daemon to which the setuid will connect.

NOTE: Try connecting to your own network daemon to see if it works as you think
» Click to Show Solution - Click Again to Hide... «
» Click to Show Password - Click Again to Hide... «

Bandit 22 - Level Goal

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.

» Click to Show Solution - Click Again to Hide... «
» Click to Show Password - Click Again to Hide... «

Bandit 23 - Level Goal

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.

» Click to Show Solution - Click Again to Hide... «
» Click to Show Password - Click Again to Hide... «

Bandit 24 - Level Goal

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: Keep in mind that your shell script is removed once executed, so you may want to keep a copy around...

No simple solution available as this level requires making a shell script, giving it proper privileges, making it executable and copying it to a directory. Read the tutorial link.
» Click to Show Password - Click Again to Hide... «

Bandit 25 - Level Goal

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 combinaties, called brute-forcing.

NOTE: This level requires you to create another shell-script so you aren't trying all combinations by hand

No simple solution available as this level requires making a shell script to iterate all possible permutations of 4-digit pins. Read the tutorial link.
» Click to Show Password - Click Again to Hide... «

Bandit 26 - Level Goal

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.

No simple solution available as this level requires escaping from "more" into visual mode, setting the vi shell variable, calling a sub-shell all to be able to read the password into the read-only file. Read the tutorial link.
» Click to Show Password - Click Again to Hide... «

No comments:

Post a Comment