bugku welcome to bugkuctf
查看页面,分析源码。user不为空且要以文件方式读入字符串"welcome to the bugkuctf"
利用上次学习的php伪协议,
这里引用两个博客:
https://www.cnblogs.com/Pinging/p/8278168.html
https://blog.csdn.net/wy_97/article/details/77431111
构造代码访问
得到hint.php源码
<?php
class Flag{
//flag.php
public $file;
public function __tostring(){
if(isset($this->file)){
echo file_get_contents($this->file);
echo "<br>";
return ("good");