OverTheWire Bandit Guide

here's how to solve the bandit level 30 → 31

Back to the Bandit Guides

Previous Level Guide: Bandit Level 29 → 30


Access

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

Password: cvJfYKNlrTRaaAOjjbmAiQ7NT0ZxTVyp

Info

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.
Commands: git

Theory

To get the password, the instructions say to clone the repository and look for the password there. So, I already explained this in the last last last level, and the instructions don't give much more insight into what the level will be, so here's the commands again:

git clone ssh://bandit30-git@localhost/home/bandit30-git/repo
git clone ssh://bandit30-git@localhost:2220/home/bandit30-git/repo

Solution

Same thing as last last last level:

~$ mktemp -d
/tmp/tmp.rlRnCZpqgh

~$ cd /tmp/tmp.rlRnCZpqgh

/tmp/tmp.rlRnCZpqgh$ git clone ssh://bandit30-git@localhost:2220/home/bandit30-git/repo
...
Receiving objects: 100% (4/4), done.

Now that we have the repository, let's look what's inside:

/tmp/tmp.rlRnCZpqgh$ ls
repo

/tmp/tmp.rlRnCZpqgh$ cd repo

/tmp/tmp.rlRnCZpqgh/repo$ ls -la
total 16
drwxrwxr-x 3 bandit30 bandit30 4096 Jan  7 15:20 .
drwx------ 3 bandit30 bandit30 4096 Jan  7 15:19 ..
drwxrwxr-x 8 bandit30 bandit30 4096 Jan  7 15:20 .git
-rw-rw-r-- 1 bandit30 bandit30   30 Jan  7 15:20 README.md

/tmp/tmp.rlRnCZpqgh/repo$ cat README.md
just an epmty file... muahaha

The README file doesn't give us much information, if we check the tags, we can find a point in history called "secret", muahaha:

/tmp/tmp.rlRnCZpqgh/repo$ git tag
secret

bandit30@bandit:/tmp/tmp.bJM237ZHhX/repo$ git show secret
5rdWnMsS81Zw9mpruSVu3yDpmA4AtqMN

And that's the password! Now we should be good to go to the next level.

https://overthewire.org/wargames/bandit/bandit31.html
Next Level Guide: Bandit Level 31 → Level 32