Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2017-5638 PoC — Apache Struts 2 输入验证错误漏洞

Source
Associated Vulnerability
Title:Apache Struts 2 输入验证错误漏洞 (CVE-2017-5638)
Description:The Jakarta Multipart parser in Apache Struts 2 2.3.x before 2.3.32 and 2.5.x before 2.5.10.1 has incorrect exception handling and error-message generation during file-upload attempts, which allows remote attackers to execute arbitrary commands via a crafted Content-Type, Content-Disposition, or Content-Length HTTP header, as exploited in the wild in March 2017 with a Content-Type header containing a #cmd= string.
Readme
# CVE-2017-5638

This script is intended to validate Apache Struts 2 vulnerability (CVE-2017-5638), AKA Struts-Shock. This is a completely harmless as it does not inject any malicious payload, only inject an HTTP header named 'STRUTS2-VALIDATION' in order to be able to validate whether is vulnerable

Because of its multithread capability, it's able to run 2.5k+ applications spread around the globe in less than 10 minutes. So, it can be very handy to validate enterprise applications in large scale.


## Usage
There are two ways to run this script, with and without threading, the only difference will the execution time. To enable the threading feature, just need to pass the thread parameter.
The first parameter must be a TXT file containing all targeted URL, one per line. Please note that these URL should be complete, for example, ```https://target.com/admin/myStrutsPage.action```


Here is a usage example without threading:
```python
struts-shock-validation.py target_urls.txt
```

Now using threads capability:
```python
struts-shock-validation.py target_urls.txt thread
```


## Results
it will automatically create a folder called results, and on each execution will create a dated folder containing the execution outcome. If threading is enabled, it will create on file per thread named thread_<number>, which can be ignored because when it completes it will consolidate all threads result on single TXT file with the same name (date/timestamp) as its execution folder.
File Snapshot

[4.0K] /data/pocs/fb2872e1d068fc2b6de492a45f193f46b3816028 ├── [1.5K] README.md └── [8.7K] struts-shock-validation.py 0 directories, 2 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →