bugku web flag.php

题目链接

网页里面是一个登录框,输入账号密码点login什么反应都没有,用bp抓包也没发现什么。

返回题目列表,看到提示是hint。

尝试把题目链接中的flagphp改成hintphp还有在url后面加上hint.php都无果。

看了大佬们的writeup才发现应该用get传值……

http://123.206.87.240:8002/flagphp/?hint=1

发现一段源码。

  1 <?php
  2 error_reporting(0);
  3 include_once("flag.php");
  4 $cookie = $_COOKIE['ISecer'];
  5 if(isset($_GET['hint'])){
  6     show_source(__FILE__);
  7 }
  8 elseif (unserialize($cookie) === "$KEY")
  9 {
 10     echo "$flag";
 11 }
 12 else {
 13 ?>
 14 <html>
 15 <head>
 16 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 17 <title>Login</title>
 18 <link rel="stylesheet" href="admin.css" type="text/css">
 19 </head>
 20 <body>
 21 <br>
 22 <div class="container" align="center">
 23   <form method="POST" action="#">
 24     <p><input name="user" type="text" placeholder="Username"></p>
 25     <p><input name="password" type="password" placeholder="Password"></p>
 26     <p><input value="Login" type="button"/></p>
 27   </form>
 28 </div>
 29 </body>
 30 </html>
 31 
 32 <?php
 33 }
 34 $KEY='ISecer:www.isecer.com';
 35 ?>
View Code

bp抓包加上””序列化的结果就行了。

{B3763BAA-3C0A-4532-BE67-FF0D5D37E908}.png

猜你喜欢

转载自www.cnblogs.com/truthilia-12580/p/12296880.html