无趣的浅 2022-06-06 16:46 采纳率: 50%
浏览 78
已结题

一个CTF Web。pop链问题

一个CTF Web。pop链问题

<?php

class Setting
{
    public $find;
    function __construct($b) {
        $this->find = $b;
    }
    function __call($name,$arguments)
    {
        echo "WWW".PHP_EOL;
        ($this->find)();
    }
}

class Middle
{
    public $follow;
    function __destruct()
    {
        echo $this->follow."Hello World\n";
        if(preg_match("/cat|nl|tac|system|passthru|flag|\\|\`|bin|sh|\.\./i", $this->follow)) {
            echo "hacker".PHP_EOL;
            $this->follow = "index.php";
        }
    }
    function __invoke()
    {
        $this->follow->hackme();
    }
}

class Code {
    public $ClassObj;
    function __construct($m) {
        $this->ClassObj = $m;
    }

    function __toString()
    {
        $this->ClassObj->action1();
    }
}

class Common {

    public function createPut($file = null,$tpl=null){
        $file = $this->cacheFile;
        $tpl = $this->temp;
        file_put_contents($file,$tpl);
    }
    function action() {
        echo "just pop";
    }
}

class Flag
{
    public function output()
    {
        $this->tilte = 'ComeOn';
        $this->content = 'Cat the Flag!!!'.PHP_EOL;
        echo $this->tilte." ".$this->content;
    }
    public $a;
    public $b;

    public function hackme()
    {
        $this->output();
        $a=$this->b;
        $a('',$this->a);
    }
}

if(isset($_GET['pop'])) {
    unserialize($_GET['pop']);
} else {
    highlight_file(__FILE__);
}
?>

  • 写回答

0条回答 默认 最新

    报告相同问题?

    问题事件

    • 已结题 (查看结题原因) 6月6日
    • 创建了问题 6月6日

    悬赏问题

    • ¥20 关于web前端如何播放二次加密m3u8视频的问题
    • ¥20 spring boot集成mqtt的使用问题
    • ¥15 使用百度地图api 位置函数报错?
    • ¥15 metamask如何添加TRON自定义网络
    • ¥66 关于川崎机器人调速问题
    • ¥15 winFrom界面无法打开
    • ¥30 crossover21 ARM64版本安装软件问题
    • ¥15 mymetaobjecthandler没有进入
    • ¥15 mmo能不能做客户端怪物
    • ¥15 osm下载到arcgis出错