工具:upload-labs靶场源码一枚,Phpstudy大法一个,Burp
项目地址:https://github.com/Tj1ngwe1/upload-labs
首先先安装好靶场,有Web基础的话,我就不再说了,windows平台拿phpstudy就好了。。。
![](http://objectstorage.global.loongapi.com/loongapiSources/picbed/olddata2/2020/04/图片-93-1024x503.png)
![](http://objectstorage.global.loongapi.com/loongapiSources/picbed/olddata2/2020/04/图片-94.png)
过程
先从第一关开始:
![](http://objectstorage.global.loongapi.com/loongapiSources/picbed/olddata2/2020/04/图片-95.png)
先看到有一个上传点,尝试上传webshell
![](http://objectstorage.global.loongapi.com/loongapiSources/picbed/olddata2/2020/04/图片-96.png)
被拦截,点击查看代码,查看关键点,发现存在前端js验证
![](http://objectstorage.global.loongapi.com/loongapiSources/picbed/olddata2/2020/04/图片-97.png)
那么可以选择关闭浏览器js进行测试,这里我选择使用burp进行改包,先把webshell改成.png
![](http://objectstorage.global.loongapi.com/loongapiSources/picbed/olddata2/2020/04/图片-98.png)
上传,用burp改为php后缀
![](http://objectstorage.global.loongapi.com/loongapiSources/picbed/olddata2/2020/04/图片-99.png)
成功
第二关:
老规矩,直接查看源码:
![](http://objectstorage.global.loongapi.com/loongapiSources/picbed/olddata2/2020/04/图片-100-1024x355.png)
对content-type:类型进行了规定,尝试使用burp截断修改绕过
![](http://objectstorage.global.loongapi.com/loongapiSources/picbed/olddata2/2020/04/图片-102.png)
![](http://objectstorage.global.loongapi.com/loongapiSources/picbed/olddata2/2020/04/图片-101.png)
上传成功
第三关:
![](http://objectstorage.global.loongapi.com/loongapiSources/picbed/olddata2/2020/04/图片-103-1024x482.png)
上传特殊解析后缀绕过常见特殊解析后缀有
asp:asa,cer,cdx
aspx:ashx,asmx,ascx
php:php2、php3、php4、php5、phps、phtml
jsp:jspx,jspf
那么,吧后缀改成php2
![](http://objectstorage.global.loongapi.com/loongapiSources/picbed/olddata2/2020/04/图片-104.png)
上传成功
第四关:
![](http://objectstorage.global.loongapi.com/loongapiSources/picbed/olddata2/2020/04/图片-105-1024x480.png)
很明显,这次连解析也没的玩了,考虑到我的目标http服务是apache,尝试使用htaccess文件将指定文件解析为脚本
编写文件
<FilesMatch "5">
SetHandler application/x-httpd-php
</FilesMatch>
解析为php成功
第五关:
![](http://objectstorage.global.loongapi.com/loongapiSources/picbed/olddata2/2020/04/图片-106-1024x49.png)
很明显,连h文件都被屏蔽了,怎么办呢,服务器对上传文件的解析貌似只存在小写,使用大写来绕过测试。
![](http://objectstorage.global.loongapi.com/loongapiSources/picbed/olddata2/2020/04/图片-107.png)
成功上传解析
评论 (0)