无趣的浅 2022-06-19 01:40 采纳率: 50%
浏览 85
已结题

50一个CTF的入门级别的题,都没人能做吗?

-该目录下还有一个flag.php文件,但是是不可见的PHP
,希望有接触CTF的人解答,解决即采纳


代码如下
<?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__);
}
?>
看不懂这个
```php
 
 public function hackme()
    {
        $this->output();
        $a=$this->b;
        $a('',$this->a);
    }
  • 写回答

1条回答 默认 最新

      报告相同问题?

      相关推荐 更多相似问题

      问题事件

      • 系统已结题 6月27日
      • 已采纳回答 6月19日
      • 修改了问题 6月19日
      • 赞助了问题酬金20元 6月19日
      • 展开全部

      悬赏问题

      • ¥20 ROS中的TEB局部规划问题
      • ¥20 关于#matlab#的问题:要求测出上面图片中所有同心圆的半径
      • ¥20 epanet软件运行问题
      • ¥15 Python 文件读取
      • ¥60 dpabi进行Alff计算时脑池有干扰信号
      • ¥15 利用kmeans或kshape聚类分析对归一化的无量纲时间-降雨序列进行聚类
      • ¥15 protel99.SE提示一下弹窗
      • ¥15 银河麒麟v10 执行.run失败如何解决
      • ¥15 如何用Python打开LA文件
      • ¥15 用mysql做一个酒店管理系统