Scanner and proof-of-concept exploit for CVE-2015-7501, the JBoss JMXInvokerServlet/EJBInvokerServlet insecure deserialization RCE via Apache Commons Collections gadget chains.
Red Hat JBoss - Insecure Deserialization (JMXInvokerServlet / EJBInvokerServlet) - Remote Code Execution
| field | value |
|---|---|
| CVE | CVE-2015-7501 |
| severity | critical |
| CVSS | 9.8 (template CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H; NVD primary 3.0 vector CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) |
| fixed in | RHSA-2015:2538 (JBoss EAP 6.4); EAP 7.x removes the affected invoker servlets; Apache Commons Collections 3.2.2 / 4.1+ |
| class | deserialization RCE (NVD CWE-502), unsafe readObject on the /invoker/* HTTP invoker endpoints |
| 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/CT5RVX
Red Hat JBoss Application Server (4.x, 5.x, 6.x) contains an insecure
deserialization vulnerability in the JMXInvokerServlet and
EJBInvokerServlet HTTP Invoker endpoints. These endpoints deserialize
arbitrary Java objects from unauthenticated HTTP POST requests. An
attacker can send a crafted Apache Commons Collections gadget chain to
achieve remote code execution. CVE-2015-7501 is the original 2015
FoxGlove Security disclosure of the Java Commons Collections
deserialization vulnerability class. The template issues a GET /jmx-console/ pre-match plus POST probes to the three invoker
endpoints (stop-at-first-match, max-request: 7). NVD: EPSS 0.85562
(percentile 0.99723), published 2017-11-09 by [email protected].
The invoker servlets live under /invoker/ on the JBoss HTTP port
(8080 by default) and speak raw Java serialization
(application/x-java-serialized-object). The template is a flow: http(1) && http(2) pair:
GET {BaseURL}/jmx-console/; the internal DSL matcher
requires any of the lowercased words jboss, jmx agent,
jmx-console, j_security_check, jboss.system,
jboss.deployment in the body (the JBoss management console page).POST of the CommonsCollections3.1 gadget bytes
(generate_java_gadget("commons-collections3.1", "nslookup {{interactsh-url}}", "raw"), clusterbombed over the payloads
/invoker/JMXInvokerServlet, /invoker/EJBInvokerServlet,
/invoker/readonly, stop-at-first-match: true) with
Content-Type: application/x-java-serialized-object and
Accept: application/x-java-serialized-object.matchers-condition: and) - the interactsh
protocol recorded a dns interaction, and the answer body contains
classcastexception or jboss (case-insensitive).The gadget is the classic chain
HashMap -> TiedMapEntry -> LazyMap -> ChainedTransformer -> ConstantTransformer(Runtime) / InvokerTransformer(getRuntime, getMethod, invoke, exec); during readObject the
InvokerTransformer chain calls Runtime.exec with the probe
command. Patched deployments (EAP 6.4 via RHSA-2015:2538, EAP 7.x, or
Commons Collections 3.2.2/4.1 with an object filter) answer the same
shape but no longer run the gadget. NVD lists JBoss A-MQ 6.x, BPMS
6.x, BRMS 6.x/5.x, JDG 6.x, JDV 6.x/5.x, EAP 6.x/5.x/4.3.x, Fuse 6.x,
FSW 6.x, JON 3.x, Portal 6.x, SOA-P 5.x, JWS 3.x, OpenShift/xPAAS 3.x
and Subscription Asset Manager 1.3.
max-request: 7.GET /jmx-console/; verdict requires the DSL
contains_any over the six template words (case-insensitive).POST of the CC3.1 gadget to each endpoint in
template order; the first endpoint answering HTTP 200 with a body
containing classcastexception or jboss wins.check(url) returns (True, details) only when the console
pre-match and one invoker word match both hold; details keeps the
per-word flags (pre1..pre6, per-endpoint word1/word2), the
matched endpoint, a 200-char snippet and the extractor string
jboss invoker fault: pre=N/6 matched=<ep> status=S.oast note
(stdlib has no interactsh client; the gadget carries the probe
command nslookup localhost).token is computed over the JSON result so a merely
reflected page is distinguishable from a real invoker answer.urls.txt are auto-prefixed with http://.# scanner (GitHub side): streamed CSV + optional JSON sidecar
python scanner/CVE-2015-7501/scanner.py urls.txt 8 CVE-2015-7501.csv --json CVE-2015-7501.json
# exploit (satoshidisk side): result dict + optional CSV/JSON dumps
python exploit/CVE-2015-7501/exploit.py http://jboss-host:8080 --csv CVE-2015-7501.csv --json CVE-2015-7501.json --verbose
urls.txt is a plain file, one target per line, # for comments.
Lines may omit the scheme (jboss-host:8080 works, http:// is
prepended). The invoker endpoints and the console share the JBoss HTTP
port (8080 by default, 9990 for the native JMX port which the template
does not use).
RCE POC SUITE
scanner : CVE-2015-7501 v1.0.0
threads : 4 | csv: CVE-2015-7501.csv | json: CVE-2015-7501.json
RCE POC SUITE
[..] loaded 2 target(s) from urls.txt
[..] [1/2] http://127.0.0.1:8090 -> VULNERABLE
[..] [2/2] http://127.0.0.1:8090 -> VULNERABLE
[..] json sidecar saved: CVE-2015-7501.json
[..] summary: total=2 vulnerable=2 not-vuln=0 errors=0
[..] timing : avg=7ms max=7ms wall=0.01s
[..] report saved: CVE-2015-7501.csv
| column | meaning |
|---|---|
| n | 1-based row number |
| url | target as provided |
| status | ok / error |
| vulnerable | verdict |
| elapsed_ms | per-target timing |
| token | md5 proof-of-match (12 chars) |
| 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-2015-7501/exploit.py - two-stage POC.| code | meaning |
|---|---|
| 0 | at least one target answered |
| 2 | every target errored (or no targets loaded) |
The POC returns 0 when its token verification passes and 2 on
verification failed.
http.html:"/jmx-console/" http.title:JBoss