Bugku-web35(序列化)

发布时间 2023-08-30 09:04:03作者: KAKSKY

images

访问css样式之后得到提示:

images

images
扒下代码::

<?php
error_reporting(0);
$KEY='ctf.bugku.com';
include_once("flag.php");
$cookie = $_COOKIE['BUGKU'];
if(isset($_GET['20260'])){
    show_source(__FILE__);
}
elseif (unserialize($cookie) === "$KEY")
{   
    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
}
?>

看了评论只是说是和序列化相关的题目:

题目要求的是反序列化后的cookie的值和它定义的key值要相等

本地测试一下:

images
构造payload:

cookie:BUGKU=s:13:"ctf.bugku.com";

images