Bandit Level 28 → Level 29

장일영·2024년 5월 13일

Bandit

목록 보기
29/33

Level

Goal

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

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

2220번 포트를 통해 ssh://bandit28-git@localhost/home/bandit28-git/repo에 접속하면 git 저장소에 접근할 수 있다. bandit28-git 유저의 패스워드는 bandit28 유저의 패스워드와 동일하다.

저장소를 클론해 다음 레벨의 패스워드를 찾아라.

Commands you may need to solve this level

git

Exploit

bandit28@bandit:/tmp/tmp.k4AGJLMlTw$ git clone ssh://bandit28-git@localhost:2220/home/bandit28-git/repo

임시 디렉토리를 생성하고 주어진 git 저장소를 클론한다.

bandit28@bandit:/tmp/tmp.k4AGJLMlTw/repo$ cat README.md
# Bandit Notes
Some notes for level29 of bandit.

## credentials

- username: bandit29
- password: xxxxxxxxxx

README.md 파일을 보면 bandit29 계정의 패스워드에 대한 부분이 있으나 볼 수 없다. 하지만 git 저장소를 확인했기 때문에 추가적으로 확인해볼 수 있는 부분이 남아 있다. 가장 먼저 확인해볼 만한 것은 log다. 커밋 내역을 확인하면 다음과 같다.

bandit28@bandit:/tmp/tmp.k4AGJLMlTw/repo$ git log
commit 14f754b3ba6531a2b89df6ccae6446e8969a41f3 (HEAD -> master, origin/master, origin/HEAD)
Author: Morla Porla <morla@overthewire.org>
Date:   Thu Oct 5 06:19:41 2023 +0000

    fix info leak

commit f08b9cc63fa1a4602fb065257633c2dae6e5651b
Author: Morla Porla <morla@overthewire.org>
Date:   Thu Oct 5 06:19:41 2023 +0000

    add missing data

commit a645bcc508c63f081234911d2f631f87cf469258
Author: Ben Dover <noone@overthewire.org>
Date:   Thu Oct 5 06:19:41 2023 +0000

    initial commit of README.md

comment만 봐서는 어떤 내용을 어떻게 변경했는지 알기 어려운데, 가장 마지막 커밋의 결과물은 이미 확인했으니 아래 두 개의 내용만 확인해보면 될 것 같다.

bandit28@bandit:/tmp/tmp.k4AGJLMlTw/repo$ git show f08b9cc63fa1a4602fb065257633c2dae6e5651b

0개의 댓글