old-51 -- SQLi (Binary MD5)

<?php
include "../../config.php";
if ($_GET["view_source"]) {
view_source();
}
...
<?php if ($_POST["id"] && $_POST["pw"]) {
$db = dbconnect();
$input_id = addslashes($_POST["id"]);
$input_pw = md5($_POST["pw"], true);
$result = mysqli_fetch_array(
mysqli_query(
$db,
"select id from chall51 where id='{$input_id}' and pw='{$input_pw}'"
)
);
if ($result["id"]) {
solve(51);
}
if (!$result["id"]) {
echo "<center><font color=green><h1>Wrong</h1></font></center>";
}
} ?>
...

Last updated