reznok / Spring4Shell-POC
- воскресенье, 3 апреля 2022 г. в 00:31:41
Dockerized Spring4Shell (CVE-2022-22965) PoC application and exploit
This is a dockerized application that is vulnerable to the Spring4Shell vulnerability (CVE-2022-22965). Full Java source for the war is provided and modifiable, the war will get re-built whenever the docker image is built. The built WAR will then be loaded by Tomcat. There is nothing special about this application, it's a simple hello world that's based off Spring tutorials.
Details: https://www.lunasec.io/docs/blog/spring-rce-vulnerabilities
docker build . -t spring4shell && docker run -p 8080:8080 spring4shell
python exploit.py --url "http://localhost:8080/helloworld/greeting"
cmd
GET parameter for your commands. (http://localhost:8080/shell.jsp
by default)Fixed! As of this writing, the container (possibly just Tomcat) must be restarted between exploitations. I'm actively trying to resolve this.
Re-running the exploit will create an extra artifact file of {old_filename}_.jsp.
PRs/DMs @Rezn0k are welcome for improvements!