登录  /  注册
请问要触发这个file_get_content 给一下解题思路也好....
Gsmile10
Gsmile10 2021-03-21 09:45:02
[PHP讨论组]

<?php

highlight_file(__FILE__);

error_reporting(0);

class Game{

    public  $username;

    public  $password;

    public  $choice;

    public  $register;

    public  $file;

    public  $filename;

    public  $content;

    

    public function __construct()

    {

        $this->username='user';

        $this->password='user';

    }

    public function __wakeup(){

        if(($this->register)==="admin"){

            $this->choice=new login($this->file,$this->filename,$this->content);

        }else{

            $this->choice = new register();

        }

    }

    public function __destruct() {

        $this->choice->checking($this->username,$this->password);

    }

}

class login{

    public $file;

    public $filename;

    public $content;

    public function __construct($file,$filename,$content)

    {

        $this->file=$file;

        $this->filename=$filename;

        $this->content=$content;

    }

    public function checking($username,$password)

    {

        if($username==='admin'&&$password==='admin'){

            $this->file->open($this->filename,$this->content);

            die('login success you can to open shell file!');

        }

    }

}

class register{

    public function checking($username,$password)

    {

        if($username==='admin'&&$password==='admin'){

            die('success register admin');

        }else{

            die('please register admin ');

        }

    }

}

class Open{

    function open($filename, $content){

        echo file_get_contents($filename);

    }

}

@unserialize(base64_decode($_POST['unser']));

}

这是老师发的一个题目,因为PHP学习还没有那么深入,所以希望能有一个解题思路

Gsmile10
Gsmile10

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2024 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号