BB

technology and craziness.

BB

technology and craziness.

OverTheWire - Bandit - Level 31 → Level 32

Warning: This post contains a solution!
Only continue if:
1.) you want to see a possible alternative solution or
2.) you are stuck and need a hint!

Connect to the server using the following credentials:

Server: bandit.labs.overthewire.org
Port: 2220
Username: bandit31
Password: 47e6xxxxxxxxxxxxxxxxxxxxxxxxxxxx

Level Goal is:

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

Clone the repository and check folders/files.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
λ git clone ssh://bandit31-git@bandit.labs.overthewire.org:2220/home/bandit31-git/repo
Cloning into 'repo'...
This is a OverTheWire game server. More information on http://www.overthewire.org/wargames

bandit31-git@bandit.labs.overthewire.org password:
remote: Counting objects: 4, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 4 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (4/4), done.

Y:\Sites\www.overthewire.org\bandit\level31_32
λ ls
repo/

Y:\Sites\www.overthewire.org\bandit\level31_32
λ cd repo\

Y:\Sites\www.overthewire.org\bandit\level31_32\repo (master -> origin)
λ ls
README.md

Y:\Sites\www.overthewire.org\bandit\level31_32\repo (master -> origin)
λ 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

Okay, we have to create a file, add a content to it and push the file to the repository.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Y:\Sites\www.overthewire.org\bandit\level31_32\repo (master -> origin)
λ echo 'May I come in?' > key.txt

Y:\Sites\www.overthewire.org\bandit\level31_32\repo (master -> origin)
λ git add key.txt
The following paths are ignored by one of your .gitignore files:
key.txt
Use -f if you really want to add them.

Y:\Sites\www.overthewire.org\bandit\level31_32\repo (master -> origin)
λ git add -f key.txt

Y:\Sites\www.overthewire.org\bandit\level31_32\repo (master -> origin)
λ git commit -m '...'
[master 2e919ca] '...'
 1 file changed, 1 insertion(+)
 create mode 100644 key.txt

Y:\Sites\www.overthewire.org\bandit\level31_32\repo (master -> origin)
λ git push
This is a OverTheWire game server. More information on http://www.overthewire.org/wargames

bandit31-git@bandit.labs.overthewire.org password:
Enumerating objects: 13, done.
Counting objects: 100% (13/13), done.
Delta compression using up to 6 threads
Compressing objects: 100% (8/8), done.
Writing objects: 100% (12/12), 954 bytes | 954.00 KiB/s, done.
Total 12 (delta 3), reused 0 (delta 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: 56a9xxxxxxxxxxxxxxxxxxxxxxxxxxxx
remote:
remote: .oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.
remote:
remote:
remote: .oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.
remote:
remote: Wrong!
remote:
remote: .oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.
remote:
To ssh://bandit.labs.overthewire.org:2220/home/bandit31-git/repo
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'ssh://bandit31-git@bandit.labs.overthewire.org:2220/home/bandit31-git/repo'