该扫描工具大量基于 Fullhunt 2021 年的旧版 Log4j 扫描器(向他们致以重大感谢),现用于发现和模糊测试 Text4Shell RCE(CVE-2022-42889)。安全团队可使用此工具扫描其基础设施中的 Text4Shell RCE 漏洞,并测试可能导致在组织环境中实现代码执行的 WAF 绕过方法。
它内置支持 DNS OOB 回调,无需额外设置 DNS 回调服务器。 注意:interact.sh 目前较慢,因此暂时不推荐使用。
https://nvd.nist.gov/vuln/detail/CVE-2022-42889
$ python3 text4shell-scan.py -h
[•] CVE-2022-42889 - Apache Commons Text RCE Scanner
[•] Scanner provided by @securekomodo
usage: text4shell-scan.py [-h] [-u URL] [-p PROXY] [-l USEDLIST] [--request-type REQUEST_TYPE] [--headers-file HEADERS_FILE] [--run-all-tests] [--exclude-user-agent-fuzzing]
[--wait-time WAIT_TIME] [--waf-bypass] [--custom-waf-bypass-payload CUSTOM_WAF_BYPASS_PAYLOAD]
[--dns-callback-provider DNS_CALLBACK_PROVIDER] [--custom-dns-callback-host CUSTOM_DNS_CALLBACK_HOST] [--disable-http-redirects]
optional arguments:
-h, --help show this help message and exit
-u URL, --url URL Check a single URL.
-p PROXY, --proxy PROXY
send requests through proxy
-l USEDLIST, --list USEDLIST
Check a list of URLs.
--request-type REQUEST_TYPE
Request Type: (get, post) - [Default: get].
--headers-file HEADERS_FILE
Headers fuzzing list - [default: headers.txt].
--run-all-tests Run all available tests on each URL.
--exclude-user-agent-fuzzing
Exclude User-Agent header from fuzzing - useful to bypass weak checks on User-Agents.
--wait-time WAIT_TIME
Wait time after all URLs are processed (in seconds) - [Default: 5].
--waf-bypass Extend scans with WAF bypass payloads.
--custom-waf-bypass-payload CUSTOM_WAF_BYPASS_PAYLOAD
Test with custom WAF bypass payload.
--dns-callback-provider DNS_CALLBACK_PROVIDER
DNS Callback provider (Options: dnslog.cn, interact.sh) - [Default: interact.sh].
--custom-dns-callback-host CUSTOM_DNS_CALLBACK_HOST
Custom DNS Callback Host.
--disable-http-redirects
Disable HTTP redirects. Note: HTTP redirects are useful as it allows the payloads to have a higher chance of reaching vulnerable systems.
$ python3 text4shell-scan.py -u https://<在此输入 URL>
$ python3 text4shell-scan.py -u https://<在此输入 URL> --run-all-tests
$ python3 text4shell-scan.py -u https://<在此输入 URL> --waf-bypass
$ python3 text4shell-scan.py -u https://<在此输入 URL> --custom-dns-callback-host <在此粘贴 Collaborator 主机名>
$ python3 text4shell-scan.py -l urls.txt
$ pip3 install -r requirements.txt
git clone [https://github.com/securekomodo/text4shell-scan.git](https://github.com/securekomodo/text4shell-scan.git)
cd text4shell-scan
sudo docker build -t text4shell-scan .
sudo docker run -it --rm text4shell-scan
# 使用当前目录下的 URL 列表 "urls.txt"
docker run -it --rm -v $PWD:/data text4shell-Scan -l /data/urls.txt
本项目仅用于教育和道德测试目的。未经双方事先同意,使用 text4shell-scan 攻击目标是非法的。最终用户有责任遵守所有适用的地方、州和联邦法律。开发者不承担任何责任,也不对因使用本程序而造成的任何误用或损害负责。
本项目基于 MIT 许可证授权。
Bryan Smith