교내대회 Old school whitebox
<?php error_reporting(0); require_once ‘config.php’; if(isset($_GET[‘username’], $_GET[‘password’])) { $username = addslashes($_GET[‘username’]); $password = password($_GET[‘password’]); $username = mb_convert_encoding($username ,’utf-8′,’euc-kr’); if(preg_match(‘/union.*select/i’, $username)) { die(‘<h3>(つ゚⊿゚)つ Hey Nope!</h3>’); } $conn = mysqli_connect(__HOST__, __USER__, __PASS__, __NAME__) or die(‘server down’); $query = “SELECT * FROM `users` WHERE `username`='{$username}’ AND `password`='{$password}’;”; $result = mysqli_query($conn, $query); if($fetch = mysqli_fetch_assoc($result)) { echo ‘<h3>(๑→ܫ←) Hello, ‘.$fetch[‘username’].'</h3>’; […]
Read More