[Level 07]Lord of SQL injection – orge

Lord of SQL injection – orge Level 07 Source Code <?php include “../config.php”; login_chk(); dbconnect(); if(preg_match(‘/prob|_|\.|\(\)/i’, $_GET[pw])) exit(“No Hack ~_~”); if(preg_match(‘/or|and/i’, $_GET[pw])) exit(“HeHe”); $query = “select id from prob_orge where id=’guest’ and pw='{$_GET[pw]}'”; echo “<hr>query : <strong>{$query}</strong><hr><br>”; $result = @mysql_fetch_array(mysql_query($query)); if($result[‘id’]) echo “<h2>Hello {$result[id]}</h2>”; $_GET[pw] = addslashes($_GET[pw]); $query = “select pw from prob_orge where id=’admin’ …

[Level 06]Lord of SQL injection – darkelf

Lord of SQL injection – darkelf Level 06 Source Code <?php include “../config.php”; login_chk(); dbconnect(); if(preg_match(‘/prob|_|\.|\(\)/i’, $_GET[pw])) exit(“No Hack ~_~”); if(preg_match(‘/or|and/i’, $_GET[pw])) exit(“HeHe”); $query = “select id from prob_darkelf where id=’guest’ and pw='{$_GET[pw]}'”; echo “<hr>query : <strong>{$query}</strong><hr><br>”; $result = @mysql_fetch_array(mysql_query($query)); if($result[‘id’]) echo “<h2>Hello {$result[id]}</h2>”; if($result[‘id’] == ‘admin’) solve(“darkelf”); highlight_file(__FILE__); ?> Analyse http://los.sandbox.cash/darkelf-~~.php?pw=123 이라고 입력하게 되면 …

[Level 05]Lord of SQL injection – wolfman

Lord of SQL injection – wolfman Level 05 Source Code <?php include “../config.php”; login_chk(); dbconnect(); if(preg_match(‘/prob|_|\.|\(\)/i’, $_GET[pw])) exit(“No Hack ~_~”); if(preg_match(‘/ /i’, $_GET[pw])) exit(“No whitespace ~_~”); $query = “select id from prob_wolfman where id=’guest’ and pw='{$_GET[pw]}'”; echo “<hr>query : <strong>{$query}</strong><hr><br>”; $result = @mysql_fetch_array(mysql_query($query)); if($result[‘id’]) echo “<h2>Hello {$result[id]}</h2>”; if($result[‘id’] == ‘admin’) solve(“wolfman”); highlight_file(__FILE__); ?> Analyse http://los.sandbox.cash/wolfman-~~.php?pw=123 …

[Level 04]Lord of SQL injection – orc

들어가기전에 Bilnd  SQL injection을 먼저 알고 가자 Lord of SQL injection – orc Level 04 Source Code <?php    include “../config.php”;    login_chk();    dbconnect();    if(preg_match(‘/prob|_|\.|\(\)/i’, $_GET[pw])) exit(“No Hack ~_~”);    $query = “select id from prob_orc where id=’admin’ and pw='{$_GET[pw]}'”;    echo “<hr>query : <strong>{$query}</strong><hr><br>”;    $result = @mysql_fetch_array(mysql_query($query));    if($result[‘id’]) echo “<h2>Hello admin</h2>”;        $_GET[pw] = addslashes($_GET[pw]);    $query = “select pw from prob_orc where id=’admin’ and pw='{$_GET[pw]}'”;    $result = @mysql_fetch_array(mysql_query($query));    if(($result[‘pw’]) && ($result[‘pw’] == $_GET[‘pw’])) solve(“orc”);    highlight_file(__FILE__);  ?> Analyse http://los.sandbox.cash/orc-~~.php?pw=123 이라고 입력하게 되면 select id from prob_orc where id=’admin’ and pw=’123′ 과 같이 MySQL 쿼리문이 입력된 뒤에 만약 쿼리가 참이라면 “Hello admin”을 …

[Level 03] Lord of SQL injection – goblin

Lord of SQL injection – goblin Level 03 Source Code <?php include “../config.php”; login_chk(); dbconnect(); if(preg_match(‘/prob|_|\.|\(\)/i’, $_GET[no])) exit(“No Hack ~_~”); if(preg_match(‘/\’|\”|\`/i’, $_GET[no])) exit(“No Quotes ~_~”); $query = “select id from prob_goblin where id=’guest’ and no={$_GET[no]}”; echo “<hr>query : <strong>{$query}</strong><hr><br>”; $result = @mysql_fetch_array(mysql_query($query)); if($result[‘id’]) echo “<h2>Hello {$result[id]}</h2>”; if($result[‘id’] == ‘admin’) solve(“goblin”); highlight_file(__FILE__); ?> Analyse http://los.sandbox.cash/goblin-~~.php?no=123 이라고 …

[Level 02] Lord of SQL injection – cobolt

Lord of SQL injection – cobolt Level 02 Source Code <?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__); …

[Level 01] Lord of SQL injection – gremlin

들어가기 전에 $_GET을 이용한 파라미터 전달 방법에 대한 글을 보고 오자. Lord of SQL injection – gremlin Level 01 Source Code   <?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 …