Bandit Level 29 → Level 30
문제
https://overthewire.org/wargames/bandit/bandit30.html
목표
다음 레벨의 패스워드를 찾는다.
ssh://bandit29-git@localhost/home/bandit29-git/repo
2220번 포트에 git 저장소가 있다.bandit29-git
의 비밀번호는bandit29
의 비밀번호와 동일하다.
풀이
권한이 없으니 새 디렉토리로 이동한다.
1
2
bandit29@bandit:~$ mkdir /tmp/new_dir
bandit29@bandit:~$ cd /tmp/new_dir
git clone
명령어로 git 저장소를 복제한다.
1
bandit29@bandit:/tmp/new_dir$ git clone ssh://bandit29-git@localhost:2220/home/bandit29-git/repo
README.md
파일을 확인해보니 프로덕션 브랜치에 패스워드가 없다고 한다.
1
2
3
4
5
6
7
8
9
10
11
12
13
bandit29@bandit:/tmp/new_dir$ ls
repo
bandit29@bandit:/tmp/new_dir$ cd repo
bandit29@bandit:/tmp/new_dir/repo$ ls
README.md
bandit29@bandit:/tmp/new_dir/repo$ cat README.md
# Bandit Notes
Some notes for bandit30 of bandit.
## credentials
- username: bandit30
- password: <no passwords in production!>
git branch
명령어의 -a
옵션으로 모든 브랜치들을 확인해보니 다른 브랜치들이 있다.
1
2
3
4
5
6
bandit29@bandit:/tmp/new_dir/repo$ git branch -a
* master
remotes/origin/HEAD -> origin/master
remotes/origin/dev
remotes/origin/master
remotes/origin/sploits-dev
git checkout
명령어로 dev
브랜치로 변경한다.
1
2
3
bandit29@bandit:/tmp/new_dir/repo$ git checkout dev
Branch 'dev' set up to track remote branch 'dev' from 'origin'.
Switched to a new branch 'dev'
커밋의 내용을 확인해보니 패스워드를 확인할 수 있다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
bandit29@bandit:/tmp/new_dir/repo$ git show
commit 1d160de5f8f647f00634bbf3d49b9244275217b6 (HEAD -> dev, origin/dev)
Author: Morla Porla <morla@overthewire.org>
Date: Thu Oct 5 06:19:43 2023 +0000
add data needed for development
diff --git a/README.md b/README.md
index 1af21d3..a4b1cf1 100644
--- a/README.md
+++ b/README.md
@@ -4,5 +4,5 @@ Some notes for bandit30 of bandit.
## credentials
- username: bandit30
-- password: <no passwords in production!>
+- password: xbhV3HpNGlTIdnjUrdAlPzc2L6y9EOnS
Password : xbhV3HpNGlTIdnjUrdAlPzc2L6y9EOnS
배운 것
git branch
명령어의-a
옵션으로 모든 브랜치 목록을 볼 수 있다.git checkout
명령어로 브랜치를 변경할 수 있다.
This post is licensed under CC BY 4.0 by the author.