HSr00t 2018. 2. 13. 19:19
1
2
3
4
5
6
7
8
9
10
11
12
13
<?php 
  include "./config.php"
  login_chk(); 
  dbconnect(); 
  if(preg_match('/prob|_|\.|\(\)/i'$_GET[no])) exit("No Hack ~_~"); 
  if(preg_match('/\'|\"|\`/i'$_GET[no])) exit("No Quotes ~_~"); 
  $query = "select id from prob_goblin where id='guest' and no={$_GET[no]}"
  echo "<hr>query : <strong>{$query}</strong><hr><br>"
  $result = @mysql_fetch_array(mysql_query($query)); 
  if($result['id']) echo "<h2>Hello {$result[id]}</h2>"
  if($result['id'== 'admin') solve("goblin");
  highlight_file(__FILE__); 
?>
cs


형변환 문제이다.

no에서 정수형을 입력받는데 flase를 만들어주면 뒤에 적은 쿼리문을 보게된다.

pw=0x41414141을 넣게되면 pw='AAAA'과 똑같다.

위와같은 방식으로 풀수있다.