해당 문제는 SQL injection 문제로, 소스 코드는 다음과 같다.
<?php
if($_GET['no']){
$db = dbconnect();
if(preg_match("/#|select|\\(| |limit|=|0x/i",$_GET['no'])) exit("no hack");
$r=mysqli_fetch_array(mysqli_query($db,"select id from chall27 where id='guest' and no=({$_GET['no']})")) or die("query error");
if($r['id']=="guest") echo("guest");
if($r['id']=="admin") solve(27); // admin's no = 2
}
?>
preg_match("/#|select|\\(| |limit|=|0x/i",$_GET['no']) 를 보면, $_GET['no']에 담긴 값이 "#", "select", "(", 공백, "limit", "=", "0x" 중 하나라도 포함되어 있는지를 대소문자 무시하고 필터링한다는 것을 알 수 있다.