Low级别:
没有对上传文件类型进行任何限制,直接上传一个php,<? eval($REQUEST['a']); ?>

上传成功后,还告知了我们路径,直接拼接起来访问执行个phpinfo试试看。

Medium级别:
我们再上传个php试试看,上传失败提示:
Your image was not uploaded. We can only accept JPEG or PNG images.对上传文件进行了限制,只能上传jpeg或者png类型的文件了。直接burp suite拦截,然后选php文件上传,把burp suite拦截下来的数据,Content-Type: application/x-php这一条改成
Content-Type: image/jpeg

还有一种方法就是00截断,但是只能php版本小于5.3.4才能实现,这边就不复现了。
High级别:
只能上传一个图片一句话,写一个php一句话保存为1.php,然后选一张小一点的图片保存为1.png
windows使用命令copy 1.png/b+1.php 2.png,然后该目录会生成一个2.png的图片一句话,直接上传即可。
但是图片一句话并不能直接解析成php执行,需要有解析漏洞或者文件包含漏洞。
DVWA是存在文件包含漏洞的,直接利用文件包含漏洞 包含2.png即可。

发表评论