본문 바로가기
CTF Write-UP/overthewire.org (완료)

Bandit Level 25 → Level 26

by CPU 2021. 12. 14.

Bandit25 문제

Bandit25 문제풀이

 

디렉터리에는 bandit26.sshkey 파일이 있다. rsa private 키라는것을 확인 하였고 

이파일로 bandit26에 접속하면 연결이 바로 끊어진다.

 

--[ More information ]--

  For more information regarding individual wargames, visit
  http://www.overthewire.org/wargames/

  For support, questions or comments, contact us through IRC on
  irc.overthewire.org #wargames.

  Enjoy your stay!

  _                     _ _ _   ___   __
 | |                   | (_) | |__ \ / /
 | |__   __ _ _ __   __| |_| |_   ) / /_
 | '_ \ / _` | '_ \ / _` | | __| / / '_ \
 | |_) | (_| | | | | (_| | | |_ / /| (_) |
 |_.__/ \__,_|_| |_|\__,_|_|\__|____\___/
Connection to localhost closed.

사용정보를 확인하기 위해 /etc/passwd을 확인한 결과

bandit26에서만 /usr/bin/showtext를 사용하고 있었다.

/usr/bin/showtext 파일을 열어보게 되면 more 명령어를 실행하고 바로 종료하도록 코드를 만들어 놨다.

#!/bin/sh

export TERM=linux

more ~/text.txt
exit 0

창을 작게 만들고 bandit26 계정으로 접속을 하게되면 more 명령어가 실행된것을 볼수 있다

명령어가 실행중일때 v를 입력하면 vi가 실행된다.

 

vi가 실행되면 :e /etc/bandit_pass/bandit26 입력하게되면 패스워드를 확인할수가 있다.

더보기

5czgV9L3Xx8JPOyRbXh6lQbmIOWvPT6Z

 

추가적으로 다음과 같은 명령어를 입력하여 쉘을 지정해준다.

:set shell=/bin/bash
:shell
[No write since last change]
bandit26@bandit:~$

 

bandit26으로 접속된것을 확인할수가 있다.

'CTF Write-UP > overthewire.org (완료)' 카테고리의 다른 글

Bandit Level 27 → Level 28  (0) 2021.12.18
Bandit Level 26 → Level 27  (0) 2021.12.17
Bandit Level 24 → Level 25  (0) 2021.12.13
Bandit Level 23 → Level 24  (0) 2021.11.09
Bandit Level 22 → Level 23  (0) 2021.11.03

댓글