(los[Lord of SQLinjection]) COBOLT

2020. 4. 23. 00:06Lord of SQLinjection


query : select id from prob_cobolt where id='' or 1=1 ' 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__); 
?>