
익숙한 검은 화면이네요 바로 소스보기를 눌러보겠습니다.
<?php
include "../../config.php";
if($_GET['view_source']) view_source();
?><html>
<head>
<title>Challenge 26</title>
<style type="text/css">
body { background:black; color:white; font-size:10pt; }
a { color:lightgreen; }
</style>
</head>
<body>
<?php
if(preg_match("/admin/",$_GET['id'])) { echo"no!"; exit(); }
$_GET['id'] = urldecode($_GET['id']);
if($_GET['id'] == "admin"){
solve(26);
}
?>
<br><br>
<a href=?view_source=1>view-source</a>
</body>
</html>
요약해보자면 GET방식으로 'id'를 입력했을 때, 그 id가 admin일때 문제가 해결된다고합니다.
단 id 파라미터에 admin이라는 문자열이 포함되어있다면 no!를 출력하고 실행을 중지합니다.
그럼 어떻게 admin을 입력하지 하던중..
$_GET['id'] = urldecode($_GET['id']);
힌트를 주는 코드를 발견했습니다.
GET방식으로 입력받은게 URL디코딩된다고 합니다. 즉 URL인코딩을 하여 우회를 할 수 있다는 뜻입니다.
'admin'이라는 문자열을 URL인코딩하여 GET방식으로 전달하면 문제가 해결 될것 같습니다.


a만 인코딩후 입력해보니 한번 디코딩이 되서 URL창에 뜨는걸 알 수 있습니다.
그럼 인코딩을 두번 해보면 어떨까? 해서 %까지 인코딩 해보았습니다.


해결 완료!
'보안 > 워게임 (웹 해킹)' 카테고리의 다른 글
| Challenge - old-24 write up (0) | 2025.03.24 |
|---|---|
| Challenge - old-18 write up (0) | 2025.03.19 |
| Challenge - old-16 write up (0) | 2025.03.17 |
| Challenge - old-6 write up (0) | 2025.03.13 |
| Challenge - old-15 write up (0) | 2025.03.13 |