Bandit Level 28 → Level 29
문제
https://overthewire.org/wargames/bandit/bandit29.html
목표
다음 레벨의 패스워드를 찾는다.
ssh://bandit27-git@localhost/home/bandit27-git/repo
2220번 포트에 git 저장소가 있다.bandit27-git
의 비밀번호는bandit27
의 비밀번호와 동일하다.
풀이
권한이 없으니 새 디렉토리로 이동한다.
1
2
bandit28@bandit:~$ mkdir /tmp/new_dir
bandit28@bandit:~$ cd /tmp/new_dir
git clone
명령어로 git 저장소를 복제한다.
1
bandit28@bandit:/tmp/new_dir$ git clone ssh://bandit28-git@localhost:2220/home/bandit28-git/repo
README.md
파일을 확인해봐도 패스워드가 보이지 않는다.
1
2
3
4
5
6
7
8
9
10
11
12
13
bandit28@bandit:/tmp/new_dir$ ls
repo
bandit28@bandit:/tmp/new_dir$ cd repo
bandit28@bandit:/tmp/new_dir/repo$ ls
README.md
bandit28@bandit:/tmp/new_dir/repo$ cat README.md
# Bandit Notes
Some notes for level29 of bandit.
## credentials
- username: bandit29
- password: xxxxxxxxxx
git log
명령어로 log를 확인해보면 3번의 commit이 있었음을 알 수 있다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
bandit28@bandit:/tmp/new_dir/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
git show
명령어로 첫번째 commit을 확인해보면 원래 있던 패스워드를 가린 것을 알 수 있다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
bandit28@bandit:/tmp/new_dir/repo$ git show 14f754b3ba6531a2b89df6ccae6446e8969a41f3
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
diff --git a/README.md b/README.md
index b302105..5c6457b 100644
--- a/README.md
+++ b/README.md
@@ -4,5 +4,5 @@ Some notes for level29 of bandit.
## credentials
- username: bandit29
-- password: tQKvmcwNYcFS6vmPHIUSI3ShmsrQZK8S
+- password: xxxxxxxxxx
Password : tQKvmcwNYcFS6vmPHIUSI3ShmsrQZK8S
배운 것
git log
명령어로 log를 확인할 수 있다.git show
명령어로 commit의 내용을 확인할 수 있다.
This post is licensed under CC BY 4.0 by the author.