Could you please give me some ideas on how to trigger this file_get_content....
Gsmile10
Gsmile10 2021-03-21 09:45:02
0
1
1178

<?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']));

}

This is a question sent by the teacher, because the PHP learning is not that in-depth, so I hope it can There is an idea to solve the problem

Gsmile10
Gsmile10

reply all(1)
欧阳

The question is not detailed enough.

The file_get_contents() function reads the entire file into a string.

This can capture data, but now curl has better functions.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template