zoukankan      html  css  js  c++  java
  • BUGKU的flag.php

    首先我们分析题目,.php一定是涉及到php源码的知识

    提示有2点,一个是为啥点login没反应,一个是hint,第一点让我尝试将button改为submit,提交后暴力破解

     结果我想多了,似乎与数据库没啥关系,然后看wp提交hint参数得到源码

    <?php
    error_reporting(0);
    include_once("flag.php");
    $cookie $_COOKIE['ISecer'];
    if(isset($_GET['hint'])){
        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
    }
    $KEY='ISecer:www.isecer.com';
    ?>

    通过对源码的分析,可知服务器接收到Cookie的ISecer值进行反序列化,需要等于KEY的值,源码最后一行定义了KEY,这个KEY值没有在前面的php代码中定义,所以此时的KEY值还是为空。NULL值序列化得到s:0:"";得到

  • 相关阅读:
    1.GoldenEye
    centos系统安装问题 dracut-initqueue timeout
    pycharm2019永久激活
    webshell不同马文件分类
    frp内网穿透工具
    永久关闭windows defender
    Apache Tomcat 远程代码执行漏洞(CVE-2019-0232)漏洞复现
    python 基础(三)
    bugku-web(头等舱)
    bugku-web(变量1)
  • 原文地址:https://www.cnblogs.com/jiluxuexi/p/12656715.html
Copyright © 2011-2022 走看看