Level 28 → Level 29

옥영진·2020년 5월 21일
0

Bandit - OverTheWire

목록 보기
29/33

Level 28 → Level 29

목표

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

Commands you may need to solve this level
git

이전 레벨과 마찬가지로 주어진 url을 통해 저장소를 clone하여 패스워드를 찾는다.

해결

mkdir /tmp/bandityj
cd /tmp/bandityj
git clone ssh://bandit28-git@localhost/home/bandit28-git/repo

cd ./repo
cat ./README.md

저장소를 clone하여 안에 있는 README.md 파일의 내용을 확인해보니 bandit29 사용자의 패스워드가 있었지만 마스킹 처리되어 있었다.

git log

위 명령어를 통해 커밋 이력을 살펴 보았더니 fix info leak 라는 커밋 메세지가 있었다. 정보 유출을 수정했다는 의미이므로 이 때 마스킹 처리를 했음을 예상할 수 있다. 따라서 커밋을 리셋해보았다.

git reset --hard c086d11a00c0648d095d04c089786efef5e01264

git reset --hard는 커밋 이력을 되돌리는데 수정한 파일 내용까지 전부 되돌린다. 뒤에 있는 16진수는 커밋의 체크섬이다. 되돌리고 나서 README.md 파일의 내용을 살펴보면 다음 레벨로 가는 패스워드를 얻을 수 있다.

profile
안녕하세요 함께 공부합시다

0개의 댓글