-
LOS succubusWebHacking/Load Of Sql Injection 2018. 2. 15. 04:30123456789101112131415<?phpinclude "./config.php";login_chk();dbconnect();if(preg_match('/prob|_|\.|\(\)/i', $_GET[id])) exit("No Hack ~_~");if(preg_match('/prob|_|\.|\(\)/i', $_GET[pw])) exit("No Hack ~_~");if(preg_match('/\'/i', $_GET[id])) exit("HeHe");if(preg_match('/\'/i', $_GET[pw])) exit("HeHe");$query = "select id from prob_succubus where id='{$_GET[id]}' and pw='{$_GET[pw]}'";echo "<hr>query : <strong>{$query}</strong><hr><br>";$result = @mysql_fetch_array(mysql_query($query));if($result['id']) solve("succubus");highlight_file(__FILE__);?>
cs 이번에는 '를 preg_match로 막았다.
\를 이용하여서 문제를풀수있다.
python에서도 그렇듯이 print 'I 'm hack'을 하게되면 오류가난다. 가운데 문자열안에 i'm에서 '부분때문이다.
오류를 해결하기위해서는 i\'m hack으로 고치면 '를 문자열로 인식하고 정상적으로 출력이된다.
'WebHacking > Load Of Sql Injection' 카테고리의 다른 글
LOS navis (0) 2018.02.15 LOS nightmare (0) 2018.02.15 LOS zombie_assassin (0) 2018.02.15 LOS assassin (0) 2018.02.15 LOS giant (0) 2018.02.15