bandit28 (소름)

KJH·2022년 12월 6일

bandit

목록 보기
24/29
ssh bandit28@bandit.labs.overthewire.org -p 2220 
#AVanL161y9rsbcJIsFHuw35rjaOM19nR

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.

ssh://bandit28-git@localhost/home/bandit28-git/repo에 git 저장소가 있습니다. 사용자 밴디트 28-git의 암호는 사용자 밴디트 28의 암호와 동일합니다.
리포지토리를 복제하고 다음 수준의 암호를 찾습니다

풀이

정보

  • mktmp는 /tmp/에, temp는 지정한 위치에 임시 파일을 만든다
  • -d 옵션으로 디렉토리를 임시로 만들 수 있다
# mktemp -d로 임시폴더를 만들고 거기서 진행
git clone ssh://bandit28-git@localhost:2220/home/bandit28-git/repo

md파일을 찍어보면

#README.md
# Bandit Notes
Some notes for level29 of bandit.

## credentials

- username: bandit29
- password: xxxxxxxxxx

password가 xxxxxxx로 나온다
순진한 나는 진짜 비번인줄 알고 해봤는데 당연히 아니다.

git log로 커밋을 보면, 총 3개의 커밋이 나온다
여기서 가장 최신의 커밋을 보면 (git show[commit])

bandit28@bandit:/tmp/tmp.0VgASmd1lU/repo$ git show 5f45cfaca938393c7706fec16ab1ca627e947f64
commit 5f45cfaca938393c7706fec16ab1ca627e947f64 (HEAD -> master, origin/master, origin/HEAD)
Author: Morla Porla <morla@overthewire.org>
Date:   Sat Dec 3 08:14:06 2022 +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

이렇게 변경되기 전 파일을 볼 수 있다.

?!

솔직히 이건 하면서 좀 소름돋았다
지금까지 장고등을 하면서 계속 커밋하다가 마지막에만 비밀번호나 secret key를 지웠는데...
물론 누가 내걸 가져가봤자 도움되는건 없겠지만 ㅋㅋㅋㅋ

tQKvmcwNYcFS6vmPHIUSI3ShmsrQZK8S

0개의 댓글