24.12.31 뜻깊은 해킹입문 마무리
실력있는 분들이 bandit 자세히 잘 설명해 주어서 부담없이 문제를 풀수 있었다.
24.12.31 뜻깊은 해킹입문 마무리
실력있는 분들이 bandit 자세히 잘 설명해 주어서 부담없이 문제를 풀수 있었다.
[1] >> 셀이 뜬다
[
[2] >> $0
$
[3] $ bash
[4] bandit33@bandit:~$ ls -al
[6] bandit33@bandit:~$ cat /etc/bandit_pass/bandit33
bandit33 비밀번호
[1] bandit31@bandit:~$ mkdir /tmp/band32
[2] bandit31@bandit:~$ cd /tmp/band32
[3] bandit31@bandit:/tmp/band32$ git clone ssh://bandit31-git@localhost:2220/home/bandit31-git/repo
[4] bandit31@bandit:/tmp/band32$ ls -al
repo 확인
[5] bandit31@bandit:/tmp/band32$ cd repo
[6] bandit31@bandit:/tmp/band32/repo$ cat README.md\
Details:
File nameL key.txt
Content: 'May I come in'
Branch: master
[7] bandit31@bandit:/tmp/band32/repo$ git branch
* master
[8] bandit31@bandit:/tmp/band32/repo$ echo "May I come in" > key.txt
[9] bandit31@bandit:/tmp/band32/repo$ ls -al
key.txt 확인
[10] bandit31@bandit:/tmp/band32/repo$ git add -f key.txt
[11] bandit31@bandit:/tmp/band32/repo$ git commit -m 'key ad'
[12] bandit31@bandit:/tmp/band32/repo$ git push origin master
[13] bandit31@bandit:/tmp/band32/repo$ git show xxxxxxxxxxxxx
bandit32비밀번호 확인됨
3O9RfhqyAlVBEZpVb6LYStshZoqoSx5K
[1] bandit30@bandit:~$ ls -al
[2] bandit30@bandit:~$ mkdir /tmp/band31
[3] bandit30@bandit:~$ cd /tmp/band31
[4] bandit30@bandit/tmp/band31$ git clone ssh://bandit30-git@localhost:2220/home/bandit30-git/repo 엔터치고
중간에 yes 누르고
마지막에 bandit30 password 복사해서 붙여넣기
[5] bandit30@bandit/tmp/band31$ ls -al
repo 파일 확인
[6] bandit30@bandit/tmp/band31$ cd repo
[7] bandit30@bandit/tmp/band31/repo$ ls -al
[8] bandit30@bandit/tmp/band31$ cat README.md
just an epmty file...
[9] bandit30@bandit/tmp/band31$ git branch -a
master 확인
[10] bandit30@bandit/tmp/band31$ git show-ref
xxxxxxxxxx refs/tags/secret 확인해 보자
[11] bandit30@bandit/tmp/band31$ git show xxxxxxxxxxx
bandit31 비밀번호 확인
[1] bandit29@bandit:~$ ls -al
파일을 확임함
bandit29@bandit:~$ mkdir /tmp/band30
bandit29@bandit:~$ cd /tmp/band30
bandit29@bandit/tmp/band30$ ls -al
파일 확인 특별한게 없다.
[2] bandit29@bandit/tmp/band30$ git clone ssh://bandit29-git@lcoalhost:2220/hom/bandit29-git /repo
[3] Yes
[4] bandit29@bandit/tmp/band30$ ls -al
repo 파일 확인
[5] bandit29@bandit/tmp/band30$ cd repo
[6] bandit29@bandit/tmp/band30/repo$ ls -al
README.md 확인됨
[7] bandit29@bandit/tmp/band30/repo$ cat README.md
# Bandit Notes
Some notes for bandit30 of bandit.
[8] bandit29@bandit/tmp/band30/repo$ git branch -a
remotes/origin/HEAD -> origin/master
dev branch 변경
[9] bandit29@bandit/tmp/band30/repo$ git chekout dev
[8] bandit29@bandit/tmp/band30/repo$ git branch -a
[9] (HEAD detached at origin/dev)
[10] bandit29@bandit/tmp/band30/repo$ git log
commit : xxxxxxxx 확인됨
[9] bandit29@bandit/tmp/band30/repo$ git show xxxxxxxxxxx
[10] bandit30 비밀번호 확인
[1] ssh://bandit28-git@localhost/home/bandit28-git/repo 에 git저장소에 있습니다. 사용자의 비밀번호는 bandit28-git사용
자와 동일합니다.
[2] bandit28@bandit:~$ mkdir /tmp/git29
[3] bandit28@banit:~$ cd /tmp/git29
[4] yes 침
[5] bandit28-git@localhost's password: bandit28 비밀번호 복사해서 붙여넣기
[6] bandit28@bandit:/tmp/git29$ ls -al
repo 파일 확인
[7] bandit28@bandit:/tmp/git29 $ cd repo
[8] bandit28@bandit:/tmp/git29 $ ls -al
README.md
[9] bandit28@bandit:/tmp/git29 $ cat README.md
- username: bandit29
- password: XXXXXX
비밀번호가 확인이 안된다.
[10] bandit28@bandit:/tmp/git29 $ git log
commit: xxxxxxxx
commit: xxxxxxxx
commit: xxxxxxxx
[11] bandit28@bandit:/tmp/git29 $ git show xxxxxxxxxx
[12] password: xxxxxxxxxx (bandit29 비밀번호 확인)
[1] 이 스토리 ssh://bandit27g-git@localhost/home/bandit27-git/repo 있습니다. 사용자의 비밀번호는 bandit27-git 사용자
와 동일하니다.
[2] bandit27@bandit:~$ git clone ssh://bandit27-git@localhost/home/bandit27-git/repo
[3] bandit27@bandit:~$ mkdir /temp/ban27
[4] bandit27@bandit:~$ cd /tmp/ban27
[5] bandit27@bandit:/tmp/ban27$ git clone ssh://bandit27-git@localhost/home/bandit27-git/repo
yes누름
[6] bandit27@bandit:/tmp/ban27$ chmod 777 /tmp/ban27
[7] bandit27-git@localhost's password: bandit27비번을 복사해서 붙여넣기 한다.
[8] bandit27@bandit:/tmp/ban27$ ls -al
repo 파일 확인
[9] bandit27@bandit:/tmp/ban27$ cd repo
[10] bandit27@bandit:/tmp/ban27/repo$ ls
README
[11] bandit27@bandit:/tmp/ban27/repo$ cat README
bandit28비밀번호 확인
[1] 쉘을 잘 구했음 이제 서룰러 bandit27의 비밀번호를 얻어라
bandit 26은 bandit25 shell에서 bandit27 비밀번호를 얻을수 있다.
[2] bandit25@bandit:~$ ssh -i bandit26.sshkey bandit26@localhost -p2220
창을 작게 만든후(5줄만 보이게) bandit25통해서 bandit26 접속하여 bandit27비번을 확인하는 과정이다.
[3] yes 엔터
[4] ---More-- 뜨면 v 입력
[5] :set shell=/bin/bash / bandit26접속 방법/
[6] :sh 입력
bandit26@bandit:~$ ./bandit27-do cat /etc/bandit_pass/bandit27
bandit27비밀번호 확인됨
[1] bandit25에서 bandit26에 고르인하는것은 꽤 쉬울 것입니다. 사용자 bandit26의 셀은 /bin/bash가 아니라
다른것입니다. 그것이 무엇인지, 어떻게 작옹하는지, 그리고 그것을 벗어나는 방법을 알아보세요.
[2] bandit25@bandit:~$ ls -al
bandit26.sshkey 파일확인
[3] bandit25@bandit:~$ cat /etc/passwd | grep bandit26
bandit26:/usr/bin/showtext 이부분을 확인한다
bandit25@bandit:~$ ls -la /usr/bin/showtext
[4] bandit25@bandit:~$ cat /usr/bin/showtext
#!/bin/sh
export TERM=linux
exec more ~/text.txt
exit 0
내용을 확인할수 있다.
[5] bandit25@bandit:~$ ssh -i ./bandtit26.sshkey bandit26@localhost -p2220
창을 작게 한 상태에서 접속을 하고
[6] 위와 같이 창이 뜨면 v를 누르고
[7] :e /etc/bandit_pass/bandit26 입력
[8] bandit26 비밀번호확인
[1] 데몬은 포토30002에서 수신 대기하고 있으며 bandit24의 비밀번호와 비밀숫자 4자리 핀코드가 주어지면
bandit25의 비밀번호를 제공합니다. 10000개의 조합을 모두 거치는 것(무차별 대입 공격이라고함)을 제외
하고 핀코드를 검색할 방법이 없습니다. 매번 새 연결을 만들 필요가 없습니다.
[2] bandit24@bandit:~$ mkdir /tmp/n25
[3] bandit24@bandit:~$ cd /tmp/n25
[4] bandit24@bandit:/tmp/n25$ cat > pincode.sh
빨강박스 입력
password24 = " 이부분은 bandit24비번 복사해서 붙이기 "
[5] bandit24@bandit:/tmp/n25$ ls -al
pincode.sh 파일 확인
[6] bandit24@bandit:/tmp/n25$./pincode.sh
bandit24@bandit:/tmp/n25$ chmod 777 pincode.sh
bandit24@bandit:/tmp/n25$ ls -al
pincode.sh 파일 초록색으로 바뀜
[7] bandit24@bandit:/tmp/n25$ ./pincode.sh
bandit24@bandit:/tmp/n25$ ls -al
pass25.txt 파일 확인
[8] bandit24@bandit:/tmp/n25$ cat pass25.txt | nc localhost 30002
아래와 같이
Wrong! Please enter the correct current password and pincode. Try again. (계속뜬다)
맨 마지막줄
The password of user bandit25 is 비빌번호 확인