[OverTheWire] bandit 29 -> 30

2025. 12. 12. 22:17·bandit

There is a git repository at ssh://bandit29-git@bandit.labs.overthewire.org/home/bandit29-git/repo via the port 2220. 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.

 

hint: git

 

사용한 명령어

  • git
  • clone
  • log
  • branch : 작업 목록 보기
    • -v: 로컬 branch의 정보를 마지막 커밋 내역과 함께 보여줌 
    • -r: 원격 저장소의 branch 정보를 보여줌
    • -a: 로컬/ 원격 branch 정보 모두 보여줌
  • checkout: 특정 branch(작업 목록)로 전환 시켜줌

 

저번 문제와 같이 처음은 git clone으로 시작하니까 빠르게 clone 하고 README.md 읽어봅시다

┌──(miso㉿Miso)-[~]
└─$ git clone ssh://bandit29-git@bandit.labs.overthewire.org:2220/home/bandit29-git/repo

┌──(miso㉿Miso)-[~]
└─$ ls
bandit26.sshkey  repo

┌──(miso㉿Miso)-[~]
└─$ cd repo/

┌──(miso㉿Miso)-[~/repo]
└─$ ls -al
total 16
drwxr-xr-x 3 miso miso 4096 Dec 12 20:09 .
drwx------ 7 miso miso 4096 Dec 12 20:17 ..
drwxr-xr-x 7 miso miso 4096 Dec 12 20:09 .git
-rw-r--r-- 1 miso miso  131 Dec 12 20:09 README.md

┌──(miso㉿Miso)-[~/repo]
└─$ cat README.md
# Bandit Notes
Some notes for bandit30 of bandit.

## credentials

- username: bandit30
- password: <no passwords in production!>

 

 

 

password가 써진적이 없다는 것 같은데, 우선 git log를 봐봅시다

┌──(miso㉿Miso)-[~/repo]
└─$ git log README.md
commit b879c94bd4641ebb8b5470258b3a41debb25f7c2 (HEAD -> master, origin/master, origin/HEAD)
Author: Ben Dover <noone@overthewire.org>
Date:   Tue Oct 14 09:26:20 2025 +0000

    fix username

commit 358fb1e671f460043ff5bd372e8d87e228dc148d
Author: Ben Dover <noone@overthewire.org>
Date:   Tue Oct 14 09:26:20 2025 +0000

    initial commit of README.md
  
  
  
┌──(miso㉿Miso)-[~/repo]
└─$ git show 358fb1e671f460043ff5bd372e8d87e228dc148d
commit 358fb1e671f460043ff5bd372e8d87e228dc148d
Author: Ben Dover <noone@overthewire.org>
Date:   Tue Oct 14 09:26:20 2025 +0000

    initial commit of README.md

diff --git a/README.md b/README.md
new file mode 100644
index 0000000..2da2f39
--- /dev/null
+++ b/README.md
@@ -0,0 +1,8 @@
+# Bandit Notes
+Some notes for bandit30 of bandit.
+
+## credentials
+
+- username: bandit29
+- password: <no passwords in production!>
+

 

358fb commit은 README.md파일의 최초의 commit이라네요. b879c 커밋은 username fix.

생성됐던 파일이 삭제된 것도 아니고, 그냥 진짜 처음 생성한 파일이라고 쓰여져 있네요

(index 00000000..2da2f39라고 쓰여있는걸 보면 000000으로 無 상태였다가 2da2f39인 有 상태로 바뀐거랍니다)

 

 

git log 로는 얻을 수 있는 것이 없었고, git의 작업 목록을 확인해보도록 하겠습니다.

작업 목록을 보기 위해서는 branch라는 명령어가 필요합니다.

옵션을 써서 구체적인 branch 상태를 확인해봤습니다.

┌──(miso㉿Miso)-[~/repo]
└─$ git branch
  dev
* master

┌──(miso㉿Miso)-[~/repo]
└─$ git branch -a
  dev
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/dev
  remotes/origin/master
  remotes/origin/sploits-dev

 

 

지금 현재 우리는 remotes/origin/HEAD 작업 장소에 있어요 근데 여기에는 password를 확인할 수 없었죠? 그래서 dev로 작업 장소를 변경해봅시다.

┌──(miso㉿Miso)-[~/repo]
└─$ git branch -a
  dev
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/dev
  remotes/origin/master
  remotes/origin/sploits-dev

┌──(miso㉿Miso)-[~/repo]
└─$ git checkout dev
Switched to branch 'dev'
Your branch is up to date with 'origin/dev'.

┌──(miso㉿Miso)-[~/repo]
└─$ ls -al
total 20
drwxr-xr-x 4 miso miso 4096 Dec 12 22:12 .
drwx------ 7 miso miso 4096 Dec 12 22:04 ..
drwxr-xr-x 2 miso miso 4096 Dec 12 22:12 code
drwxr-xr-x 7 miso miso 4096 Dec 12 22:12 .git
-rw-r--r-- 1 miso miso  134 Dec 12 22:12 README.md

dev로 switch 됐다고 뜨고 list를 확인해보니 code 디렉토리도 있고 README.md파일도 있네요

 

 

읽어보면

┌──(miso㉿Miso)-[~/repo]
└─$ cat README.md
# Bandit Notes
Some notes for bandit30 of bandit.

## credentials

- username: bandit30
- password: qp30ex3VLz5MDG1n91YowTv4Q8l7CDZL

 

Wow 신기방기

 

branch는 작업 부서 별로 진행하는 코드들이 다를텐데 이 과정에서 서로 부딪히지 않기 위해서 만들어진 장치라고 하네요. 

'bandit' 카테고리의 다른 글

[OverTheWire] bandit 31 -> 32  (0) 2025.12.13
[OverTheWire] bandit 30 -> 31  (0) 2025.12.13
[OverTheWire] bandit 28 -> 29  (0) 2025.12.11
[OverTheWire] bandit27 -> 28  (0) 2025.12.10
[OverTheWire] bandit 25 -> 27  (0) 2025.12.04
'bandit' 카테고리의 다른 글
  • [OverTheWire] bandit 31 -> 32
  • [OverTheWire] bandit 30 -> 31
  • [OverTheWire] bandit 28 -> 29
  • [OverTheWire] bandit27 -> 28
jokkams
jokkams
jokkams 님의 블로그 입니다.
  • jokkams
    jokkams 님의 블로그
    jokkams
  • 전체
    오늘
    어제
    • 분류 전체보기 (56)
      • 코드업 (8)
      • bandit (32)
      • 학교 (2)
      • 드림핵 (5)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    100제
    코드업
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.5
jokkams
[OverTheWire] bandit 29 -> 30
상단으로

티스토리툴바