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

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条回答 默认 最新

  • 冲不动了啊啊啊 2022-06-19 16:42
    关注

    你标记的那段应该是要构造创造函数,进行命令执行

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

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

悬赏问题

  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改
  • ¥20 wireshark抓不到vlan
  • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真
  • ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持
  • ¥15 stata安慰剂检验作图但是真实值不出现在图上