
Scanner and proof-of-concept exploit for CVE-2013-1965 (Apache Struts2 S2-012 OGNL injection), with single-request detection and CSV/JSON reporting.

तेज़ YAML-आधारित भेद्यता स्कैनर, जिसमें वेब ऐप्स, एपीआई, नेटवर्क, DNS और क्लाउड इंफ्रास्ट्रक्चर में स्वचालित सुरक्षा परीक्षण के लिए टेम्पलेट-संचालित डिटेक्शन इंजन है।

स्वचालित भेद्यता का पता लगाने, मैनुअल पेनिट्रेशन टेस्टिंग, और प्रॉक्सी-आधारित इंटरसेप्शन इंजन के साथ API सुरक्षा परीक्षण के लिए ओपन-सोर्स वेब एप्लिकेशन सुरक्षा स्कैनर।

इस रिपॉजिटरी में Greenbone Community Edition के लिए स्कैनर घटक शामिल है।
Apache Struts2 S2-012 - OGNL injection in the redirect result of the Showcase app
| field | value |
|---|---|
| CVE | CVE-2013-1965 |
| severity | critical |
| CVSS | 9.3 (CVSS:2.0 AV:N/AC:M/Au:N/C:C/I:C/A:C, NVD primary) |
| fixed in | Struts 2.3.14.3 (2.3.x line; 2.3.14.1 already carries the OgnlUtil fix) |
| class | OGNL / expression-language injection leading to RCE (CWE-94) |
| scanner version | 1.0.0 |
| python | 3.8+ stdlib only, no third-party deps |
If you want the exploit, find it here: https://satoshidisk.com/pay/CT5RSF
The Apache Struts 2 Showcase application (2.0.0 through 2.3.13) evaluates
the text of a redirect result through OgnlUtil, and the value of each
request parameter is spliced into that text before evaluation. A request
parameter whose value is itself a %{...} OGNL expression is therefore
compiled and executed by the OGNL engine while the redirect location is
being built, giving unauthenticated remote code execution. The nuclei
template (http/cves/2013/CVE-2013-1965.yaml, max-request: 1) proves
execution with a single POST to /user.action whose name parameter
carries the classic chained OGNL payload that prints /etc/passwd.
In the showcase configuration the user action ends with a result such as
<result type="redirect">edit.action?skillName=${currentSkill.name}</result>
With parse="true" the whole location text is handed to
OgnlUtil.getValue, and the parameter values that were pushed onto the
value stack (name here) are substituted into it. Because the raw
parameter value is part of the string that OGNL then compiles, an attacker
controls the expression itself, not just a literal. The canonical S2-012
payload re-enables static method access
(#_memberAccess['allowStaticMethodAccess']=true,
#context['xwork.MethodAccessor.denyMethodExecution']=false), builds a
java.lang.ProcessBuilder for cat /etc/passwd, reads its stream into a
char array, and writes the result to the response obtained from
#context.get("com.opensymphony.xwork2.dispatcher.HttpServletResponse").
The in-band oracle is the passwd listing itself: the template asserts the
regex root:.*:0:0: is present in a 200 body. NVD records the issue as
CWE-94 with CVSS2 base score 9.3, published 2013-07-10; the CPE ranges
are Struts 2.0.0 (exclusive end 2.3.14.1) and struts2-showcase 2.0.0
through 2.3.13. The vendor bulletin states the fixed release is
2.3.14.3 and that the root cause is that OgnlUtil used to allow full eval
expressions; the fix denies eval expressions by default.
metadata.max-request: 1) is the authoritative verdict.POST {base}/user.action with header
Content-Type: application/x-www-form-urlencoded and the URL-encoded
body name=%{...} of the template, verbatim.status_code == 200 and the
regular expression root:.*:0:0: found in the body (re.S so the dot
spans the line-broken passwd listing).GET {base}/user.action is recorded as context
(baseline_status, baseline_snippet) but is not part of the verdict,
which keeps the template's single-request semantics.regex type.check(url) returns (True, details) only when both template matchers
hold; every helper retries (2 attempts, linear backoff) and HTTPError
bodies are read, because the 200 body carries the oracle.urls.txt (tagger output such as host:8080/path)
are auto-prefixed with http://; a 12-char md5 token fingerprints the
per-row details.# scanner: streamed CSV + optional JSON sidecar
python scanner/CVE-2013-1965/scanner.py urls.txt 8 CVE-2013-1965.csv --json CVE-2013-1965.json
# exploit: result dict + optional CSV/JSON dumps
python exploit/CVE-2013-1965/exploit.py http://target/ --csv CVE-2013-1965.csv --json CVE-2013-1965.json --verbose
urls.txt is a plain file, one target per line, # for comments.
[*] Apache Struts2 S2-012 scanner (CVE-2013-1965 / OGNL injection via redirect result)
scanner : CVE-2013-1965 v1.0.0
threads : 8 | csv: CVE-2013-1965.csv | json: CVE-2013-1965.json
[*] Apache Struts2 S2-012 scanner (CVE-2013-1965 / OGNL injection via redirect result)
[2026-12-03 10:00:01] loaded 2 target(s) from urls.txt
[2026-12-03 10:00:02] [1/2] http://localhost:8080 -> VULNERABLE
[2026-12-03 10:00:02] [2/2] http://localhost:8081 -> not-vuln
[2026-12-03 10:00:02] summary: total=2 vulnerable=1 not-vuln=1 errors=0
[2026-12-03 10:00:02] timing : avg=182ms max=210ms wall=0.42s
[2026-12-03 10:00:02] report saved: CVE-2013-1965.csv
| column | meaning |
|---|---|
| n | 1-based row number |
| url | target as provided |
| status | ok / error |
| vulnerable | verdict |
| elapsed_ms | per-target timing |
| token | 12-char md5 over the row details |
| result_b64 | base64(JSON) full details |
scanner.py - detection only, stdlib, streamed CSV + JSON sidecar.README.md - this file.DESCRIPTION.md - deeper technical notes.../../exploit/CVE-2013-1965/exploit.py - two-request POC.| code | meaning |
|---|---|
| 0 | at least one target answered |
| 2 | every target errored |