Over The Wire


Bandit

Host: bandit.labs.overthewire.org

Port: 2220



Level 31

ssh bandit31@bandit.labs.overthewire.org -p 2220
password: OoffzGDlzhAlerFJ2cAiz1D41JW1Mhmt

Objective:

There is a git repository at ssh://bandit31-git@localhost:2220/home/bandit31-git/repo via the port 2220. The password for the user bandit31-git is the same as for the user bandit31.

Clone the repository and find the password for the next level.

CLI:

bandit31@bandit:~$ mktemp -d
/tmp/tmp.lgVyuuL42w
bandit31@bandit:~$ /tmp/tmp.lgVyuuL42w
-bash: /tmp/tmp.lgVyuuL42w: Is a directory
bandit31@bandit:~$ cd /tmp/tmp.lgVyuuL42w

bandit31@bandit:/tmp/tmp.lgVyuuL42w$ git clone ssh://bandit31-git@localhost:2220/home/bandit31-git/repo
Cloning into 'repo'...
bandit31-git@localhost's password:
remote: Enumerating objects: 4, done.
remote: Counting objects: 100% (4/4), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 4 (delta 0), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (4/4), done.

bandit31@bandit:/tmp/tmp.lgVyuuL42w$ ls
repo
bandit31@bandit:/tmp/tmp.lgVyuuL42w$ cd repo
bandit31@bandit:/tmp/tmp.lgVyuuL42w/repo$ ls -la
total 20
drwxrwxr-x 3 bandit31 bandit31 4096 Apr 2 21:26 .
drwx------ 3 bandit31 bandit31 4096 Apr 2 21:26 ..
drwxrwxr-x 8 bandit31 bandit31 4096 Apr 2 21:26 .git
-rw-rw-r-- 1 bandit31 bandit31 6 Apr 2 21:26 .gitignore
-rw-rw-r-- 1 bandit31 bandit31 147 Apr 2 21:26 README.md
bandit31@bandit:/tmp/tmp.lgVyuuL42w/repo$ cat README.md
This time your task is to push a file to the remote repository.

Details:
File name: key.txt
Content: 'May I come in?'
Branch: master

bandit31@bandit:/tmp/tmp.lgVyuuL42w/repo$ echo 'May I come in?' > key.txt
bandit31@bandit:/tmp/tmp.lgVyuuL42w/repo$ ls -la
total 24
drwxrwxr-x 3 bandit31 bandit31 4096 Apr 2 21:30 .
drwx------ 3 bandit31 bandit31 4096 Apr 2 21:26 ..
drwxrwxr-x 8 bandit31 bandit31 4096 Apr 2 21:26 .git
-rw-rw-r-- 1 bandit31 bandit31 6 Apr 2 21:26 .gitignore
-rw-rw-r-- 1 bandit31 bandit31 15 Apr 2 21:30 key.txt
-rw-rw-r-- 1 bandit31 bandit31 147 Apr 2 21:26 README.md

bandit31@bandit:/tmp/tmp.lgVyuuL42w/repo$ git add -f key.txt
bandit31@bandit:/tmp/tmp.lgVyuuL42w/repo$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes to be committed:
(use "git restore --staged ..." to unstage)
new file: key.txt
bandit31@bandit:/tmp/tmp.lgVyuuL42w/repo$ git commit -a
bandit31-git@localhost's password:
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 2 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 321 bytes | 321.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
remote: ### Attempting to validate files... ####
remote:
remote: .oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.
remote:
remote: Well done! Here is the password for the next level:
remote: rmCBvG56y58BXzv98yZGdO7ATVL5dW8y
remote:
remote: .oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.

bandit31@bandit:/tmp/tmp.lgVyuuL42w/repo$

Bandit