보안을 그리다, 훈이

[MISC] 써니나타스(SuNiNaTaS) 13번 문제 Write Up 본문

Security/Wargame

[MISC] 써니나타스(SuNiNaTaS) 13번 문제 Write Up

HooNeee 2021. 11. 25. 21:18

 

MISC 분야 써니나타스(SuNiNaTaS) 13번 문제 풀이입니다.

 

 

Game 13

 

suninatas.com

 

[SuNiNaTaS] Challenge 13

 

문제를 보니 'KEY Finding'이라는 문구만 제시되어 있었다.

 

KEY를 찾는 문제일거라 유추해보고 페이지 소스코드를 확인해 보았다.

 

<!DOCTYPE html> 
<html> 
<head> 
<title>Game 13</title> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
<link rel="shortcut icon" href="/static/img/game.ico" /> 
</head> 
<!-- Hint : 프로그래머의 잘못된 소스백업 습관 --> 
<!-- Hint : The programmer's bad habit of backup source codes --> 
<body> 
<table width="100%" cellpadding="0" cellspacing="0"> 
<tr> 
<td align="center"> 
<table width="1000" cellpadding="0" cellspacing="0"> 
<tr height="20"> 
<td width="100%" bgcolor="000000" align="right"> 
<input type="button" name="main_btn" value="main" class="btn_check" style="width: 60" onclick="location.href = '/'">&nbsp<input type="button" name="main_btn" value="Back" class="btn_check" style="width: 60" onclick="history.back()"></td> 
</tr> 
<tr height="500"> 
<td bgcolor="000000" style="line-height: 15" align="center"><font color="white" size="10"><b>KEY Finding</b></font></td> 
</tr> 
</table> 
</td> 
</tr> 
</table> 
</body> 
</html>

 

대놓고 프로그래머의 잘못된 소스백업 습관이 힌트라고 주석처리된 부분에서 제시해 주었다.

 

어떤 습관이 있을까 고민해보다가 문제 URL http://suninatas.com/challenge/web13/web13.asp에서 asp를 빼고 zip을 추가한 http://suninatas.com/challenge/web13/web13.zip에 접속하게 되었다.

 

곧바로 압축파일 'web13.zip'이 다운로드되었고 열어보니,

 

web13.zip Password

 

위와 같이 password가 걸려있었다.

 

크랙을 위해 John The Ripper(JTR)를 사용하였다.

 


 

먼저, 다운받은 'web13.zip' 파일의 password에 대한 hash 값을 구하기 위해 terminal에 다음 명령어를 입력하였다.

 

> ./zip2john ~/desktop/web13.zip > ./hash1.txt

 

[Password Crack] ./zip2john ~/desktop/web13.zip &amp;amp;amp;gt; ./hash1.txt

 

다음으로, hash 값을 기반으로 파일의 password를 구하기 위해 john 명령어를 사용하였다.

 

> ./john hash1.txt

 

[Password Crack] ./john hash1.txt

 

'web13.zip'의 password가 7642라고 친절하게 알려준다.

 

이렇게 크랙한 password를 이용하여 압축을 풀 수 있었다.

 

Unzip 'web13'

 

텍스트파일 내용을 확인해보니 '4개의 이미지를 합하여 key를 구하시오'라고 나와있다.

 

별 의미 없는 jpg 파일인 것 같으니 hex 값을 살펴보자.

 

'whitehack1.jpg' Hex

 

첫 번째 파일인 'whitehack1.jpg'의 Hex에서 'first key : 3nda192n'라는 값이 주어진다.

 

이와 같은 방법으로 4개의 파일에 담긴 key 값을 나열해보자.

 


 

[whitehack1.jpg]
first key : 3nda192n

[whitehack2.jpg]
second key : 84ed1cae

[whitehack3.jpg]
third key: 8abg9295

[whitehack4.jpg]
fourth key : cf9eda4d

 


 

4개의 key를 모두 합치면 3nda192n84ed1cae8abg9295cf9eda4d가 된다.

 

이 값을 AUTH 페이지에서 인증하면 클리어하게 된다.

 

Comments