rtexit-method 0.1.14 → 0.1.15

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.
@@ -0,0 +1,262 @@
1
+ ---
2
+ name: rt-mobile-static-deep
3
+ description: "Deep static analysis of mobile apps — MobSF automated scanning, manual jadx source review, secret scanning (API keys, tokens, hardcoded creds), native library analysis (.so files with Ghidra/radare2), third-party SDK vulnerability hunting, obfuscation bypass, APK/IPA binary analysis. Foundation of every mobile pentest before dynamic testing."
4
+ ---
5
+
6
+ > 🐳 **Docker Environment (Recommended):** `docker exec -it rtexit-kali bash`
7
+
8
+ # rt-mobile-static-deep — Mobile App Static Analysis
9
+
10
+ ## Overview
11
+
12
+ Static analysis reveals hardcoded secrets, insecure code patterns, weak cryptography, and attack surfaces before running a single line of code. Should be the FIRST step in any mobile pentest.
13
+
14
+ **What you find:**
15
+ - Hardcoded API keys, tokens, passwords
16
+ - Backend endpoints and internal hostnames
17
+ - Cryptographic weaknesses
18
+ - Exported components and deep links
19
+ - Third-party SDK vulnerabilities
20
+ - Native library vulnerabilities
21
+
22
+ ---
23
+
24
+ ## Phase 1: MobSF — Automated Full Scan
25
+
26
+ ```bash
27
+ docker exec rtexit-kali bash -c "
28
+ # Run MobSF Docker (fastest setup)
29
+ docker run -it --rm -p 8000:8000 opensecurity/mobile-security-framework-mobsf:latest
30
+
31
+ # Upload APK/IPA via browser: http://localhost:8000
32
+ # Or via API:
33
+ curl -s 'http://localhost:8000/api/v1/upload' \
34
+ -H 'Authorization: YOUR_API_KEY' \
35
+ -F 'file=@target.apk' > /tmp/upload.json
36
+
37
+ SCAN_HASH=\$(cat /tmp/upload.json | python3 -c \"import json,sys; print(json.load(sys.stdin)['hash'])\")
38
+
39
+ # Run scan
40
+ curl -s 'http://localhost:8000/api/v1/scan' \
41
+ -H 'Authorization: YOUR_API_KEY' \
42
+ -d \"scan_type=apk&file_name=target.apk&hash=\${SCAN_HASH}\"
43
+
44
+ # Get JSON report
45
+ curl -s \"http://localhost:8000/api/v1/report_json\" \
46
+ -H 'Authorization: YOUR_API_KEY' \
47
+ -d \"hash=\${SCAN_HASH}\" > /tmp/mobsf_report.json
48
+
49
+ # Extract key findings
50
+ python3 -c \"
51
+ import json
52
+ r = json.load(open('/tmp/mobsf_report.json'))
53
+ print('=== Hardcoded Secrets ===')
54
+ for s in r.get('secrets', []): print(' -', s)
55
+ print('=== URLs ===')
56
+ for u in r.get('urls', []): print(' -', u['url'])
57
+ print('=== HIGH findings ===')
58
+ for k, v in r.get('code_analysis', {}).get('findings', {}).items():
59
+ if v.get('level') == 'high': print(' -', k, ':', v.get('cvss'))
60
+ \"
61
+ "
62
+ ```
63
+
64
+ ---
65
+
66
+ ## Phase 2: Secret Scanning
67
+
68
+ ```bash
69
+ docker exec rtexit-kali bash -c "
70
+ # Decompile APK
71
+ apktool d target.apk -o /tmp/target_dc
72
+ jadx -d /tmp/target_java target.apk 2>/dev/null
73
+
74
+ # Comprehensive secret scan
75
+ # Tool: trufflehog
76
+ pip3 install trufflehog3 2>/dev/null
77
+ trufflehog filesystem /tmp/target_java/ --json > /tmp/secrets.json
78
+ cat /tmp/secrets.json | python3 -m json.tool | grep -A3 'reason\|stringsFound'
79
+
80
+ # Manual grep patterns
81
+ echo '=== API Keys ==='
82
+ grep -rE '(api[_-]?key|apikey)\s*[=:]\s*[\"'\'']\w{20,}' /tmp/target_java/ -i
83
+ echo '=== AWS Keys ==='
84
+ grep -rE 'AKIA[0-9A-Z]{16}' /tmp/target_java/
85
+ echo '=== JWT Tokens ==='
86
+ grep -rE 'eyJ[A-Za-z0-9+/=]{10,}\.[A-Za-z0-9+/=]{10,}' /tmp/target_java/
87
+ echo '=== Hardcoded passwords ==='
88
+ grep -rE '(password|passwd|pwd)\s*[=:]\s*[\"'\'']\w{4,}' /tmp/target_java/ -i
89
+ echo '=== Private keys ==='
90
+ grep -r 'BEGIN.*PRIVATE KEY\|BEGIN RSA\|BEGIN EC' /tmp/target_java/ -l
91
+ echo '=== Firebase URLs ==='
92
+ grep -rE 'firebaseio\.com|firebase\.google\.com' /tmp/target_java/
93
+ echo '=== Google Maps API Key ==='
94
+ grep -rE 'AIza[0-9A-Za-z-_]{35}' /tmp/target_java/
95
+ "
96
+ ```
97
+
98
+ ---
99
+
100
+ ## Phase 3: Endpoint Discovery
101
+
102
+ ```bash
103
+ docker exec rtexit-kali bash -c "
104
+ # Extract all URLs and endpoints from source
105
+ echo '=== HTTPS Endpoints ==='
106
+ grep -rEoh 'https?://[^\"'\'')\s]{10,}' /tmp/target_java/ | sort -u | grep -v 'schema\|xmlns\|android\|google.com/design'
107
+
108
+ echo '=== API Base URLs ==='
109
+ grep -rEi 'base_?url|api_?url|endpoint|host_?url' /tmp/target_java/ | grep -oE '\"[^\"]*\"' | sort -u
110
+
111
+ echo '=== IP Addresses ==='
112
+ grep -rEoh '\b([0-9]{1,3}\.){3}[0-9]{1,3}(:[0-9]+)?\b' /tmp/target_java/ | grep -v '0\.0\.0\|127\.0\.0\|255\.255' | sort -u
113
+
114
+ echo '=== WebSocket URLs ==='
115
+ grep -rEoh 'wss?://[^\"'\'')\s]+' /tmp/target_java/ | sort -u
116
+ "
117
+ ```
118
+
119
+ ---
120
+
121
+ ## Phase 4: AndroidManifest Deep Analysis
122
+
123
+ ```bash
124
+ docker exec rtexit-kali bash -c "
125
+ MANIFEST=/tmp/target_dc/AndroidManifest.xml
126
+
127
+ echo '=== Package + Permissions ==='
128
+ grep 'package\|uses-permission' \$MANIFEST | sort
129
+
130
+ echo '=== DANGEROUS permissions ==='
131
+ grep 'uses-permission' \$MANIFEST | grep -iE 'READ_SMS|READ_CONTACTS|READ_CALL_LOG|CAMERA|RECORD_AUDIO|ACCESS_FINE_LOCATION|PROCESS_OUTGOING_CALLS|BIND_ACCESSIBILITY'
132
+
133
+ echo '=== Exported components (attack surface) ==='
134
+ grep -E 'activity|service|receiver|provider' \$MANIFEST | grep 'exported=\"true\"'
135
+
136
+ echo '=== Deep links / intent filters ==='
137
+ grep -A5 'intent-filter' \$MANIFEST | grep -E 'scheme|host|path'
138
+
139
+ echo '=== Debuggable flag ==='
140
+ grep 'debuggable' \$MANIFEST
141
+
142
+ echo '=== Backup flag ==='
143
+ grep 'allowBackup' \$MANIFEST
144
+
145
+ echo '=== Network security config ==='
146
+ grep 'networkSecurityConfig' \$MANIFEST
147
+ "
148
+ ```
149
+
150
+ ---
151
+
152
+ ## Phase 5: Native Library Analysis
153
+
154
+ ```bash
155
+ docker exec rtexit-kali bash -c "
156
+ # Extract and analyze .so files
157
+ unzip target.apk 'lib/arm64-v8a/*.so' -d /tmp/libs/
158
+ ls /tmp/libs/lib/arm64-v8a/
159
+
160
+ # Quick strings analysis on each .so
161
+ for lib in /tmp/libs/lib/arm64-v8a/*.so; do
162
+ echo \"=== \$lib ===\"
163
+ strings \"\$lib\" | grep -iE 'password|secret|api[_-]?key|token|http|base64|des|aes|rsa' | head -20
164
+ done
165
+
166
+ # Check for known vulnerable native libraries
167
+ strings /tmp/libs/lib/arm64-v8a/*.so | grep -E 'OpenSSL|libcurl' | head -5
168
+ # Look up CVEs for the versions found
169
+
170
+ # Deeper analysis with radare2
171
+ r2 /tmp/libs/lib/arm64-v8a/libapp.so
172
+ # In r2:
173
+ # aaa → analyze all
174
+ # afl → list all functions
175
+ # pdf @sym.verify_pin → disassemble specific function
176
+ "
177
+ ```
178
+
179
+ ---
180
+
181
+ ## Phase 6: Cryptographic Analysis
182
+
183
+ ```bash
184
+ docker exec rtexit-kali bash -c "
185
+ # Find cryptographic usage patterns in source
186
+ echo '=== Weak algorithms ==='
187
+ grep -rE 'DES[^3]|MD5|SHA1[^_]|RC4|ECB' /tmp/target_java/ -i | grep -v '//\|test\|Test'
188
+
189
+ echo '=== Hardcoded IV / Keys ==='
190
+ grep -rE 'IvParameterSpec|SecretKeySpec' /tmp/target_java/ -A2 | grep -E 'new byte\[\]|getBytes'
191
+
192
+ echo '=== Insecure random ==='
193
+ grep -rE 'new Random\(\)|Math\.random' /tmp/target_java/ | grep -v 'SecureRandom'
194
+
195
+ echo '=== Keystore usage (secure vs insecure) ==='
196
+ grep -rE 'KeyStore|AndroidKeyStore|KeyGenerator' /tmp/target_java/ -l
197
+ # If NOT using AndroidKeyStore → keys stored insecurely
198
+ "
199
+ ```
200
+
201
+ ---
202
+
203
+ ## Phase 7: Third-Party SDK Vulnerability Check
204
+
205
+ ```bash
206
+ docker exec rtexit-kali bash -c "
207
+ # Extract all third-party SDKs/libraries
208
+ grep -r 'implementation\|compile' /tmp/target_java/ 2>/dev/null | grep -oE \"'[^']+:[^']+:[^']+'\"|sort -u
209
+
210
+ # Check for known vulnerable SDKs from strings in APK
211
+ strings /tmp/target_apk/classes*.dex | grep -E 'com\.(facebook|google|firebase|amazonaws|stripe|braintree|okhttp|retrofit)' | sort -u | head -30
212
+
213
+ # Check OkHttp version (critical — many CVEs)
214
+ grep -r 'okhttp' /tmp/target_java/ | grep -oE 'okhttp:[0-9]+\.[0-9]+\.[0-9]+' | sort -u
215
+ "
216
+ ```
217
+
218
+ ---
219
+
220
+ ## iOS Static Analysis
221
+
222
+ ```bash
223
+ docker exec rtexit-kali bash -c "
224
+ # Extract IPA
225
+ unzip target.ipa -d /tmp/ipa_extracted/
226
+ APP_DIR=\$(find /tmp/ipa_extracted/Payload -name '*.app' -type d)
227
+
228
+ # Binary analysis
229
+ file \$APP_DIR/TargetApp
230
+ # Check: encryption, architecture
231
+
232
+ # Strings
233
+ strings \$APP_DIR/TargetApp | grep -iE 'api[_-]?key|secret|password|http|token' | head -50
234
+
235
+ # class-dump (get all Obj-C class declarations)
236
+ class-dump \$APP_DIR/TargetApp > /tmp/classes.h
237
+ grep -i 'password\|token\|pin\|secret\|auth' /tmp/classes.h | head -30
238
+
239
+ # Check Info.plist (often has API keys, URLs)
240
+ plutil -p \$APP_DIR/Info.plist 2>/dev/null || python3 -c \"
241
+ import plistlib
242
+ with open('\$APP_DIR/Info.plist', 'rb') as f:
243
+ plist = plistlib.load(f)
244
+ for k, v in plist.items():
245
+ if any(x in k.lower() for x in ['key', 'secret', 'token', 'url', 'api']):
246
+ print(k, '=', v)
247
+ \"
248
+ "
249
+ ```
250
+
251
+ ---
252
+
253
+ ## Related Skills
254
+ - `rt-exploit-android` — dynamic testing following static findings
255
+ - `rt-exploit-ios` — iOS dynamic testing
256
+ - `rt-frida-advanced` — confirm static findings at runtime
257
+ - `rt-android-intent-exploitation` — exploit exported components found in manifest
258
+
259
+ ## References
260
+ - https://github.com/MobSF/Mobile-Security-Framework-MobSF
261
+ - https://owasp.org/www-project-mobile-application-security-design-guide/
262
+ - https://attack.mitre.org/techniques/T1418/ — Software Discovery
@@ -104,11 +104,20 @@ const PROFILES = {
104
104
 
105
105
  mobile: {
106
106
  label: 'Mobile',
107
- description: 'Android, iOS, Bluetooth/BLE',
107
+ description: 'Android, iOS, BLE, Frida, SSL bypass, cross-platform, C2',
108
108
  skills: [
109
+ // Core mobile
109
110
  'rt-exploit-android',
110
111
  'rt-exploit-ios',
111
112
  'rt-bluetooth-ble',
113
+ // Advanced mobile (new)
114
+ 'rt-frida-advanced',
115
+ 'rt-mobile-ssl-pinning',
116
+ 'rt-apk-repackaging',
117
+ 'rt-android-intent-exploitation',
118
+ 'rt-cross-platform-mobile',
119
+ 'rt-mobile-malware-c2',
120
+ 'rt-mobile-static-deep',
112
121
  ],
113
122
  },
114
123