绕WAF的小Trick实例
2021-7-26 16:12:20 Author: mp.weixin.qq.com(查看原文) 阅读量:96 收藏

一、拨云见日

在渗透测试中,一般会使用信息泄露扫描工具。

/actuator/在字典里非常常见,它是Spring Boot 用来对应用程序的监控管理。

actuator endpoints列表里有几个需要特别关注,不要问为什么。

SpringBoot 2.x

/actuator/httptrace
/actuator/env
/actuator/shutdown
/actuator/mappings
/actuator/heapdump
...

SpringBoot 1.x

/trace

/env

/shutdown

/mappings

/dump

当然,厂商也会相应的把这些接口下线或屏蔽外网访问
下线了没啥好说,屏蔽外网访问就可以“有所作为”了

观察接口被屏蔽的特征

例如:/actuator/httptrace,返回404

改成/aaaaactuator/httptrace,正常的springboot 接口404页面

说明/actuator/httptrace在 Nginx 就给拦下来了

举个场景,通过 js 发现一个 api 接口,/ca/remote/get?userId=1346662019893473281,访问后是404

由特征得知这是被 Nginx 给拦了而不是真的404

结合绕过手段成功拿到用户私钥,/ca/remote;/get?userId=1346662019893473281

案例不是凭空杜撰的,安全评估/actuator/**这些接口有风险要关闭,运维觉得我在nginx屏蔽就好了

于是有了下面这些故事

/env 访问拦截,/env/绕过

/admin/actuator 拦截

/admin;/actuator 绕过

/actuator/httptrace是这样

/a/..;/actuator/httptrace 是这样

还可以这样 trace.json

相关插件有个叫403Bypasser ,一个用于绕过403目录限制的burp插件。通过使用被动扫描(默认开启),每一个403的请求都会被该插件自动扫描。

https://github.com/sting8k/BurpSuite_403Bypasser

学习绕过手法就好了

二、藕断丝连

/swagger-ui.html想必大家也不陌生,它展示的只是一个静态页面,如果/swagger-ui.html被屏蔽了,还能访问哪些接口?

/swagger-resources,返回api接口文档路径

/v2/api-docs ,接口文档,这个才是关键。运维总是草草了事,指哪屏哪

同理还有/hystrix

它的相关接口有哪些?

/proxy.stream?origin=http://www.baidu.com ,SSRF漏洞【CVE-2020-5412】

其他的比如druid,相关接口/druid/websession.json,/druid/sql.json,/druid/weburi.json

graph,/graphql,/graphiql,/graphql/console,/graphql-explorer

以此类推,自己去实践总结吧

微信扫描二维码,关注我的公众号

文章来源: https://mp.weixin.qq.com/s?__biz=Mzg4ODU4ODYzOQ==&mid=2247484377&idx=1&sn=0a25dc72f6ece3f2acf65905bf96e424&chksm=cff993e9f88e1aff732154046754d715fa18ae2d8a3e4020206aeb61ac4c61caf06edf02628b&scene=58&subscene=0#rd
如有侵权请联系:admin#unsafe.sh