OverTheWire Bandit Level 30->Level 31 - Walkthrough

Cybersecurity - OverTheWire Bandit Solutions
OverTheWire Bandit Solutions

Introduction

In this post, I will be giving you a walkthrough to the Bandit wargame Level 30->Level 31. We will learn git tag and use it to clear this level.

Goal

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.

Login Details

Server - bandit.labs.overthewire.org
Port - 2220
Username - bandit30
Password - xbhV3HpNGLTIdnjUrdAlPzc2L6y9EOnS

Theory

git tagging allows git to tag specific points in a repository as important and certain messages to it. Typically, it is helpful in marking different release versions of a software.

Use the command "git tag" to see the different tags associated to a repository.

git show [tag_name] can be used to view the message inside a tag. Please explore more on git tagging and read its documentation to know more.

Solution

SSH into the user bandit30 using the command "ssh bandit30@bandit.labs.overthewire.org -p 2220" and the above password. Create a directory in /tmp folder and clone the git repository in the new folder. 
Type the commands-:

  • mkdir /tmp/temporary30git
  • cd /tmp/temporary30git
  • git clone ssh://bandit30-git@localhost:2220/home/bandit30-git/repo
Note- The port number needs to be placed after localhost otherwise the default port will be used to connect and it will fail.

Navigate into the repository and see the contents. Type the commands-:

  • ls
  • cd repo
  • ls -la
  • cat README.md
  • git branch -a

Notice that the README.md file does not give any hint this time. There is nothing useful looking at the branches as well. Type the command "git tag" to see if we can find anything useful.

We see that a tag by the name "secret" is present. Type the command "git show secret" to view its contents.

This completes Level 31 walkthrough as we have the password. Please explore on the commands and post your questions in the comment section.


Comments

Popular Posts