Level Goal
There is a git repository at ssh://bandit29-git@localhost/home/bandit29-git/repo. The password for the user bandit29-git is the same as for the user bandit29.
Clone the repository and find the password for the next level.
Commands you may need to solve this level
git
0. 문제 풀기위한 개념
- git 사용법
1. bandit29 비밀번호
bbc96594b4e001778eee9975372716b2
2. git 다운로드
bandit29@bandit:/tmp/acemasters$ git clone ssh://bandit29-git@localhost/home/bandit29-git/repo
home 에 쓰기권한이 없어 /tmp/acemasters 디렉토리를 생성후 해당 명령어를 입력했다.
3. 파일확인
bandit29@bandit:/tmp/acemasters/repo$ cat README.md
# Bandit Notes
Some notes for bandit30 of bandit.
## credentials
- username: bandit30
- password: <no passwords in production!>
해당 폴더에는 다음과 같이 정보가 있다.
4. 커밋 로그 조회
diff --git a/README.md b/README.md
index 2da2f39..1af21d3 100644
--- a/README.md
+++ b/README.md
@@ -3,6 +3,6 @@ Some notes for bandit30 of bandit.
## credentials
-- username: bandit29
+- username: bandit30
- password: <no passwords in production!>
git에서 commit 시 변경한 데이터의 로그를 검색할 수 있다. git 파일이 있는 디렉토리에서 git log -p명령어를 입력하면 삭제추가된 내용을 조회할 수 있다. password의 수정 내역은 보이지 않았다.
5. branch 조회
bandit29@bandit:/tmp/acemasters/repo$ git branch -a
* master
remotes/origin/HEAD -> origin/master
remotes/origin/dev
remotes/origin/master
remotes/origin/sploits-dev
git branch -a
로 로컬의 git의 branch를 조회할수있다. 현제 HEAD로 설정이 되어있으며 dev, master 그리고 sploits-dev의 branch가 있다.
6. branch 변경
bandit29@bandit:/tmp/acemasters/repo$ git checkout dev
Branch dev set up to track remote branch dev from origin.
Switched to a new branch 'dev'
bandit29@bandit:/tmp/acemasters/repo$ ls -l
total 8
drwxr-sr-x 2 bandit29 root 4096 Apr 25 09:39 code
-rw-r--r-- 1 bandit29 root 134 Apr 25 09:39 README.md
git checkout dev
명령어로 branch를 변경했다. 이 branch에서는 code와 README.md 파일이 있다.
7. 파일 조회
bandit29@bandit:/tmp/acemasters/repo$ cat README.md
# Bandit Notes
Some notes for bandit30 of bandit.
## credentials
- username: bandit30
- password: 5b90576bedb2cc04c86a9e924ce42faf
MASTER branch에서 기록이 안되었던 password가 dev 에서는 존재한다.
8. bandit30 로그인 패스워드
5b90576bedb2cc04c86a9e924ce42faf