WebHacking/Load Of Sql Injection
LOS wolfman
HSr00t
2018. 2. 13. 19:29
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | <?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__); ?> | cs |
쿼리문으로 id가 admin일때와 and연산자를 이용하여서 패스워드를 알아낼수있다.
파이썬 코드는 전 단계 코드에서 조금만 수정하면 된다.