MayADevBe Blog

A Blog about Computer Science

OverTheWire Bandit Level 27 -> 28 - Walkthrough

Previous Level: Level 27


Login

SSH: ssh bandit27@bandit.labs.overthewire.org -p 2220

Password: 3ba3118a22e93127a4ed485be72ef5ea

Task

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.

A little bit of Theory

Git is a free and open source distributed version control system” - https://git-scm.com/. It allows you to save your code, as well as the history and changes you have done to your code. It also makes collaboration and working in teams on the same code simpler.

The Git system contains a lot of commands. Some of the most essential commands are:

  • git init, to create a new Git repository/project
  • git clone, to copy an existing git repository
  • git push, updates remote repository
  • git pull, get updates from remote repository It is also possible to use a Git client that has a GUI for easier interaction (https://git-scm.com/downloads/guis).

Different services are providing you with a way to host your repository remote (public or private). If you are interested in open-source, these are often also the places to get the software or contribute. Very famous ones would be Github and GitLab.

The ‘.git’ directory contains all information that is required for version control. It contains information about commits, the remote repository address, a log and more.

The README file is often found in a git repository. It is used as an overview of all the files in a directory or the git project. When creating a git project, a README file is helpful to remember what the project is about, as well as other information that users and developers might need. For example, a short explanation of the project, configuration and installation instructions, licensing information and more.

Solution

First, we create a directory for the project then we clone it.

1
2
3
4
bandit27@bandit:~$ mktemp -d
/tmp/tmp.pUEZdMrFfV
bandit27@bandit:~$ cd /tmp/tmp.pUEZdMrFfV
bandit27@bandit:/tmp/tmp.pUEZdMrFfV$ git clone ssh://bandit27-git@localhost/home/bandit27-git/repo

There will be a password prompt. Just type in the password of bandit 27 and the repo will be cloned. Now let’s take a look at it.

1
2
3
4
5
6
7
8
9
bandit27@bandit:/tmp/tmp.pUEZdMrFfV$ ls
repo
bandit27@bandit:/tmp/tmp.pUEZdMrFfV$ cd repo
bandit27@bandit:/tmp/tmp.pUEZdMrFfV/repo$ ls -la
total 16
drwxr-sr-x 3 bandit27 root 4096 Jul  3 12:24 .
drwx--S--- 3 bandit27 root 4096 Jul  3 12:24 ..
drwxr-sr-x 8 bandit27 root 4096 Jul  3 12:24 .git
-rw-r--r-- 1 bandit27 root   68 Jul  3 12:24 README

We see the ‘.git’ directory and the common ‘README’ file. Since this is the only file, we check the content and find the password for the next level.

1
2
bandit27@bandit:/tmp/tmp.pUEZdMrFfV/repo$ cat README
The password to the next level is: 0ef186ac70e04ea33b4c1853d2526fa2

https://overthewire.org/wargames/bandit/bandit28.html


Next Level: Level 29


Share on: