티스토리 뷰
id : bandit15
password : jN2kgmIXJ6fShzhT2avhotn4Zcka6tnt
(2023.05 기준)
ssl 암호화를 이용해서 localhost 30001번 포트로 현재 패스워드를 제출하면
다음 레벨로의 패스워드를 얻을 수 있다고 합니다.
이번 문제는 openssl 을 공부하고 풀어봅시다.

로그인하면 홈디렉토리에서 bandit14 패스워드를 확인할 수 있습니다.
지난 단계에서 제출한 값과 맞는지 비교하는데 사용되었겠죠
헤깔리지 말고 bandit15 의 패스워드 부터 확인해둡니다.


openssl --help 를 살펴보니 다양한 서브 커맨드 들을 지원하는게 눈에 띕니다.
우리가 이용해야할 서브커맨드는 s_client 입니다.
리눅스에서 우리가 사용할 openssl 명령은
ssl 통신을 제공하는 openssl 라이브러리의 커맨드라인 툴입니다.
s_client 서브커맨드는 일반적인 ssl 통신의 client 기능을 구현해줍니다.

openssl s_client 의 help 를 살펴봅니다.
사용법은 대충 나와있는데 우리는 -connect 옵션을 사용해야 합니다.

문제에서 제시한 바와 같이 localhost:30001 로 openssl 접속을 시도합니다.



서버 인증서 정보, 서버 공개키, ssl 세션 아이디 등을 확인할 수 있습니다.
openssl 은 아직 열려있는 상태입니다. 여기에 현재 패스워드를 입력해서 제출하면
바로 정답을 획득할 수 있습니다.

사실 이 문제의 의도는 openssl 연결 후 아래 메세지가 발생하면
"HEARTBEATING
read R BLOCK"
-ign_eof 옵션을 사용해서 해결하라는 건데
문제초기의 openssl 버전이 1.0.1f 때는 문제가 유효했지만
패치이후 3.0.2 버전에서는 -ign_eof 옵션을 사용하지 않아도 키값 제출이 됩니다.

이전 버전의 해결은 여기를 참고해보세요
'수업 노트 > bandit' 카테고리의 다른 글
[lesson17] bandit level 17 → 18 (0) | 2021.09.28 |
---|---|
[lesson16] bandit level 16 → 17 (0) | 2021.09.21 |
[lesson14] bandit level 14 → 15 (1) | 2021.09.18 |
[lesson13] bandit level 13 → 14 (1) | 2021.09.05 |
[lesson12] bandit level 12 → 13 (0) | 2021.09.05 |
- Total
- Today
- Yesterday
- OverTheWire
- nc
- natas7
- solution
- java
- X32
- Linux
- HTTPS
- gz
- tar
- find
- 풀이
- grep
- over the wire
- Bandit
- 리터럴
- 웹보안공부
- Encode
- 압축파일
- SSL
- 32bit
- ssh
- Natas
- BASE64
- 웹보안
- Strings
- tr
- bz2
- 리눅스
- OpenSSL
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |