OverTheWire.org Walkthrough: Bandit

~ Level 27→28 ~

Level Description

There is a git repository at ssh://bandit27-git@localhost/home/bandit27-git/repo. 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.

There is only one command that may be required to solve this level: git.


Research Before Solving

The only research we need to perform for this level is looking at the man pages of git. This tool is called a Distributed Version Control System and it allows a group of programmers to work on files simultaneously. Users can upload and download updated files with simple commands. We are advised we need to clone the given repository so that we may locate the password. Looking through we find the command known as git clone

git clone in man pages

Solution Walkthrough

Start by logging into the server as bandit27. The first thing we need to do is create a directory under /tmp so that we have permissions to clone the repository. After changing the permissions, we will clone the repository with the following command: git clone ssh://bandit27-git@localhost/home/bandit27-git/repo. We are asked to confirm by typing yes and hitting enter.

to confirm type yes

Next we are prompted for the password to the repository, the description states it's the same password that we used to gain shell access as bandit27.

enter bandit27 password for git

You should then see some shell output confirming the process was completed. Now, we can use ls to list the contents of our directory. After viewing the contents we will use cd to move into the cloned git repository.

Once inside of the repository, issue another ls command.

readme file in git repository

We can then use cat on the file named README to see its contents.

password to bandit28

That was a relatively easy level! The password to the next level is: 0ef186ac70e04ea33b4c1853d2526fa2. Before moving on we need to remove the directory under /tmp that we created. My directory was named /tmp/user so I will issue the following command: rm -rf /tmp/user.