@elizaos/skills 2.0.0-alpha.3

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.
Files changed (371) hide show
  1. package/README.md +126 -0
  2. package/package.json +53 -0
  3. package/skills/1password/SKILL.md +70 -0
  4. package/skills/1password/references/cli-examples.md +29 -0
  5. package/skills/1password/references/get-started.md +17 -0
  6. package/skills/apple-notes/SKILL.md +77 -0
  7. package/skills/apple-reminders/SKILL.md +96 -0
  8. package/skills/bear-notes/SKILL.md +107 -0
  9. package/skills/bird/SKILL.md +224 -0
  10. package/skills/blogwatcher/SKILL.md +69 -0
  11. package/skills/blucli/SKILL.md +47 -0
  12. package/skills/bluebubbles/SKILL.md +131 -0
  13. package/skills/camsnap/SKILL.md +45 -0
  14. package/skills/canvas/SKILL.md +203 -0
  15. package/skills/clawhub/SKILL.md +77 -0
  16. package/skills/coding-agent/SKILL.md +284 -0
  17. package/skills/discord/SKILL.md +578 -0
  18. package/skills/eightctl/SKILL.md +50 -0
  19. package/skills/food-order/SKILL.md +48 -0
  20. package/skills/gemini/SKILL.md +43 -0
  21. package/skills/gifgrep/SKILL.md +79 -0
  22. package/skills/github/SKILL.md +77 -0
  23. package/skills/gog/SKILL.md +116 -0
  24. package/skills/goplaces/SKILL.md +52 -0
  25. package/skills/healthcheck/SKILL.md +245 -0
  26. package/skills/himalaya/SKILL.md +257 -0
  27. package/skills/himalaya/references/configuration.md +184 -0
  28. package/skills/himalaya/references/message-composition.md +199 -0
  29. package/skills/imsg/SKILL.md +74 -0
  30. package/skills/local-places/SERVER_README.md +101 -0
  31. package/skills/local-places/SKILL.md +102 -0
  32. package/skills/local-places/pyproject.toml +21 -0
  33. package/skills/local-places/src/local_places/__init__.py +2 -0
  34. package/skills/local-places/src/local_places/google_places.py +314 -0
  35. package/skills/local-places/src/local_places/main.py +65 -0
  36. package/skills/local-places/src/local_places/schemas.py +107 -0
  37. package/skills/mcporter/SKILL.md +61 -0
  38. package/skills/model-usage/SKILL.md +69 -0
  39. package/skills/model-usage/references/codexbar-cli.md +33 -0
  40. package/skills/model-usage/scripts/model_usage.py +310 -0
  41. package/skills/nano-banana-pro/SKILL.md +58 -0
  42. package/skills/nano-banana-pro/scripts/generate_image.py +184 -0
  43. package/skills/nano-pdf/SKILL.md +38 -0
  44. package/skills/notion/SKILL.md +172 -0
  45. package/skills/obsidian/SKILL.md +81 -0
  46. package/skills/openai-image-gen/SKILL.md +89 -0
  47. package/skills/openai-image-gen/scripts/gen.py +240 -0
  48. package/skills/openai-whisper/SKILL.md +38 -0
  49. package/skills/openai-whisper-api/SKILL.md +52 -0
  50. package/skills/openai-whisper-api/scripts/transcribe.sh +85 -0
  51. package/skills/openhue/SKILL.md +51 -0
  52. package/skills/oracle/SKILL.md +125 -0
  53. package/skills/ordercli/SKILL.md +78 -0
  54. package/skills/peekaboo/SKILL.md +190 -0
  55. package/skills/sag/SKILL.md +87 -0
  56. package/skills/security-ask-questions-if-underspecified/.claude-plugin/plugin.json +10 -0
  57. package/skills/security-ask-questions-if-underspecified/README.md +24 -0
  58. package/skills/security-ask-questions-if-underspecified/skills/ask-questions-if-underspecified/SKILL.md +85 -0
  59. package/skills/security-audit-context-building/.claude-plugin/plugin.json +10 -0
  60. package/skills/security-audit-context-building/README.md +58 -0
  61. package/skills/security-audit-context-building/commands/audit-context.md +21 -0
  62. package/skills/security-audit-context-building/skills/audit-context-building/SKILL.md +297 -0
  63. package/skills/security-audit-context-building/skills/audit-context-building/resources/COMPLETENESS_CHECKLIST.md +47 -0
  64. package/skills/security-audit-context-building/skills/audit-context-building/resources/FUNCTION_MICRO_ANALYSIS_EXAMPLE.md +355 -0
  65. package/skills/security-audit-context-building/skills/audit-context-building/resources/OUTPUT_REQUIREMENTS.md +71 -0
  66. package/skills/security-building-secure-contracts/.claude-plugin/plugin.json +10 -0
  67. package/skills/security-building-secure-contracts/README.md +241 -0
  68. package/skills/security-building-secure-contracts/skills/algorand-vulnerability-scanner/SKILL.md +284 -0
  69. package/skills/security-building-secure-contracts/skills/algorand-vulnerability-scanner/resources/VULNERABILITY_PATTERNS.md +405 -0
  70. package/skills/security-building-secure-contracts/skills/audit-prep-assistant/SKILL.md +409 -0
  71. package/skills/security-building-secure-contracts/skills/cairo-vulnerability-scanner/SKILL.md +329 -0
  72. package/skills/security-building-secure-contracts/skills/cairo-vulnerability-scanner/resources/VULNERABILITY_PATTERNS.md +722 -0
  73. package/skills/security-building-secure-contracts/skills/code-maturity-assessor/SKILL.md +218 -0
  74. package/skills/security-building-secure-contracts/skills/code-maturity-assessor/resources/ASSESSMENT_CRITERIA.md +355 -0
  75. package/skills/security-building-secure-contracts/skills/code-maturity-assessor/resources/EXAMPLE_REPORT.md +248 -0
  76. package/skills/security-building-secure-contracts/skills/code-maturity-assessor/resources/REPORT_FORMAT.md +33 -0
  77. package/skills/security-building-secure-contracts/skills/cosmos-vulnerability-scanner/SKILL.md +334 -0
  78. package/skills/security-building-secure-contracts/skills/cosmos-vulnerability-scanner/resources/VULNERABILITY_PATTERNS.md +740 -0
  79. package/skills/security-building-secure-contracts/skills/guidelines-advisor/SKILL.md +252 -0
  80. package/skills/security-building-secure-contracts/skills/guidelines-advisor/resources/ASSESSMENT_AREAS.md +329 -0
  81. package/skills/security-building-secure-contracts/skills/guidelines-advisor/resources/DELIVERABLES.md +118 -0
  82. package/skills/security-building-secure-contracts/skills/guidelines-advisor/resources/EXAMPLE_REPORT.md +298 -0
  83. package/skills/security-building-secure-contracts/skills/secure-workflow-guide/SKILL.md +161 -0
  84. package/skills/security-building-secure-contracts/skills/secure-workflow-guide/resources/EXAMPLE_REPORT.md +279 -0
  85. package/skills/security-building-secure-contracts/skills/secure-workflow-guide/resources/WORKFLOW_STEPS.md +132 -0
  86. package/skills/security-building-secure-contracts/skills/solana-vulnerability-scanner/SKILL.md +389 -0
  87. package/skills/security-building-secure-contracts/skills/solana-vulnerability-scanner/resources/VULNERABILITY_PATTERNS.md +669 -0
  88. package/skills/security-building-secure-contracts/skills/substrate-vulnerability-scanner/SKILL.md +298 -0
  89. package/skills/security-building-secure-contracts/skills/substrate-vulnerability-scanner/resources/VULNERABILITY_PATTERNS.md +791 -0
  90. package/skills/security-building-secure-contracts/skills/token-integration-analyzer/SKILL.md +362 -0
  91. package/skills/security-building-secure-contracts/skills/token-integration-analyzer/resources/ASSESSMENT_CATEGORIES.md +571 -0
  92. package/skills/security-building-secure-contracts/skills/token-integration-analyzer/resources/REPORT_TEMPLATES.md +141 -0
  93. package/skills/security-building-secure-contracts/skills/ton-vulnerability-scanner/SKILL.md +388 -0
  94. package/skills/security-building-secure-contracts/skills/ton-vulnerability-scanner/resources/VULNERABILITY_PATTERNS.md +595 -0
  95. package/skills/security-burpsuite-project-parser/.claude-plugin/plugin.json +10 -0
  96. package/skills/security-burpsuite-project-parser/README.md +103 -0
  97. package/skills/security-burpsuite-project-parser/commands/burp-search.md +18 -0
  98. package/skills/security-burpsuite-project-parser/skills/SKILL.md +358 -0
  99. package/skills/security-burpsuite-project-parser/skills/scripts/burp-search.sh +99 -0
  100. package/skills/security-claude-in-chrome-troubleshooting/.claude-plugin/plugin.json +8 -0
  101. package/skills/security-claude-in-chrome-troubleshooting/README.md +31 -0
  102. package/skills/security-claude-in-chrome-troubleshooting/skills/claude-in-chrome-troubleshooting/SKILL.md +251 -0
  103. package/skills/security-constant-time-analysis/.claude-plugin/plugin.json +9 -0
  104. package/skills/security-constant-time-analysis/README.md +381 -0
  105. package/skills/security-constant-time-analysis/commands/ct-check.md +20 -0
  106. package/skills/security-constant-time-analysis/ct_analyzer/__init__.py +49 -0
  107. package/skills/security-constant-time-analysis/ct_analyzer/analyzer.py +1284 -0
  108. package/skills/security-constant-time-analysis/ct_analyzer/script_analyzers.py +3081 -0
  109. package/skills/security-constant-time-analysis/ct_analyzer/tests/__init__.py +1 -0
  110. package/skills/security-constant-time-analysis/ct_analyzer/tests/test_analyzer.py +1397 -0
  111. package/skills/security-constant-time-analysis/ct_analyzer/tests/test_samples/bn_excerpt.js +205 -0
  112. package/skills/security-constant-time-analysis/ct_analyzer/tests/test_samples/decompose_constant_time.c +181 -0
  113. package/skills/security-constant-time-analysis/ct_analyzer/tests/test_samples/decompose_vulnerable.c +74 -0
  114. package/skills/security-constant-time-analysis/ct_analyzer/tests/test_samples/decompose_vulnerable.go +78 -0
  115. package/skills/security-constant-time-analysis/ct_analyzer/tests/test_samples/decompose_vulnerable.rs +92 -0
  116. package/skills/security-constant-time-analysis/ct_analyzer/tests/test_samples/vulnerable.cs +174 -0
  117. package/skills/security-constant-time-analysis/ct_analyzer/tests/test_samples/vulnerable.java +161 -0
  118. package/skills/security-constant-time-analysis/ct_analyzer/tests/test_samples/vulnerable.kt +181 -0
  119. package/skills/security-constant-time-analysis/ct_analyzer/tests/test_samples/vulnerable.php +140 -0
  120. package/skills/security-constant-time-analysis/ct_analyzer/tests/test_samples/vulnerable.py +252 -0
  121. package/skills/security-constant-time-analysis/ct_analyzer/tests/test_samples/vulnerable.rb +188 -0
  122. package/skills/security-constant-time-analysis/ct_analyzer/tests/test_samples/vulnerable.swift +199 -0
  123. package/skills/security-constant-time-analysis/ct_analyzer/tests/test_samples/vulnerable.ts +154 -0
  124. package/skills/security-constant-time-analysis/pyproject.toml +52 -0
  125. package/skills/security-constant-time-analysis/skills/constant-time-analysis/README.md +90 -0
  126. package/skills/security-constant-time-analysis/skills/constant-time-analysis/SKILL.md +219 -0
  127. package/skills/security-constant-time-analysis/skills/constant-time-analysis/references/compiled.md +129 -0
  128. package/skills/security-constant-time-analysis/skills/constant-time-analysis/references/javascript.md +136 -0
  129. package/skills/security-constant-time-analysis/skills/constant-time-analysis/references/kotlin.md +252 -0
  130. package/skills/security-constant-time-analysis/skills/constant-time-analysis/references/php.md +172 -0
  131. package/skills/security-constant-time-analysis/skills/constant-time-analysis/references/python.md +179 -0
  132. package/skills/security-constant-time-analysis/skills/constant-time-analysis/references/ruby.md +198 -0
  133. package/skills/security-constant-time-analysis/skills/constant-time-analysis/references/swift.md +288 -0
  134. package/skills/security-constant-time-analysis/skills/constant-time-analysis/references/vm-compiled.md +354 -0
  135. package/skills/security-constant-time-analysis/uv.lock +8 -0
  136. package/skills/security-culture-index/.claude-plugin/plugin.json +8 -0
  137. package/skills/security-culture-index/README.md +79 -0
  138. package/skills/security-culture-index/skills/interpreting-culture-index/SKILL.md +293 -0
  139. package/skills/security-culture-index/skills/interpreting-culture-index/references/anti-patterns.md +255 -0
  140. package/skills/security-culture-index/skills/interpreting-culture-index/references/conversation-starters.md +408 -0
  141. package/skills/security-culture-index/skills/interpreting-culture-index/references/interview-trait-signals.md +253 -0
  142. package/skills/security-culture-index/skills/interpreting-culture-index/references/motivators.md +158 -0
  143. package/skills/security-culture-index/skills/interpreting-culture-index/references/patterns-archetypes.md +147 -0
  144. package/skills/security-culture-index/skills/interpreting-culture-index/references/primary-traits.md +307 -0
  145. package/skills/security-culture-index/skills/interpreting-culture-index/references/secondary-traits.md +228 -0
  146. package/skills/security-culture-index/skills/interpreting-culture-index/references/team-composition.md +148 -0
  147. package/skills/security-culture-index/skills/interpreting-culture-index/scripts/check_deps.py +108 -0
  148. package/skills/security-culture-index/skills/interpreting-culture-index/scripts/culture_index/__init__.py +20 -0
  149. package/skills/security-culture-index/skills/interpreting-culture-index/scripts/culture_index/constants.py +122 -0
  150. package/skills/security-culture-index/skills/interpreting-culture-index/scripts/culture_index/extract.py +187 -0
  151. package/skills/security-culture-index/skills/interpreting-culture-index/scripts/culture_index/models.py +16 -0
  152. package/skills/security-culture-index/skills/interpreting-culture-index/scripts/culture_index/opencv_extractor.py +520 -0
  153. package/skills/security-culture-index/skills/interpreting-culture-index/scripts/extract_pdf.py +237 -0
  154. package/skills/security-culture-index/skills/interpreting-culture-index/scripts/pyproject.toml +18 -0
  155. package/skills/security-culture-index/skills/interpreting-culture-index/templates/burnout-report.md +113 -0
  156. package/skills/security-culture-index/skills/interpreting-culture-index/templates/comparison-report.md +103 -0
  157. package/skills/security-culture-index/skills/interpreting-culture-index/templates/hiring-profile.md +127 -0
  158. package/skills/security-culture-index/skills/interpreting-culture-index/templates/individual-report.md +85 -0
  159. package/skills/security-culture-index/skills/interpreting-culture-index/templates/predicted-profile.md +165 -0
  160. package/skills/security-culture-index/skills/interpreting-culture-index/templates/team-report.md +109 -0
  161. package/skills/security-culture-index/skills/interpreting-culture-index/workflows/analyze-team.md +188 -0
  162. package/skills/security-culture-index/skills/interpreting-culture-index/workflows/coach-manager.md +267 -0
  163. package/skills/security-culture-index/skills/interpreting-culture-index/workflows/compare-profiles.md +188 -0
  164. package/skills/security-culture-index/skills/interpreting-culture-index/workflows/define-hiring-profile.md +220 -0
  165. package/skills/security-culture-index/skills/interpreting-culture-index/workflows/detect-burnout.md +206 -0
  166. package/skills/security-culture-index/skills/interpreting-culture-index/workflows/extract-from-pdf.md +121 -0
  167. package/skills/security-culture-index/skills/interpreting-culture-index/workflows/interpret-individual.md +183 -0
  168. package/skills/security-culture-index/skills/interpreting-culture-index/workflows/interview-debrief.md +234 -0
  169. package/skills/security-culture-index/skills/interpreting-culture-index/workflows/mediate-conflict.md +306 -0
  170. package/skills/security-culture-index/skills/interpreting-culture-index/workflows/plan-onboarding.md +322 -0
  171. package/skills/security-culture-index/skills/interpreting-culture-index/workflows/predict-from-interview.md +250 -0
  172. package/skills/security-differential-review/.claude-plugin/plugin.json +10 -0
  173. package/skills/security-differential-review/README.md +109 -0
  174. package/skills/security-differential-review/commands/diff-review.md +21 -0
  175. package/skills/security-differential-review/skills/differential-review/SKILL.md +220 -0
  176. package/skills/security-differential-review/skills/differential-review/adversarial.md +203 -0
  177. package/skills/security-differential-review/skills/differential-review/methodology.md +234 -0
  178. package/skills/security-differential-review/skills/differential-review/patterns.md +300 -0
  179. package/skills/security-differential-review/skills/differential-review/reporting.md +369 -0
  180. package/skills/security-dwarf-expert/.claude-plugin/plugin.json +10 -0
  181. package/skills/security-dwarf-expert/README.md +38 -0
  182. package/skills/security-dwarf-expert/skills/dwarf-expert/SKILL.md +93 -0
  183. package/skills/security-dwarf-expert/skills/dwarf-expert/reference/coding.md +31 -0
  184. package/skills/security-dwarf-expert/skills/dwarf-expert/reference/dwarfdump.md +50 -0
  185. package/skills/security-dwarf-expert/skills/dwarf-expert/reference/readelf.md +8 -0
  186. package/skills/security-entry-point-analyzer/.claude-plugin/plugin.json +10 -0
  187. package/skills/security-entry-point-analyzer/README.md +74 -0
  188. package/skills/security-entry-point-analyzer/commands/entry-points.md +18 -0
  189. package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/SKILL.md +251 -0
  190. package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/cosmwasm.md +182 -0
  191. package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/move-aptos.md +107 -0
  192. package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/move-sui.md +87 -0
  193. package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/solana.md +155 -0
  194. package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/solidity.md +135 -0
  195. package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/ton.md +185 -0
  196. package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/vyper.md +141 -0
  197. package/skills/security-firebase-apk-scanner/.claude-plugin/plugin.json +10 -0
  198. package/skills/security-firebase-apk-scanner/README.md +85 -0
  199. package/skills/security-firebase-apk-scanner/commands/scan-apk.md +18 -0
  200. package/skills/security-firebase-apk-scanner/scanner.sh +1408 -0
  201. package/skills/security-firebase-apk-scanner/skills/firebase-apk-scanner/SKILL.md +197 -0
  202. package/skills/security-firebase-apk-scanner/skills/firebase-apk-scanner/references/vulnerabilities.md +803 -0
  203. package/skills/security-fix-review/.claude-plugin/plugin.json +13 -0
  204. package/skills/security-fix-review/README.md +118 -0
  205. package/skills/security-fix-review/commands/fix-review.md +24 -0
  206. package/skills/security-fix-review/skills/fix-review/SKILL.md +264 -0
  207. package/skills/security-fix-review/skills/fix-review/references/bug-detection.md +408 -0
  208. package/skills/security-fix-review/skills/fix-review/references/finding-matching.md +298 -0
  209. package/skills/security-fix-review/skills/fix-review/references/report-parsing.md +398 -0
  210. package/skills/security-insecure-defaults/.claude-plugin/plugin.json +10 -0
  211. package/skills/security-insecure-defaults/README.md +45 -0
  212. package/skills/security-insecure-defaults/skills/insecure-defaults/SKILL.md +117 -0
  213. package/skills/security-insecure-defaults/skills/insecure-defaults/references/examples.md +409 -0
  214. package/skills/security-modern-python/.claude-plugin/plugin.json +10 -0
  215. package/skills/security-modern-python/README.md +58 -0
  216. package/skills/security-modern-python/hooks/hooks.json +16 -0
  217. package/skills/security-modern-python/hooks/intercept-legacy-python.bats +388 -0
  218. package/skills/security-modern-python/hooks/intercept-legacy-python.sh +109 -0
  219. package/skills/security-modern-python/hooks/test_helper.bash +75 -0
  220. package/skills/security-modern-python/skills/modern-python/SKILL.md +333 -0
  221. package/skills/security-modern-python/skills/modern-python/references/dependabot.md +43 -0
  222. package/skills/security-modern-python/skills/modern-python/references/migration-checklist.md +141 -0
  223. package/skills/security-modern-python/skills/modern-python/references/pep723-scripts.md +259 -0
  224. package/skills/security-modern-python/skills/modern-python/references/prek.md +211 -0
  225. package/skills/security-modern-python/skills/modern-python/references/pyproject.md +254 -0
  226. package/skills/security-modern-python/skills/modern-python/references/ruff-config.md +240 -0
  227. package/skills/security-modern-python/skills/modern-python/references/security-setup.md +255 -0
  228. package/skills/security-modern-python/skills/modern-python/references/testing.md +284 -0
  229. package/skills/security-modern-python/skills/modern-python/references/uv-commands.md +200 -0
  230. package/skills/security-modern-python/skills/modern-python/templates/dependabot.yml +36 -0
  231. package/skills/security-modern-python/skills/modern-python/templates/pre-commit-config.yaml +66 -0
  232. package/skills/security-property-based-testing/.claude-plugin/plugin.json +9 -0
  233. package/skills/security-property-based-testing/README.md +47 -0
  234. package/skills/security-property-based-testing/skills/property-based-testing/README.md +88 -0
  235. package/skills/security-property-based-testing/skills/property-based-testing/SKILL.md +109 -0
  236. package/skills/security-property-based-testing/skills/property-based-testing/references/design.md +191 -0
  237. package/skills/security-property-based-testing/skills/property-based-testing/references/generating.md +200 -0
  238. package/skills/security-property-based-testing/skills/property-based-testing/references/libraries.md +130 -0
  239. package/skills/security-property-based-testing/skills/property-based-testing/references/refactoring.md +181 -0
  240. package/skills/security-property-based-testing/skills/property-based-testing/references/reviewing.md +209 -0
  241. package/skills/security-property-based-testing/skills/property-based-testing/references/strategies.md +124 -0
  242. package/skills/semgrep-rule-creator/.claude-plugin/plugin.json +8 -0
  243. package/skills/semgrep-rule-creator/README.md +43 -0
  244. package/skills/semgrep-rule-creator/commands/semgrep-rule.md +26 -0
  245. package/skills/semgrep-rule-creator/skills/semgrep-rule-creator/SKILL.md +168 -0
  246. package/skills/semgrep-rule-creator/skills/semgrep-rule-creator/references/quick-reference.md +203 -0
  247. package/skills/semgrep-rule-creator/skills/semgrep-rule-creator/references/workflow.md +240 -0
  248. package/skills/semgrep-rule-variant-creator/.claude-plugin/plugin.json +9 -0
  249. package/skills/semgrep-rule-variant-creator/README.md +86 -0
  250. package/skills/semgrep-rule-variant-creator/skills/semgrep-rule-variant-creator/SKILL.md +205 -0
  251. package/skills/semgrep-rule-variant-creator/skills/semgrep-rule-variant-creator/references/applicability-analysis.md +250 -0
  252. package/skills/semgrep-rule-variant-creator/skills/semgrep-rule-variant-creator/references/language-syntax-guide.md +324 -0
  253. package/skills/semgrep-rule-variant-creator/skills/semgrep-rule-variant-creator/references/workflow.md +518 -0
  254. package/skills/session-logs/SKILL.md +115 -0
  255. package/skills/sharp-edges/.claude-plugin/plugin.json +10 -0
  256. package/skills/sharp-edges/README.md +48 -0
  257. package/skills/sharp-edges/skills/sharp-edges/SKILL.md +292 -0
  258. package/skills/sharp-edges/skills/sharp-edges/references/auth-patterns.md +252 -0
  259. package/skills/sharp-edges/skills/sharp-edges/references/case-studies.md +274 -0
  260. package/skills/sharp-edges/skills/sharp-edges/references/config-patterns.md +333 -0
  261. package/skills/sharp-edges/skills/sharp-edges/references/crypto-apis.md +190 -0
  262. package/skills/sharp-edges/skills/sharp-edges/references/lang-c.md +205 -0
  263. package/skills/sharp-edges/skills/sharp-edges/references/lang-csharp.md +285 -0
  264. package/skills/sharp-edges/skills/sharp-edges/references/lang-go.md +270 -0
  265. package/skills/sharp-edges/skills/sharp-edges/references/lang-java.md +263 -0
  266. package/skills/sharp-edges/skills/sharp-edges/references/lang-javascript.md +269 -0
  267. package/skills/sharp-edges/skills/sharp-edges/references/lang-kotlin.md +265 -0
  268. package/skills/sharp-edges/skills/sharp-edges/references/lang-php.md +245 -0
  269. package/skills/sharp-edges/skills/sharp-edges/references/lang-python.md +274 -0
  270. package/skills/sharp-edges/skills/sharp-edges/references/lang-ruby.md +273 -0
  271. package/skills/sharp-edges/skills/sharp-edges/references/lang-rust.md +272 -0
  272. package/skills/sharp-edges/skills/sharp-edges/references/lang-swift.md +287 -0
  273. package/skills/sharp-edges/skills/sharp-edges/references/language-specific.md +588 -0
  274. package/skills/sherpa-onnx-tts/SKILL.md +103 -0
  275. package/skills/sherpa-onnx-tts/bin/sherpa-onnx-tts +178 -0
  276. package/skills/skill-creator/SKILL.md +370 -0
  277. package/skills/skill-creator/license.txt +202 -0
  278. package/skills/skill-creator/scripts/init_skill.py +378 -0
  279. package/skills/skill-creator/scripts/package_skill.py +111 -0
  280. package/skills/skill-creator/scripts/quick_validate.py +101 -0
  281. package/skills/slack/SKILL.md +144 -0
  282. package/skills/songsee/SKILL.md +49 -0
  283. package/skills/sonoscli/SKILL.md +46 -0
  284. package/skills/spec-to-code-compliance/.claude-plugin/plugin.json +10 -0
  285. package/skills/spec-to-code-compliance/README.md +67 -0
  286. package/skills/spec-to-code-compliance/commands/spec-compliance.md +22 -0
  287. package/skills/spec-to-code-compliance/skills/spec-to-code-compliance/SKILL.md +349 -0
  288. package/skills/spec-to-code-compliance/skills/spec-to-code-compliance/resources/COMPLETENESS_CHECKLIST.md +69 -0
  289. package/skills/spec-to-code-compliance/skills/spec-to-code-compliance/resources/IR_EXAMPLES.md +417 -0
  290. package/skills/spec-to-code-compliance/skills/spec-to-code-compliance/resources/OUTPUT_REQUIREMENTS.md +105 -0
  291. package/skills/spotify-player/SKILL.md +64 -0
  292. package/skills/static-analysis/.claude-plugin/plugin.json +8 -0
  293. package/skills/static-analysis/README.md +59 -0
  294. package/skills/static-analysis/skills/codeql/SKILL.md +315 -0
  295. package/skills/static-analysis/skills/sarif-parsing/SKILL.md +479 -0
  296. package/skills/static-analysis/skills/sarif-parsing/resources/jq-queries.md +162 -0
  297. package/skills/static-analysis/skills/sarif-parsing/resources/sarif_helpers.py +331 -0
  298. package/skills/static-analysis/skills/semgrep/SKILL.md +337 -0
  299. package/skills/summarize/SKILL.md +87 -0
  300. package/skills/testing-handbook-skills/.claude-plugin/plugin.json +8 -0
  301. package/skills/testing-handbook-skills/README.md +241 -0
  302. package/skills/testing-handbook-skills/scripts/pyproject.toml +8 -0
  303. package/skills/testing-handbook-skills/scripts/validate-skills.py +657 -0
  304. package/skills/testing-handbook-skills/skills/address-sanitizer/SKILL.md +341 -0
  305. package/skills/testing-handbook-skills/skills/aflpp/SKILL.md +640 -0
  306. package/skills/testing-handbook-skills/skills/atheris/SKILL.md +515 -0
  307. package/skills/testing-handbook-skills/skills/cargo-fuzz/SKILL.md +454 -0
  308. package/skills/testing-handbook-skills/skills/codeql/SKILL.md +549 -0
  309. package/skills/testing-handbook-skills/skills/constant-time-testing/SKILL.md +507 -0
  310. package/skills/testing-handbook-skills/skills/coverage-analysis/SKILL.md +607 -0
  311. package/skills/testing-handbook-skills/skills/fuzzing-dictionary/SKILL.md +297 -0
  312. package/skills/testing-handbook-skills/skills/fuzzing-obstacles/SKILL.md +426 -0
  313. package/skills/testing-handbook-skills/skills/harness-writing/SKILL.md +614 -0
  314. package/skills/testing-handbook-skills/skills/libafl/SKILL.md +625 -0
  315. package/skills/testing-handbook-skills/skills/libfuzzer/SKILL.md +795 -0
  316. package/skills/testing-handbook-skills/skills/ossfuzz/SKILL.md +426 -0
  317. package/skills/testing-handbook-skills/skills/ruzzy/SKILL.md +443 -0
  318. package/skills/testing-handbook-skills/skills/semgrep/SKILL.md +601 -0
  319. package/skills/testing-handbook-skills/skills/testing-handbook-generator/SKILL.md +372 -0
  320. package/skills/testing-handbook-skills/skills/testing-handbook-generator/agent-prompt.md +280 -0
  321. package/skills/testing-handbook-skills/skills/testing-handbook-generator/discovery.md +452 -0
  322. package/skills/testing-handbook-skills/skills/testing-handbook-generator/templates/domain-skill.md +504 -0
  323. package/skills/testing-handbook-skills/skills/testing-handbook-generator/templates/fuzzer-skill.md +454 -0
  324. package/skills/testing-handbook-skills/skills/testing-handbook-generator/templates/technique-skill.md +527 -0
  325. package/skills/testing-handbook-skills/skills/testing-handbook-generator/templates/tool-skill.md +366 -0
  326. package/skills/testing-handbook-skills/skills/testing-handbook-generator/testing.md +482 -0
  327. package/skills/testing-handbook-skills/skills/wycheproof/SKILL.md +533 -0
  328. package/skills/things-mac/SKILL.md +86 -0
  329. package/skills/tmux/SKILL.md +135 -0
  330. package/skills/tmux/scripts/find-sessions.sh +112 -0
  331. package/skills/tmux/scripts/wait-for-text.sh +83 -0
  332. package/skills/trello/SKILL.md +95 -0
  333. package/skills/variant-analysis/.claude-plugin/plugin.json +8 -0
  334. package/skills/variant-analysis/README.md +41 -0
  335. package/skills/variant-analysis/commands/variants.md +23 -0
  336. package/skills/variant-analysis/skills/variant-analysis/METHODOLOGY.md +327 -0
  337. package/skills/variant-analysis/skills/variant-analysis/SKILL.md +142 -0
  338. package/skills/variant-analysis/skills/variant-analysis/resources/codeql/cpp.ql +119 -0
  339. package/skills/variant-analysis/skills/variant-analysis/resources/codeql/go.ql +69 -0
  340. package/skills/variant-analysis/skills/variant-analysis/resources/codeql/java.ql +71 -0
  341. package/skills/variant-analysis/skills/variant-analysis/resources/codeql/javascript.ql +63 -0
  342. package/skills/variant-analysis/skills/variant-analysis/resources/codeql/python.ql +80 -0
  343. package/skills/variant-analysis/skills/variant-analysis/resources/semgrep/cpp.yaml +98 -0
  344. package/skills/variant-analysis/skills/variant-analysis/resources/semgrep/go.yaml +63 -0
  345. package/skills/variant-analysis/skills/variant-analysis/resources/semgrep/java.yaml +61 -0
  346. package/skills/variant-analysis/skills/variant-analysis/resources/semgrep/javascript.yaml +60 -0
  347. package/skills/variant-analysis/skills/variant-analysis/resources/semgrep/python.yaml +72 -0
  348. package/skills/variant-analysis/skills/variant-analysis/resources/variant-report-template.md +75 -0
  349. package/skills/video-frames/SKILL.md +46 -0
  350. package/skills/video-frames/scripts/frame.sh +81 -0
  351. package/skills/voice-call/SKILL.md +45 -0
  352. package/skills/wacli/SKILL.md +72 -0
  353. package/skills/weather/SKILL.md +54 -0
  354. package/skills/yara-authoring/.claude-plugin/plugin.json +9 -0
  355. package/skills/yara-authoring/README.md +131 -0
  356. package/skills/yara-authoring/skills/yara-rule-authoring/SKILL.md +645 -0
  357. package/skills/yara-authoring/skills/yara-rule-authoring/examples/MAL_Mac_ProtonRAT_Jan25.yar +99 -0
  358. package/skills/yara-authoring/skills/yara-rule-authoring/examples/MAL_NPM_SupplyChain_Jan25.yar +170 -0
  359. package/skills/yara-authoring/skills/yara-rule-authoring/examples/MAL_Win_Remcos_Jan25.yar +103 -0
  360. package/skills/yara-authoring/skills/yara-rule-authoring/examples/SUSP_CRX_SuspiciousPermissions.yar +134 -0
  361. package/skills/yara-authoring/skills/yara-rule-authoring/examples/SUSP_JS_Obfuscation_Jan25.yar +185 -0
  362. package/skills/yara-authoring/skills/yara-rule-authoring/references/crx-module.md +214 -0
  363. package/skills/yara-authoring/skills/yara-rule-authoring/references/dex-module.md +383 -0
  364. package/skills/yara-authoring/skills/yara-rule-authoring/references/performance.md +333 -0
  365. package/skills/yara-authoring/skills/yara-rule-authoring/references/strings.md +433 -0
  366. package/skills/yara-authoring/skills/yara-rule-authoring/references/style-guide.md +257 -0
  367. package/skills/yara-authoring/skills/yara-rule-authoring/references/testing.md +399 -0
  368. package/skills/yara-authoring/skills/yara-rule-authoring/scripts/atom_analyzer.py +526 -0
  369. package/skills/yara-authoring/skills/yara-rule-authoring/scripts/pyproject.toml +25 -0
  370. package/skills/yara-authoring/skills/yara-rule-authoring/scripts/yara_lint.py +631 -0
  371. package/skills/yara-authoring/skills/yara-rule-authoring/workflows/rule-development.md +493 -0
@@ -0,0 +1,1408 @@
1
+ #!/bin/bash
2
+
3
+ # Firebase APK Security Scanner v1.0 (macOS Compatible)
4
+ # Comprehensive Firebase misconfiguration detection
5
+ # Enhanced extraction from all possible locations
6
+
7
+ set -uo pipefail
8
+
9
+ # Colors for output
10
+ RED='\033[0;31m'
11
+ GREEN='\033[0;32m'
12
+ YELLOW='\033[1;33m'
13
+ BLUE='\033[0;34m'
14
+ # CYAN intentionally unused but kept for consistency with other color definitions
15
+ # shellcheck disable=SC2034
16
+ CYAN='\033[0;36m'
17
+ MAGENTA='\033[0;35m'
18
+ NC='\033[0m'
19
+
20
+ # Configuration
21
+ TIMEOUT_SECONDS=10
22
+ USER_AGENT="Mozilla/5.0 (Linux; Android 10) AppleWebKit/537.36"
23
+ WRITE_TEST_PATH="_firebase_security_test_$(date +%s)"
24
+
25
+ # Output directories
26
+ TIMESTAMP=$(date +%Y%m%d_%H%M%S)
27
+ OUTPUT_DIR="firebase_scan_${TIMESTAMP}"
28
+ DECOMPILED_DIR="${OUTPUT_DIR}/decompiled"
29
+ RESULTS_DIR="${OUTPUT_DIR}/results"
30
+ REPORT_FILE="${OUTPUT_DIR}/scan_report.txt"
31
+ JSON_REPORT="${OUTPUT_DIR}/scan_report.json"
32
+
33
+ # Counters
34
+ TOTAL_APKS=0
35
+ VULNERABLE_APKS=0
36
+ TOTAL_VULNS=0
37
+
38
+ # Common Cloud Function names to enumerate
39
+ COMMON_FUNCTIONS="addMessage sendMessage createUser deleteUser updateUser getUser getUsers login logout register signup signUp authenticate verify verifyEmail resetPassword changePassword sendNotification sendEmail processPayment createOrder getOrders updateOrder deleteOrder uploadFile getFile generateToken validateToken refreshToken getData setData syncData backup restore export import webhook callback api admin debug test healthcheck status createProfile updateProfile deleteProfile getProfile subscribe unsubscribe notify push analytics"
40
+
41
+ print_banner() {
42
+ echo ""
43
+ echo "╔═══════════════════════════════════════════════════════════╗"
44
+ echo "║ Firebase APK Security Scanner v1.0 ║"
45
+ echo "║ Auth | Database | Storage | Functions | Remote Config ║"
46
+ echo "║ For Authorized Security Research Only ║"
47
+ echo "╚═══════════════════════════════════════════════════════════╝"
48
+ echo ""
49
+ }
50
+
51
+ # All log functions write to stderr so they don't interfere with function return values
52
+ log_info() { printf "${BLUE}[INFO]${NC} %s\n" "$1" >&2; }
53
+ log_success() { printf "${GREEN}[+]${NC} %s\n" "$1" >&2; }
54
+ log_warning() { printf "${YELLOW}[!]${NC} %s\n" "$1" >&2; }
55
+ log_error() { printf "${RED}[-]${NC} %s\n" "$1" >&2; }
56
+ log_vuln() {
57
+ printf "${RED}[VULN]${NC} %s\n" "$1" >&2
58
+ TOTAL_VULNS=$((TOTAL_VULNS + 1))
59
+ }
60
+ log_section() { printf "${MAGENTA}[*]${NC} %s\n" "$1" >&2; }
61
+
62
+ check_dependencies() {
63
+ log_info "Checking dependencies..."
64
+ local missing=""
65
+
66
+ for cmd in apktool curl jq grep unzip sed awk strings; do
67
+ if ! command -v "$cmd" >/dev/null 2>&1; then
68
+ missing="$missing $cmd"
69
+ fi
70
+ done
71
+
72
+ if [ -n "$missing" ]; then
73
+ log_error "Missing dependencies:$missing"
74
+ echo "Install with:"
75
+ echo " macOS: brew install apktool curl jq binutils"
76
+ echo " Ubuntu/Debian: sudo apt install apktool curl jq unzip binutils"
77
+ exit 1
78
+ fi
79
+
80
+ log_success "All dependencies found"
81
+ }
82
+
83
+ setup_directories() {
84
+ mkdir -p "$DECOMPILED_DIR" "$RESULTS_DIR"
85
+ log_info "Output directory: $OUTPUT_DIR"
86
+ }
87
+
88
+ # Helper: Convert string to JSON array
89
+ to_json_array() {
90
+ local input="$1"
91
+ if [ -z "$input" ]; then
92
+ echo "[]"
93
+ return
94
+ fi
95
+ echo "$input" | tr ' ' '\n' | grep -v '^$' | sort -u | jq -R . | jq -s .
96
+ }
97
+
98
+ # Extract strings directly from raw APK (DEX files, etc.)
99
+ extract_from_raw_apk() {
100
+ local apk_path="$1"
101
+ local temp_dir="$2"
102
+
103
+ log_info "Extracting strings from raw APK/DEX files..."
104
+
105
+ local raw_strings=""
106
+
107
+ # Extract and search DEX files
108
+ local dex_dir="${temp_dir}/_raw_dex"
109
+ mkdir -p "$dex_dir"
110
+
111
+ # Unzip DEX files
112
+ unzip -q -o "$apk_path" "*.dex" -d "$dex_dir" 2>/dev/null || true
113
+ unzip -q -o "$apk_path" "assets/*" -d "$dex_dir" 2>/dev/null || true
114
+ unzip -q -o "$apk_path" "res/raw/*" -d "$dex_dir" 2>/dev/null || true
115
+
116
+ # Search in DEX files using strings command
117
+ for dex_file in "$dex_dir"/*.dex; do
118
+ [ -f "$dex_file" ] || continue
119
+ raw_strings="$raw_strings $(strings "$dex_file" 2>/dev/null || true)"
120
+ done
121
+
122
+ # Search in assets (for hybrid apps)
123
+ if [ -d "${dex_dir}/assets" ]; then
124
+ while IFS= read -r asset_file; do
125
+ raw_strings="$raw_strings $(strings "$asset_file" 2>/dev/null || true)"
126
+ done < <(find "${dex_dir}/assets" -type f 2>/dev/null)
127
+ fi
128
+
129
+ # Search in raw resources
130
+ if [ -d "${dex_dir}/res/raw" ]; then
131
+ while IFS= read -r raw_file; do
132
+ raw_strings="$raw_strings $(cat "$raw_file" 2>/dev/null || true)"
133
+ done < <(find "${dex_dir}/res/raw" -type f 2>/dev/null)
134
+ fi
135
+
136
+ # Cleanup
137
+ rm -rf "$dex_dir"
138
+
139
+ echo "$raw_strings"
140
+ }
141
+
142
+ # Comprehensive Firebase config extraction
143
+ extract_firebase_config() {
144
+ local apk_dir="$1"
145
+ local apk_path="$2"
146
+ local config_file="${apk_dir}/firebase_config.json"
147
+
148
+ local project_ids=""
149
+ local db_urls=""
150
+ local storage_buckets=""
151
+ local api_keys=""
152
+ local auth_domains=""
153
+ local function_names=""
154
+ local messaging_sender_ids=""
155
+
156
+ log_info "Phase 1: Searching decompiled resources..."
157
+
158
+ #=========================================================================
159
+ # PHASE 1: google-services.json
160
+ #=========================================================================
161
+ local gs_json
162
+ gs_json=$(find "$apk_dir" -name "google-services.json" 2>/dev/null | head -1)
163
+ if [ -n "$gs_json" ] && [ -f "$gs_json" ]; then
164
+ log_info "Found google-services.json"
165
+
166
+ local proj_id
167
+ proj_id=$(jq -r '.project_info.project_id // empty' "$gs_json" 2>/dev/null || true)
168
+ [ -n "$proj_id" ] && project_ids="$project_ids $proj_id"
169
+
170
+ local fb_url
171
+ fb_url=$(jq -r '.project_info.firebase_url // empty' "$gs_json" 2>/dev/null || true)
172
+ [ -n "$fb_url" ] && db_urls="$db_urls $fb_url"
173
+
174
+ local bucket
175
+ bucket=$(jq -r '.project_info.storage_bucket // empty' "$gs_json" 2>/dev/null || true)
176
+ [ -n "$bucket" ] && storage_buckets="$storage_buckets $bucket"
177
+
178
+ local api_key
179
+ api_key=$(jq -r '.client[0].api_key[0].current_key // empty' "$gs_json" 2>/dev/null || true)
180
+ [ -n "$api_key" ] && api_keys="$api_keys $api_key"
181
+
182
+ local sender_id
183
+ sender_id=$(jq -r '.project_info.project_number // empty' "$gs_json" 2>/dev/null || true)
184
+ [ -n "$sender_id" ] && messaging_sender_ids="$messaging_sender_ids $sender_id"
185
+ fi
186
+
187
+ #=========================================================================
188
+ # PHASE 2: All XML resource files (strings.xml, values.xml, etc.)
189
+ #=========================================================================
190
+ log_info "Phase 2: Searching XML resources..."
191
+
192
+ # Find all XML files in res/values*
193
+ while IFS= read -r xml_file; do
194
+ [ -f "$xml_file" ] || continue
195
+
196
+ # Firebase Database URLs
197
+ local xml_db
198
+ xml_db=$(grep -oE 'https://[^"<>]+\.firebaseio\.com[^"<>]*' "$xml_file" 2>/dev/null | tr '\n' ' ' || true)
199
+ db_urls="$db_urls $xml_db"
200
+
201
+ # Storage buckets (appspot format)
202
+ local xml_bucket
203
+ xml_bucket=$(grep -oE '[a-zA-Z0-9_-]+\.appspot\.com' "$xml_file" 2>/dev/null | tr '\n' ' ' || true)
204
+ storage_buckets="$storage_buckets $xml_bucket"
205
+
206
+ # API Keys from XML
207
+ local xml_keys
208
+ xml_keys=$(grep -oE 'AIza[A-Za-z0-9_-]{35}' "$xml_file" 2>/dev/null | tr '\n' ' ' || true)
209
+ api_keys="$api_keys $xml_keys"
210
+
211
+ # Project IDs from firebase_database_url or project_id entries
212
+ local xml_proj
213
+ xml_proj=$(grep -oE 'https://([a-zA-Z0-9_-]+)\.firebaseio\.com' "$xml_file" 2>/dev/null | sed 's|https://||;s|\.firebaseio\.com||' | tr '\n' ' ' || true)
214
+ project_ids="$project_ids $xml_proj"
215
+
216
+ # GCM/FCM Sender IDs
217
+ local xml_sender
218
+ xml_sender=$(grep -oE 'gcm_defaultSenderId[^>]*>[0-9]+' "$xml_file" 2>/dev/null | grep -oE '[0-9]{10,}' | tr '\n' ' ' || true)
219
+ messaging_sender_ids="$messaging_sender_ids $xml_sender"
220
+
221
+ # Auth domains
222
+ local xml_auth
223
+ xml_auth=$(grep -oE '[a-zA-Z0-9_-]+\.firebaseapp\.com' "$xml_file" 2>/dev/null | tr '\n' ' ' || true)
224
+ auth_domains="$auth_domains $xml_auth"
225
+ done < <(find "$apk_dir" -path "*/res/values*" -name "*.xml" 2>/dev/null)
226
+
227
+ #=========================================================================
228
+ # PHASE 3: AndroidManifest.xml
229
+ #=========================================================================
230
+ log_info "Phase 3: Searching AndroidManifest.xml..."
231
+
232
+ local manifest="${apk_dir}/AndroidManifest.xml"
233
+ if [ -f "$manifest" ]; then
234
+ local manifest_keys
235
+ manifest_keys=$(grep -oE 'AIza[A-Za-z0-9_-]{35}' "$manifest" 2>/dev/null | tr '\n' ' ' || true)
236
+ api_keys="$api_keys $manifest_keys"
237
+
238
+ # Note: Project IDs in manifest are extracted via other patterns
239
+ fi
240
+
241
+ #=========================================================================
242
+ # PHASE 4: Assets folder (hybrid apps - React Native, Flutter, Cordova)
243
+ #=========================================================================
244
+ log_info "Phase 4: Searching assets (hybrid app configs)..."
245
+
246
+ local assets_dir="${apk_dir}/assets"
247
+ if [ -d "$assets_dir" ]; then
248
+ # Search all files in assets
249
+ while IFS= read -r asset_file; do
250
+ [ -f "$asset_file" ] || continue
251
+
252
+ # Firebase URLs
253
+ local asset_db
254
+ asset_db=$(grep -oE 'https://[a-zA-Z0-9_-]+\.firebaseio\.com' "$asset_file" 2>/dev/null | tr '\n' ' ' || true)
255
+ db_urls="$db_urls $asset_db"
256
+
257
+ # Storage buckets (both formats)
258
+ local asset_bucket
259
+ asset_bucket=$(grep -oE '[a-zA-Z0-9_-]+\.appspot\.com' "$asset_file" 2>/dev/null | tr '\n' ' ' || true)
260
+ storage_buckets="$storage_buckets $asset_bucket"
261
+
262
+ # gs:// format storage URLs
263
+ local asset_gs
264
+ asset_gs=$(grep -oE 'gs://[a-zA-Z0-9_-]+' "$asset_file" 2>/dev/null | sed 's|gs://||' | tr '\n' ' ' || true)
265
+ storage_buckets="$storage_buckets $asset_gs"
266
+
267
+ # API Keys
268
+ local asset_keys
269
+ asset_keys=$(grep -oE 'AIza[A-Za-z0-9_-]{35}' "$asset_file" 2>/dev/null | tr '\n' ' ' || true)
270
+ api_keys="$api_keys $asset_keys"
271
+
272
+ # Auth domains
273
+ local asset_auth
274
+ asset_auth=$(grep -oE '[a-zA-Z0-9_-]+\.firebaseapp\.com' "$asset_file" 2>/dev/null | tr '\n' ' ' || true)
275
+ auth_domains="$auth_domains $asset_auth"
276
+
277
+ # Cloud Functions URLs
278
+ local asset_funcs
279
+ asset_funcs=$(grep -oE '[a-z0-9-]+\.cloudfunctions\.net/[a-zA-Z0-9_-]+' "$asset_file" 2>/dev/null | sed 's|.*cloudfunctions.net/||' | tr '\n' ' ' || true)
280
+ function_names="$function_names $asset_funcs"
281
+
282
+ # Firestore project references
283
+ local asset_proj
284
+ asset_proj=$(grep -oE 'projectId["\x27: ]+[a-zA-Z0-9_-]+' "$asset_file" 2>/dev/null | sed 's/.*["\x27: ]//' | tr '\n' ' ' || true)
285
+ project_ids="$project_ids $asset_proj"
286
+ done < <(find "$assets_dir" -type f 2>/dev/null)
287
+
288
+ # Specifically check for common hybrid app config files
289
+ for config_name in "firebase_config.json" "config.json" "app.config.json" "firebase.json" "google-services.json" "firebaseConfig.js" "firebase-config.js"; do
290
+ local config_path
291
+ config_path=$(find "$assets_dir" -name "$config_name" 2>/dev/null | head -1)
292
+ if [ -n "$config_path" ] && [ -f "$config_path" ]; then
293
+ log_info "Found hybrid app config: $config_name"
294
+
295
+ local cfg_keys
296
+ cfg_keys=$(grep -oE 'AIza[A-Za-z0-9_-]{35}' "$config_path" 2>/dev/null | tr '\n' ' ' || true)
297
+ api_keys="$api_keys $cfg_keys"
298
+
299
+ local cfg_db
300
+ cfg_db=$(grep -oE 'https://[a-zA-Z0-9_-]+\.firebaseio\.com' "$config_path" 2>/dev/null | tr '\n' ' ' || true)
301
+ db_urls="$db_urls $cfg_db"
302
+ fi
303
+ done
304
+
305
+ # Flutter specific: look in flutter_assets
306
+ if [ -d "${assets_dir}/flutter_assets" ]; then
307
+ log_info "Flutter app detected - searching flutter_assets..."
308
+ while IFS= read -r flutter_file; do
309
+ local flutter_keys
310
+ flutter_keys=$(strings "$flutter_file" 2>/dev/null | grep -oE 'AIza[A-Za-z0-9_-]{35}' | tr '\n' ' ' || true)
311
+ api_keys="$api_keys $flutter_keys"
312
+
313
+ local flutter_db
314
+ flutter_db=$(strings "$flutter_file" 2>/dev/null | grep -oE 'https://[a-zA-Z0-9_-]+\.firebaseio\.com' | tr '\n' ' ' || true)
315
+ db_urls="$db_urls $flutter_db"
316
+ done < <(find "${assets_dir}/flutter_assets" -type f 2>/dev/null)
317
+ fi
318
+ fi
319
+
320
+ #=========================================================================
321
+ # PHASE 5: res/raw folder
322
+ #=========================================================================
323
+ log_info "Phase 5: Searching res/raw resources..."
324
+
325
+ local raw_dir="${apk_dir}/res/raw"
326
+ if [ -d "$raw_dir" ]; then
327
+ while IFS= read -r raw_file; do
328
+ local raw_keys
329
+ raw_keys=$(grep -oE 'AIza[A-Za-z0-9_-]{35}' "$raw_file" 2>/dev/null | tr '\n' ' ' || true)
330
+ api_keys="$api_keys $raw_keys"
331
+
332
+ local raw_db
333
+ raw_db=$(grep -oE 'https://[a-zA-Z0-9_-]+\.firebaseio\.com' "$raw_file" 2>/dev/null | tr '\n' ' ' || true)
334
+ db_urls="$db_urls $raw_db"
335
+ done < <(find "$raw_dir" -type f 2>/dev/null)
336
+ fi
337
+
338
+ #=========================================================================
339
+ # PHASE 6: Smali code (decompiled DEX)
340
+ #=========================================================================
341
+ log_info "Phase 6: Searching smali code..."
342
+
343
+ local smali_dirs
344
+ smali_dirs=$(find "$apk_dir" -type d -name "smali*" 2>/dev/null)
345
+ for smali_dir in $smali_dirs; do
346
+ [ -d "$smali_dir" ] || continue
347
+
348
+ # Search for const-string declarations with Firebase URLs
349
+ local smali_db
350
+ smali_db=$(grep -r -h "const-string" "$smali_dir" 2>/dev/null | grep -oE 'https://[a-zA-Z0-9_-]+\.firebaseio\.com' | tr '\n' ' ' || true)
351
+ db_urls="$db_urls $smali_db"
352
+
353
+ # gs:// storage references in smali
354
+ local smali_gs
355
+ smali_gs=$(grep -r -h "gs://" "$smali_dir" 2>/dev/null | grep -oE 'gs://[a-zA-Z0-9_-]+' | sed 's|gs://||' | tr '\n' ' ' || true)
356
+ storage_buckets="$storage_buckets $smali_gs"
357
+
358
+ # API Keys in smali
359
+ local smali_keys
360
+ smali_keys=$(grep -r -h 'AIza[A-Za-z0-9_-]\{35\}' "$smali_dir" 2>/dev/null | grep -oE 'AIza[A-Za-z0-9_-]{35}' | tr '\n' ' ' || true)
361
+ api_keys="$api_keys $smali_keys"
362
+
363
+ # Cloud Functions URLs
364
+ local smali_funcs
365
+ smali_funcs=$(grep -r -h "cloudfunctions.net" "$smali_dir" 2>/dev/null | grep -oE 'cloudfunctions\.net/[a-zA-Z0-9_-]+' | sed 's|cloudfunctions.net/||' | tr '\n' ' ' || true)
366
+ function_names="$function_names $smali_funcs"
367
+
368
+ # httpsCallable function names
369
+ local smali_callable
370
+ smali_callable=$(grep -r -h "httpsCallable" "$smali_dir" 2>/dev/null | grep -oE '"[a-zA-Z0-9_-]+"' | tr -d '"' | tr '\n' ' ' || true)
371
+ function_names="$function_names $smali_callable"
372
+ done
373
+
374
+ #=========================================================================
375
+ # PHASE 7: Raw APK extraction (strings from DEX)
376
+ #=========================================================================
377
+ if [ -n "$apk_path" ] && [ -f "$apk_path" ]; then
378
+ log_info "Phase 7: Extracting strings from raw APK..."
379
+
380
+ local raw_strings
381
+ raw_strings=$(extract_from_raw_apk "$apk_path" "$apk_dir")
382
+
383
+ # Extract from raw strings
384
+ local raw_db
385
+ raw_db=$(echo "$raw_strings" | grep -oE 'https://[a-zA-Z0-9_-]+\.firebaseio\.com' | tr '\n' ' ' || true)
386
+ db_urls="$db_urls $raw_db"
387
+
388
+ local raw_gs
389
+ raw_gs=$(echo "$raw_strings" | grep -oE 'gs://[a-zA-Z0-9_-]+' | sed 's|gs://||' | tr '\n' ' ' || true)
390
+ storage_buckets="$storage_buckets $raw_gs"
391
+
392
+ local raw_bucket
393
+ raw_bucket=$(echo "$raw_strings" | grep -oE '[a-zA-Z0-9_-]+\.appspot\.com' | tr '\n' ' ' || true)
394
+ storage_buckets="$storage_buckets $raw_bucket"
395
+
396
+ local raw_keys
397
+ raw_keys=$(echo "$raw_strings" | grep -oE 'AIza[A-Za-z0-9_-]{35}' | tr '\n' ' ' || true)
398
+ api_keys="$api_keys $raw_keys"
399
+
400
+ local raw_auth
401
+ raw_auth=$(echo "$raw_strings" | grep -oE '[a-zA-Z0-9_-]+\.firebaseapp\.com' | tr '\n' ' ' || true)
402
+ auth_domains="$auth_domains $raw_auth"
403
+
404
+ local raw_funcs
405
+ raw_funcs=$(echo "$raw_strings" | grep -oE '[a-z0-9-]+\.cloudfunctions\.net' | tr '\n' ' ' || true)
406
+ # Extract project IDs from function URLs
407
+ for func_url in $raw_funcs; do
408
+ local func_proj
409
+ func_proj=$(echo "$func_url" | sed 's|\.cloudfunctions\.net||' | sed 's|-[a-z0-9]*$||' || true)
410
+ [ -n "$func_proj" ] && project_ids="$project_ids $func_proj"
411
+ done
412
+ fi
413
+
414
+ #=========================================================================
415
+ # PHASE 8: Deep recursive search (fallback)
416
+ #=========================================================================
417
+ log_info "Phase 8: Deep recursive search..."
418
+
419
+ # Catch anything we might have missed
420
+ local deep_db
421
+ deep_db=$(grep -r -oh 'https://[a-zA-Z0-9_-]*\.firebaseio\.com' "$apk_dir" 2>/dev/null | sort -u | tr '\n' ' ' || true)
422
+ db_urls="$db_urls $deep_db"
423
+
424
+ local deep_gs
425
+ deep_gs=$(grep -r -oh 'gs://[a-zA-Z0-9_-]*' "$apk_dir" 2>/dev/null | sed 's|gs://||' | sort -u | tr '\n' ' ' || true)
426
+ storage_buckets="$storage_buckets $deep_gs"
427
+
428
+ local deep_bucket
429
+ deep_bucket=$(grep -r -ohE '[a-zA-Z0-9_-]+\.appspot\.com' "$apk_dir" 2>/dev/null | sort -u | tr '\n' ' ' || true)
430
+ storage_buckets="$storage_buckets $deep_bucket"
431
+
432
+ local deep_keys
433
+ deep_keys=$(grep -r -ohE 'AIza[A-Za-z0-9_-]{35}' "$apk_dir" 2>/dev/null | sort -u | tr '\n' ' ' || true)
434
+ api_keys="$api_keys $deep_keys"
435
+
436
+ local deep_auth
437
+ deep_auth=$(grep -r -ohE '[a-zA-Z0-9_-]+\.firebaseapp\.com' "$apk_dir" 2>/dev/null | sort -u | tr '\n' ' ' || true)
438
+ auth_domains="$auth_domains $deep_auth"
439
+
440
+ local deep_firestore
441
+ deep_firestore=$(grep -r -oh 'firestore\.googleapis\.com/v1/projects/[a-zA-Z0-9_-]*' "$apk_dir" 2>/dev/null | sed 's|.*projects/||' | sort -u | tr '\n' ' ' || true)
442
+ project_ids="$project_ids $deep_firestore"
443
+
444
+ local deep_funcs_url
445
+ deep_funcs_url=$(grep -r -ohE '[a-z0-9-]+\.cloudfunctions\.net/[a-zA-Z0-9_-]+' "$apk_dir" 2>/dev/null | sort -u || true)
446
+ for func_url in $deep_funcs_url; do
447
+ local fname
448
+ fname="${func_url##*cloudfunctions.net/}"
449
+ [ -n "$fname" ] && function_names="$function_names $fname"
450
+ done
451
+
452
+ #=========================================================================
453
+ # Derive project IDs from other extracted data
454
+ #=========================================================================
455
+ log_info "Deriving project IDs from extracted URLs..."
456
+
457
+ # From database URLs
458
+ for url in $db_urls; do
459
+ local proj
460
+ proj="${url#https://}"
461
+ proj="${proj%%.*}"
462
+ [ -n "$proj" ] && [ "$proj" != "$url" ] && project_ids="$project_ids $proj"
463
+ done
464
+
465
+ # From auth domains
466
+ for domain in $auth_domains; do
467
+ local proj
468
+ proj="${domain%.firebaseapp.com}"
469
+ [ -n "$proj" ] && project_ids="$project_ids $proj"
470
+ done
471
+
472
+ # From storage buckets
473
+ for bucket in $storage_buckets; do
474
+ local proj
475
+ proj="${bucket%.appspot.com}"
476
+ [ -n "$proj" ] && project_ids="$project_ids $proj"
477
+ done
478
+
479
+ #=========================================================================
480
+ # Clean up and deduplicate
481
+ #=========================================================================
482
+ log_info "Deduplicating results..."
483
+
484
+ project_ids=$(echo "$project_ids" | tr ' ' '\n' | grep -v '^$' | grep -v '^https' | sort -u | tr '\n' ' ')
485
+ db_urls=$(echo "$db_urls" | tr ' ' '\n' | grep -v '^$' | sort -u | tr '\n' ' ')
486
+ storage_buckets=$(echo "$storage_buckets" | tr ' ' '\n' | grep -v '^$' | grep -v '^gs$' | sort -u | tr '\n' ' ')
487
+ api_keys=$(echo "$api_keys" | tr ' ' '\n' | grep -v '^$' | sort -u | tr '\n' ' ')
488
+ auth_domains=$(echo "$auth_domains" | tr ' ' '\n' | grep -v '^$' | sort -u | tr '\n' ' ')
489
+ function_names=$(echo "$function_names" | tr ' ' '\n' | grep -v '^$' | sort -u | tr '\n' ' ')
490
+ messaging_sender_ids=$(echo "$messaging_sender_ids" | tr ' ' '\n' | grep -v '^$' | sort -u | tr '\n' ' ')
491
+
492
+ # Build JSON config
493
+ cat >"$config_file" <<EOF
494
+ {
495
+ "project_ids": $(to_json_array "$project_ids"),
496
+ "database_urls": $(to_json_array "$db_urls"),
497
+ "storage_buckets": $(to_json_array "$storage_buckets"),
498
+ "api_keys": $(to_json_array "$api_keys"),
499
+ "auth_domains": $(to_json_array "$auth_domains"),
500
+ "function_names": $(to_json_array "$function_names"),
501
+ "messaging_sender_ids": $(to_json_array "$messaging_sender_ids")
502
+ }
503
+ EOF
504
+
505
+ echo "$config_file"
506
+ }
507
+
508
+ #=============================================================================
509
+ # FIREBASE AUTHENTICATION TESTS
510
+ #=============================================================================
511
+
512
+ test_auth_signup_enabled() {
513
+ local api_key="$1"
514
+ local result_file="$2"
515
+
516
+ log_info "Testing Auth: Open Signup via Identity Toolkit API"
517
+
518
+ local test_email
519
+ test_email="firebasescanner_test_$(date +%s)@test-domain-nonexistent.com"
520
+ local test_password="TestPassword123!"
521
+
522
+ local response
523
+ response=$(curl -s --max-time "$TIMEOUT_SECONDS" \
524
+ -X POST \
525
+ -H "Content-Type: application/json" \
526
+ "https://identitytoolkit.googleapis.com/v1/accounts:signUp?key=${api_key}" \
527
+ -d "{\"email\":\"${test_email}\",\"password\":\"${test_password}\",\"returnSecureToken\":true}" \
528
+ 2>/dev/null || echo '{"error":{}}')
529
+
530
+ if echo "$response" | grep -q '"idToken"'; then
531
+ log_vuln "AUTH SIGNUP OPEN: Can create accounts via API"
532
+ echo "VULNERABLE" >"$result_file"
533
+
534
+ local id_token
535
+ id_token=$(echo "$response" | jq -r '.idToken // empty' 2>/dev/null || true)
536
+ echo "Created test account: $test_email" >>"$result_file"
537
+ echo "ID_TOKEN:$id_token" >>"$result_file"
538
+
539
+ # Cleanup
540
+ if [ -n "$id_token" ]; then
541
+ curl -s --max-time 5 \
542
+ -X POST \
543
+ -H "Content-Type: application/json" \
544
+ "https://identitytoolkit.googleapis.com/v1/accounts:delete?key=${api_key}" \
545
+ -d "{\"idToken\":\"${id_token}\"}" >/dev/null 2>&1 || true
546
+ fi
547
+ return 0
548
+ elif echo "$response" | grep -q "ADMIN_ONLY_OPERATION\|OPERATION_NOT_ALLOWED"; then
549
+ log_success "Auth signup properly restricted"
550
+ echo "PROTECTED" >"$result_file"
551
+ elif echo "$response" | grep -q "API_KEY_INVALID\|API key not valid"; then
552
+ log_warning "Invalid API key"
553
+ echo "INVALID_KEY" >"$result_file"
554
+ else
555
+ log_warning "Auth signup status unclear"
556
+ echo "UNKNOWN" >"$result_file"
557
+ fi
558
+
559
+ return 1
560
+ }
561
+
562
+ test_auth_anonymous() {
563
+ local api_key="$1"
564
+ local result_file="$2"
565
+
566
+ log_info "Testing Auth: Anonymous Sign-in"
567
+
568
+ local response
569
+ response=$(curl -s --max-time "$TIMEOUT_SECONDS" \
570
+ -X POST \
571
+ -H "Content-Type: application/json" \
572
+ "https://identitytoolkit.googleapis.com/v1/accounts:signUp?key=${api_key}" \
573
+ -d '{"returnSecureToken":true}' \
574
+ 2>/dev/null || echo '{"error":{}}')
575
+
576
+ if echo "$response" | grep -q '"idToken"'; then
577
+ log_vuln "ANONYMOUS AUTH ENABLED: Can sign in anonymously"
578
+ echo "VULNERABLE" >"$result_file"
579
+
580
+ local id_token
581
+ id_token=$(echo "$response" | jq -r '.idToken // empty' 2>/dev/null || true)
582
+ local local_id
583
+ local_id=$(echo "$response" | jq -r '.localId // empty' 2>/dev/null || true)
584
+ echo "Anonymous UID: $local_id" >>"$result_file"
585
+ echo "ID_TOKEN:$id_token" >>"$result_file"
586
+ return 0
587
+ else
588
+ log_success "Anonymous auth disabled or restricted"
589
+ echo "PROTECTED" >"$result_file"
590
+ fi
591
+
592
+ return 1
593
+ }
594
+
595
+ test_auth_email_enumeration() {
596
+ local api_key="$1"
597
+ local result_file="$2"
598
+
599
+ log_info "Testing Auth: Email Enumeration"
600
+
601
+ local fake_email
602
+ fake_email="definitely_not_exists_$(date +%s)@nonexistent-domain-test.com"
603
+
604
+ local response
605
+ response=$(curl -s --max-time "$TIMEOUT_SECONDS" \
606
+ -X POST \
607
+ -H "Content-Type: application/json" \
608
+ "https://identitytoolkit.googleapis.com/v1/accounts:createAuthUri?key=${api_key}" \
609
+ -d "{\"identifier\":\"${fake_email}\",\"continueUri\":\"https://localhost\"}" \
610
+ 2>/dev/null || echo '{"error":{}}')
611
+
612
+ if echo "$response" | grep -q '"registered"'; then
613
+ log_vuln "EMAIL ENUMERATION: API reveals if emails are registered"
614
+ echo "VULNERABLE" >"$result_file"
615
+ return 0
616
+ fi
617
+
618
+ log_success "Email enumeration protected"
619
+ echo "PROTECTED" >"$result_file"
620
+ return 1
621
+ }
622
+
623
+ #=============================================================================
624
+ # DATABASE TESTS
625
+ #=============================================================================
626
+
627
+ test_rtdb_read() {
628
+ local db_url="$1"
629
+ local result_file="$2"
630
+
631
+ # Normalize URL
632
+ db_url="${db_url%/}"
633
+ if ! echo "$db_url" | grep -q '^https://'; then
634
+ db_url="https://$db_url"
635
+ fi
636
+
637
+ log_info "Testing RTDB read: $db_url"
638
+
639
+ local response
640
+ local http_code
641
+ local body
642
+
643
+ response=$(curl -s -w "\nHTTP_CODE:%{http_code}" --max-time "$TIMEOUT_SECONDS" \
644
+ -H "User-Agent: $USER_AGENT" \
645
+ "${db_url}/.json" 2>/dev/null || echo -e "\nHTTP_CODE:000")
646
+
647
+ http_code=$(echo "$response" | grep "HTTP_CODE:" | sed 's/HTTP_CODE://')
648
+ body=$(echo "$response" | grep -v "HTTP_CODE:")
649
+
650
+ if [ "$http_code" = "200" ] && [ "$body" != "null" ] && [ -n "$body" ]; then
651
+ log_vuln "RTDB READ OPEN: $db_url"
652
+ echo "VULNERABLE" >"$result_file"
653
+ echo "$body" | head -c 500 >>"$result_file"
654
+ return 0
655
+ elif echo "$body" | grep -q "Permission denied"; then
656
+ log_success "RTDB read protected"
657
+ echo "PROTECTED" >"$result_file"
658
+ else
659
+ echo "UNKNOWN:$http_code" >"$result_file"
660
+ fi
661
+
662
+ return 1
663
+ }
664
+
665
+ test_rtdb_write() {
666
+ local db_url="$1"
667
+ local result_file="$2"
668
+
669
+ db_url="${db_url%/}"
670
+ if ! echo "$db_url" | grep -q '^https://'; then
671
+ db_url="https://$db_url"
672
+ fi
673
+
674
+ log_info "Testing RTDB write: $db_url"
675
+
676
+ local test_data
677
+ test_data="{\"security_test\":\"firebase_scanner\",\"timestamp\":$(date +%s)}"
678
+ local response
679
+
680
+ response=$(curl -s --max-time "$TIMEOUT_SECONDS" \
681
+ -X PUT \
682
+ -H "Content-Type: application/json" \
683
+ -H "User-Agent: $USER_AGENT" \
684
+ -d "$test_data" \
685
+ "${db_url}/${WRITE_TEST_PATH}.json" 2>/dev/null || echo '{}')
686
+
687
+ if echo "$response" | grep -q "security_test"; then
688
+ log_vuln "RTDB WRITE OPEN: $db_url"
689
+ echo "VULNERABLE" >"$result_file"
690
+ curl -s -X DELETE "${db_url}/${WRITE_TEST_PATH}.json" --max-time 5 >/dev/null 2>&1 || true
691
+ return 0
692
+ fi
693
+
694
+ echo "PROTECTED" >"$result_file"
695
+ return 1
696
+ }
697
+
698
+ test_rtdb_authenticated() {
699
+ local db_url="$1"
700
+ local id_token="$2"
701
+ local result_file="$3"
702
+
703
+ db_url="${db_url%/}"
704
+ if ! echo "$db_url" | grep -q '^https://'; then
705
+ db_url="https://$db_url"
706
+ fi
707
+
708
+ log_info "Testing RTDB with auth token"
709
+
710
+ local response
711
+ response=$(curl -s --max-time "$TIMEOUT_SECONDS" \
712
+ -H "User-Agent: $USER_AGENT" \
713
+ "${db_url}/.json?auth=${id_token}" 2>/dev/null || echo '{}')
714
+
715
+ if [ -n "$response" ] && [ "$response" != "null" ] && ! echo "$response" | grep -q "Permission denied"; then
716
+ log_vuln "RTDB ACCESSIBLE WITH AUTH TOKEN"
717
+ echo "VULNERABLE" >"$result_file"
718
+ echo "$response" | head -c 500 >>"$result_file"
719
+ return 0
720
+ fi
721
+
722
+ echo "PROTECTED" >"$result_file"
723
+ return 1
724
+ }
725
+
726
+ test_firestore_read() {
727
+ local project_id="$1"
728
+ local result_file="$2"
729
+
730
+ log_info "Testing Firestore read: $project_id"
731
+
732
+ local base_url="https://firestore.googleapis.com/v1/projects/${project_id}/databases/(default)/documents"
733
+ local response
734
+
735
+ response=$(curl -s --max-time "$TIMEOUT_SECONDS" \
736
+ -H "User-Agent: $USER_AGENT" \
737
+ "$base_url" 2>/dev/null || echo '{}')
738
+
739
+ if echo "$response" | grep -q '"documents"'; then
740
+ log_vuln "FIRESTORE READ OPEN: $project_id"
741
+ echo "VULNERABLE" >"$result_file"
742
+ echo "$response" | head -c 500 >>"$result_file"
743
+ return 0
744
+ fi
745
+
746
+ echo "PROTECTED" >"$result_file"
747
+ return 1
748
+ }
749
+
750
+ test_firestore_write() {
751
+ local project_id="$1"
752
+ local result_file="$2"
753
+
754
+ log_info "Testing Firestore write: $project_id"
755
+
756
+ local base_url="https://firestore.googleapis.com/v1/projects/${project_id}/databases/(default)/documents"
757
+ local test_data='{"fields":{"security_test":{"stringValue":"firebase_scanner"}}}'
758
+
759
+ local response
760
+ response=$(curl -s --max-time "$TIMEOUT_SECONDS" \
761
+ -X POST \
762
+ -H "Content-Type: application/json" \
763
+ -d "$test_data" \
764
+ "${base_url}/${WRITE_TEST_PATH}" 2>/dev/null || echo '{}')
765
+
766
+ if echo "$response" | grep -q "security_test"; then
767
+ log_vuln "FIRESTORE WRITE OPEN: $project_id"
768
+ echo "VULNERABLE" >"$result_file"
769
+
770
+ local doc_name
771
+ doc_name=$(echo "$response" | jq -r '.name // empty' 2>/dev/null || true)
772
+ if [ -n "$doc_name" ]; then
773
+ curl -s -X DELETE "https://firestore.googleapis.com/v1/${doc_name}" --max-time 5 >/dev/null 2>&1 || true
774
+ fi
775
+ return 0
776
+ fi
777
+
778
+ echo "PROTECTED" >"$result_file"
779
+ return 1
780
+ }
781
+
782
+ test_firestore_collections() {
783
+ local project_id="$1"
784
+ local result_file="$2"
785
+
786
+ local common_collections="users user accounts account profiles profile members customers clients orders transactions payments messages chats conversations posts comments reviews products items settings config admin admins tokens sessions credentials logs events analytics notifications emails files documents images media uploads"
787
+
788
+ log_info "Testing common Firestore collections..."
789
+
790
+ local vulnerable_collections=""
791
+
792
+ for collection in $common_collections; do
793
+ local url="https://firestore.googleapis.com/v1/projects/${project_id}/databases/(default)/documents/${collection}"
794
+ local response
795
+
796
+ response=$(curl -s --max-time 5 "$url" 2>/dev/null || true)
797
+
798
+ if echo "$response" | grep -q '"documents"'; then
799
+ vulnerable_collections="$vulnerable_collections $collection"
800
+ log_vuln "Firestore collection exposed: $collection"
801
+ fi
802
+ done
803
+
804
+ if [ -n "$vulnerable_collections" ]; then
805
+ echo "VULNERABLE" >"$result_file"
806
+ echo "$vulnerable_collections" >>"$result_file"
807
+ return 0
808
+ fi
809
+
810
+ echo "PROTECTED" >"$result_file"
811
+ return 1
812
+ }
813
+
814
+ #=============================================================================
815
+ # STORAGE TESTS
816
+ #=============================================================================
817
+
818
+ test_storage_bucket() {
819
+ local bucket="$1"
820
+ local result_file="$2"
821
+
822
+ # Normalize bucket name
823
+ bucket="${bucket%.appspot.com}"
824
+ bucket="${bucket}.appspot.com"
825
+
826
+ log_info "Testing Storage bucket: $bucket"
827
+
828
+ local api_url="https://firebasestorage.googleapis.com/v0/b/${bucket}/o"
829
+ local response
830
+
831
+ response=$(curl -s --max-time "$TIMEOUT_SECONDS" "$api_url" 2>/dev/null || echo '{}')
832
+
833
+ if echo "$response" | grep -q '"items"'; then
834
+ log_vuln "STORAGE BUCKET LISTABLE: $bucket"
835
+ echo "VULNERABLE" >"$result_file"
836
+
837
+ local file_count
838
+ file_count=$(echo "$response" | jq '.items | length' 2>/dev/null || echo "unknown")
839
+ echo "Files exposed: $file_count" >>"$result_file"
840
+ echo "$response" | jq -r '.items[0:5][].name' 2>/dev/null >>"$result_file" || true
841
+ return 0
842
+ fi
843
+
844
+ echo "PROTECTED" >"$result_file"
845
+ return 1
846
+ }
847
+
848
+ test_storage_bucket_write() {
849
+ local bucket="$1"
850
+ local result_file="$2"
851
+
852
+ bucket="${bucket%.appspot.com}"
853
+ bucket="${bucket}.appspot.com"
854
+
855
+ log_info "Testing Storage bucket write: $bucket"
856
+
857
+ local api_url="https://firebasestorage.googleapis.com/v0/b/${bucket}/o"
858
+ local test_content="firebase_security_scanner_test"
859
+ local test_path="${WRITE_TEST_PATH}.txt"
860
+
861
+ local response
862
+ response=$(curl -s --max-time "$TIMEOUT_SECONDS" \
863
+ -X POST \
864
+ -H "Content-Type: text/plain" \
865
+ --data-binary "$test_content" \
866
+ "${api_url}?uploadType=media&name=${test_path}" 2>/dev/null || echo '{}')
867
+
868
+ if echo "$response" | grep -q '"name"'; then
869
+ log_vuln "STORAGE BUCKET WRITABLE: $bucket"
870
+ echo "VULNERABLE" >"$result_file"
871
+ curl -s -X DELETE "${api_url}/${test_path}" --max-time 5 >/dev/null 2>&1 || true
872
+ return 0
873
+ fi
874
+
875
+ echo "PROTECTED" >"$result_file"
876
+ return 1
877
+ }
878
+
879
+ #=============================================================================
880
+ # CLOUD FUNCTIONS TESTS
881
+ #=============================================================================
882
+
883
+ enumerate_cloud_functions() {
884
+ local project_id="$1"
885
+ local result_file="$2"
886
+ local known_functions="$3"
887
+
888
+ log_section "Enumerating Cloud Functions..."
889
+
890
+ echo "ENUMERATION_RESULTS" >"$result_file"
891
+
892
+ local found_functions=""
893
+ local region="us-central1"
894
+
895
+ # Combine known and common functions
896
+ local all_functions="$known_functions $COMMON_FUNCTIONS"
897
+ all_functions=$(echo "$all_functions" | tr ' ' '\n' | grep -v '^$' | sort -u | tr '\n' ' ')
898
+
899
+ for func_name in $all_functions; do
900
+ [ -z "$func_name" ] && continue
901
+
902
+ local url="https://${region}-${project_id}.cloudfunctions.net/${func_name}"
903
+ local http_code
904
+
905
+ http_code=$(curl -s -o /dev/null -w "%{http_code}" --max-time 3 "$url" 2>/dev/null || echo "000")
906
+
907
+ if [ "$http_code" != "404" ] && [ "$http_code" != "000" ]; then
908
+ found_functions="$found_functions ${func_name}:${http_code}"
909
+
910
+ if [ "$http_code" = "200" ]; then
911
+ log_vuln "Cloud Function found (200 OK): $func_name"
912
+ elif [ "$http_code" = "403" ] || [ "$http_code" = "401" ]; then
913
+ log_info "Cloud Function found (auth required): $func_name"
914
+ else
915
+ log_info "Cloud Function found (HTTP $http_code): $func_name"
916
+ fi
917
+ fi
918
+ done
919
+
920
+ if [ -n "$found_functions" ]; then
921
+ echo "$found_functions" >>"$result_file"
922
+ return 0
923
+ fi
924
+
925
+ return 1
926
+ }
927
+
928
+ test_callable_function() {
929
+ local project_id="$1"
930
+ local function_name="$2"
931
+ local result_file="$3"
932
+
933
+ log_info "Testing callable function: $function_name"
934
+
935
+ local region="us-central1"
936
+ local url="https://${region}-${project_id}.cloudfunctions.net/${function_name}"
937
+
938
+ local response
939
+ response=$(curl -s --max-time "$TIMEOUT_SECONDS" \
940
+ -X POST \
941
+ -H "Content-Type: application/json" \
942
+ -d '{"data":{}}' \
943
+ "$url" 2>/dev/null || echo '{}')
944
+
945
+ if echo "$response" | grep -q '"result"'; then
946
+ log_vuln "CALLABLE FUNCTION NO AUTH: $function_name"
947
+ echo "VULNERABLE:NO_AUTH:$function_name" >>"$result_file"
948
+ return 0
949
+ elif echo "$response" | grep -qE "UNAUTHENTICATED|unauthenticated"; then
950
+ log_success "Callable function requires auth: $function_name"
951
+ echo "PROTECTED:$function_name" >>"$result_file"
952
+ fi
953
+
954
+ return 1
955
+ }
956
+
957
+ #=============================================================================
958
+ # REMOTE CONFIG TESTS
959
+ #=============================================================================
960
+
961
+ test_remote_config() {
962
+ local project_id="$1"
963
+ local api_key="$2"
964
+ local result_file="$3"
965
+
966
+ log_info "Testing Remote Config: $project_id"
967
+
968
+ local url="https://firebaseremoteconfig.googleapis.com/v1/projects/${project_id}/remoteConfig"
969
+
970
+ local response
971
+ response=$(curl -s --max-time "$TIMEOUT_SECONDS" \
972
+ -H "x-goog-api-key: $api_key" \
973
+ "$url" 2>/dev/null || echo '{}')
974
+
975
+ if echo "$response" | grep -q "parameters"; then
976
+ log_vuln "REMOTE CONFIG EXPOSED: $project_id"
977
+ echo "VULNERABLE" >"$result_file"
978
+ echo "$response" | head -c 500 >>"$result_file"
979
+ return 0
980
+ fi
981
+
982
+ echo "PROTECTED" >"$result_file"
983
+ return 1
984
+ }
985
+
986
+ #=============================================================================
987
+ # MAIN PROCESSING
988
+ #=============================================================================
989
+
990
+ process_apk() {
991
+ local apk_path="$1"
992
+ local apk_name
993
+ apk_name=$(basename "$apk_path" .apk)
994
+ local apk_result_dir="${RESULTS_DIR}/${apk_name}"
995
+ local apk_decompiled="${DECOMPILED_DIR}/${apk_name}"
996
+
997
+ TOTAL_APKS=$((TOTAL_APKS + 1))
998
+
999
+ echo ""
1000
+ echo "════════════════════════════════════════════════════════════"
1001
+ log_info "Processing: $apk_name"
1002
+ echo "════════════════════════════════════════════════════════════"
1003
+
1004
+ mkdir -p "$apk_result_dir"
1005
+
1006
+ # Decompile APK
1007
+ log_info "Decompiling APK..."
1008
+ if ! apktool d -f -o "$apk_decompiled" "$apk_path" >/dev/null 2>&1; then
1009
+ log_error "Failed to decompile: $apk_path"
1010
+ echo "DECOMPILE_FAILED" >"${apk_result_dir}/status.txt"
1011
+ return 1
1012
+ fi
1013
+
1014
+ log_success "Decompilation complete"
1015
+
1016
+ # Extract Firebase configuration (pass both decompiled dir and original APK path)
1017
+ log_info "Extracting Firebase configuration..."
1018
+ local config_file
1019
+ config_file=$(extract_firebase_config "$apk_decompiled" "$apk_path")
1020
+
1021
+ if [ ! -f "$config_file" ]; then
1022
+ log_error "Failed to create config file"
1023
+ echo "CONFIG_FAILED" >"${apk_result_dir}/status.txt"
1024
+ return 1
1025
+ fi
1026
+
1027
+ cp "$config_file" "$apk_result_dir/"
1028
+
1029
+ # Read configuration into variables
1030
+ local db_urls
1031
+ local project_ids
1032
+ local storage_buckets
1033
+ local api_keys
1034
+ local function_names
1035
+
1036
+ db_urls=$(jq -r '.database_urls[]?' "$config_file" 2>/dev/null | tr '\n' ' ' || true)
1037
+ project_ids=$(jq -r '.project_ids[]?' "$config_file" 2>/dev/null | tr '\n' ' ' || true)
1038
+ storage_buckets=$(jq -r '.storage_buckets[]?' "$config_file" 2>/dev/null | tr '\n' ' ' || true)
1039
+ api_keys=$(jq -r '.api_keys[]?' "$config_file" 2>/dev/null | tr '\n' ' ' || true)
1040
+ function_names=$(jq -r '.function_names[]?' "$config_file" 2>/dev/null | tr '\n' ' ' || true)
1041
+
1042
+ local db_count proj_count bucket_count key_count func_count
1043
+ db_count=$(echo "$db_urls" | wc -w | tr -d ' ')
1044
+ proj_count=$(echo "$project_ids" | wc -w | tr -d ' ')
1045
+ bucket_count=$(echo "$storage_buckets" | wc -w | tr -d ' ')
1046
+ key_count=$(echo "$api_keys" | wc -w | tr -d ' ')
1047
+ func_count=$(echo "$function_names" | wc -w | tr -d ' ')
1048
+
1049
+ log_success "Extraction complete:"
1050
+ log_info " Database URLs: $db_count"
1051
+ log_info " Project IDs: $proj_count"
1052
+ log_info " Storage Buckets: $bucket_count"
1053
+ log_info " API Keys: $key_count"
1054
+ log_info " Function Names: $func_count"
1055
+
1056
+ local apk_vulnerable=false
1057
+ local apk_vulns=""
1058
+ local anonymous_token=""
1059
+
1060
+ #=========================================================================
1061
+ # AUTHENTICATION TESTS
1062
+ #=========================================================================
1063
+ local first_api_key
1064
+ first_api_key=$(echo "$api_keys" | awk '{print $1}')
1065
+
1066
+ if [ -n "$first_api_key" ]; then
1067
+ log_section "Testing Firebase Authentication..."
1068
+
1069
+ if test_auth_signup_enabled "$first_api_key" "${apk_result_dir}/auth_signup.txt"; then
1070
+ apk_vulnerable=true
1071
+ apk_vulns="$apk_vulns AUTH_SIGNUP_OPEN"
1072
+ fi
1073
+
1074
+ if test_auth_anonymous "$first_api_key" "${apk_result_dir}/auth_anonymous.txt"; then
1075
+ apk_vulnerable=true
1076
+ apk_vulns="$apk_vulns AUTH_ANONYMOUS_ENABLED"
1077
+ anonymous_token=$(grep "ID_TOKEN:" "${apk_result_dir}/auth_anonymous.txt" 2>/dev/null | sed 's/ID_TOKEN://' || true)
1078
+ fi
1079
+
1080
+ if test_auth_email_enumeration "$first_api_key" "${apk_result_dir}/auth_email_enum.txt"; then
1081
+ apk_vulnerable=true
1082
+ apk_vulns="$apk_vulns AUTH_EMAIL_ENUMERATION"
1083
+ fi
1084
+ fi
1085
+
1086
+ #=========================================================================
1087
+ # DATABASE TESTS
1088
+ #=========================================================================
1089
+ log_section "Testing Realtime Database..."
1090
+
1091
+ for db_url in $db_urls; do
1092
+ [ -z "$db_url" ] && continue
1093
+
1094
+ if test_rtdb_read "$db_url" "${apk_result_dir}/rtdb_read.txt"; then
1095
+ apk_vulnerable=true
1096
+ apk_vulns="$apk_vulns RTDB_READ:$db_url"
1097
+ fi
1098
+
1099
+ if test_rtdb_write "$db_url" "${apk_result_dir}/rtdb_write.txt"; then
1100
+ apk_vulnerable=true
1101
+ apk_vulns="$apk_vulns RTDB_WRITE:$db_url"
1102
+ fi
1103
+
1104
+ if [ -n "$anonymous_token" ]; then
1105
+ if test_rtdb_authenticated "$db_url" "$anonymous_token" "${apk_result_dir}/rtdb_auth.txt"; then
1106
+ apk_vulnerable=true
1107
+ apk_vulns="$apk_vulns RTDB_ANON_ACCESS:$db_url"
1108
+ fi
1109
+ fi
1110
+ done
1111
+
1112
+ log_section "Testing Firestore..."
1113
+
1114
+ for project_id in $project_ids; do
1115
+ [ -z "$project_id" ] && continue
1116
+
1117
+ if test_firestore_read "$project_id" "${apk_result_dir}/firestore_read.txt"; then
1118
+ apk_vulnerable=true
1119
+ apk_vulns="$apk_vulns FIRESTORE_READ:$project_id"
1120
+ fi
1121
+
1122
+ if test_firestore_write "$project_id" "${apk_result_dir}/firestore_write.txt"; then
1123
+ apk_vulnerable=true
1124
+ apk_vulns="$apk_vulns FIRESTORE_WRITE:$project_id"
1125
+ fi
1126
+
1127
+ if test_firestore_collections "$project_id" "${apk_result_dir}/firestore_collections.txt"; then
1128
+ apk_vulnerable=true
1129
+ apk_vulns="$apk_vulns FIRESTORE_COLLECTIONS:$project_id"
1130
+ fi
1131
+ done
1132
+
1133
+ #=========================================================================
1134
+ # STORAGE TESTS
1135
+ #=========================================================================
1136
+ log_section "Testing Storage Buckets..."
1137
+
1138
+ for bucket in $storage_buckets; do
1139
+ [ -z "$bucket" ] && continue
1140
+
1141
+ if test_storage_bucket "$bucket" "${apk_result_dir}/storage_read.txt"; then
1142
+ apk_vulnerable=true
1143
+ apk_vulns="$apk_vulns STORAGE_LISTABLE:$bucket"
1144
+ fi
1145
+
1146
+ if test_storage_bucket_write "$bucket" "${apk_result_dir}/storage_write.txt"; then
1147
+ apk_vulnerable=true
1148
+ apk_vulns="$apk_vulns STORAGE_WRITABLE:$bucket"
1149
+ fi
1150
+ done
1151
+
1152
+ #=========================================================================
1153
+ # CLOUD FUNCTIONS TESTS
1154
+ #=========================================================================
1155
+ local first_project
1156
+ first_project=$(echo "$project_ids" | awk '{print $1}')
1157
+
1158
+ if [ -n "$first_project" ]; then
1159
+ log_section "Testing Cloud Functions..."
1160
+
1161
+ enumerate_cloud_functions "$first_project" "${apk_result_dir}/functions_enum.txt" "$function_names"
1162
+
1163
+ for func_name in $function_names; do
1164
+ [ -z "$func_name" ] && continue
1165
+
1166
+ if test_callable_function "$first_project" "$func_name" "${apk_result_dir}/functions_callable.txt"; then
1167
+ apk_vulnerable=true
1168
+ apk_vulns="$apk_vulns FUNCTION_NO_AUTH:$func_name"
1169
+ fi
1170
+ done
1171
+ fi
1172
+
1173
+ #=========================================================================
1174
+ # REMOTE CONFIG TESTS
1175
+ #=========================================================================
1176
+ if [ -n "$first_project" ] && [ -n "$first_api_key" ]; then
1177
+ log_section "Testing Remote Config..."
1178
+
1179
+ if test_remote_config "$first_project" "$first_api_key" "${apk_result_dir}/remote_config.txt"; then
1180
+ apk_vulnerable=true
1181
+ apk_vulns="$apk_vulns REMOTE_CONFIG_EXPOSED"
1182
+ fi
1183
+ fi
1184
+
1185
+ #=========================================================================
1186
+ # SUMMARY
1187
+ #=========================================================================
1188
+ if [ "$apk_vulnerable" = true ]; then
1189
+ VULNERABLE_APKS=$((VULNERABLE_APKS + 1))
1190
+ echo "VULNERABLE" >"${apk_result_dir}/status.txt"
1191
+ echo "$apk_vulns" | tr ' ' '\n' | grep -v '^$' >"${apk_result_dir}/vulnerabilities.txt"
1192
+ local vuln_count
1193
+ vuln_count=$(echo "$apk_vulns" | wc -w | tr -d ' ')
1194
+ log_vuln "APK IS VULNERABLE: $apk_name ($vuln_count issues)"
1195
+ else
1196
+ echo "SECURE" >"${apk_result_dir}/status.txt"
1197
+ log_success "APK appears secure: $apk_name"
1198
+ fi
1199
+ }
1200
+
1201
+ generate_report() {
1202
+ log_info "Generating final report..."
1203
+
1204
+ {
1205
+ echo "╔═══════════════════════════════════════════════════════════╗"
1206
+ echo "║ FIREBASE APK SECURITY SCAN REPORT v1.0 ║"
1207
+ echo "╚═══════════════════════════════════════════════════════════╝"
1208
+ echo ""
1209
+ echo "Scan Date: $(date)"
1210
+ echo "Total APKs Scanned: $TOTAL_APKS"
1211
+ echo "Vulnerable APKs: $VULNERABLE_APKS"
1212
+ echo "Total Vulnerabilities: $TOTAL_VULNS"
1213
+ echo ""
1214
+ echo "═══════════════════════════════════════════════════════════"
1215
+ echo "EXTRACTION SOURCES"
1216
+ echo "═══════════════════════════════════════════════════════════"
1217
+ echo "• google-services.json"
1218
+ echo "• res/values/*.xml (strings.xml, values.xml, etc.)"
1219
+ echo "• AndroidManifest.xml"
1220
+ echo "• assets/ folder (hybrid apps: React Native, Flutter, Cordova)"
1221
+ echo "• res/raw/ resources"
1222
+ echo "• Smali/DEX code (const-string declarations)"
1223
+ echo "• Raw APK binary strings"
1224
+ echo ""
1225
+ echo "═══════════════════════════════════════════════════════════"
1226
+ echo "VULNERABILITY CATEGORIES TESTED"
1227
+ echo "═══════════════════════════════════════════════════════════"
1228
+ echo "• Authentication: Open Signup, Anonymous Auth, Email Enumeration"
1229
+ echo "• Realtime Database: Unauthenticated Read/Write, Auth Bypass"
1230
+ echo "• Firestore: Document Access, Collection Enumeration"
1231
+ echo "• Storage: Bucket Listing (gs:// and appspot.com), Write Access"
1232
+ echo "• Cloud Functions: Unauthenticated Access, Function Enumeration"
1233
+ echo "• Remote Config: Public Exposure"
1234
+ echo ""
1235
+ echo "═══════════════════════════════════════════════════════════"
1236
+ echo "DETAILED RESULTS"
1237
+ echo "═══════════════════════════════════════════════════════════"
1238
+ echo ""
1239
+
1240
+ for result_dir in "$RESULTS_DIR"/*/; do
1241
+ [ -d "$result_dir" ] || continue
1242
+ local apk_name
1243
+ apk_name=$(basename "$result_dir")
1244
+ local status
1245
+ status=$(cat "${result_dir}/status.txt" 2>/dev/null || echo "UNKNOWN")
1246
+
1247
+ echo "───────────────────────────────────────────────────────────"
1248
+ echo "APK: $apk_name"
1249
+ echo "Status: $status"
1250
+
1251
+ if [ -f "${result_dir}/firebase_config.json" ]; then
1252
+ echo ""
1253
+ echo "Extracted Configuration:"
1254
+ jq '.' "${result_dir}/firebase_config.json" 2>/dev/null || true
1255
+ fi
1256
+
1257
+ if [ -f "${result_dir}/vulnerabilities.txt" ]; then
1258
+ echo ""
1259
+ echo "Vulnerabilities Found:"
1260
+ while IFS= read -r vuln; do
1261
+ [ -n "$vuln" ] && echo " • $vuln"
1262
+ done <"${result_dir}/vulnerabilities.txt"
1263
+ fi
1264
+
1265
+ echo ""
1266
+ done
1267
+
1268
+ } >"$REPORT_FILE"
1269
+
1270
+ # Generate JSON report
1271
+ {
1272
+ echo '{'
1273
+ echo " \"scan_date\": \"$(date)\","
1274
+ echo " \"scanner_version\": \"1.0\","
1275
+ echo " \"total_apks\": $TOTAL_APKS,"
1276
+ echo " \"vulnerable_apks\": $VULNERABLE_APKS,"
1277
+ echo " \"total_vulnerabilities\": $TOTAL_VULNS,"
1278
+ echo ' "results": ['
1279
+
1280
+ local first=true
1281
+ for result_dir in "$RESULTS_DIR"/*/; do
1282
+ [ -d "$result_dir" ] || continue
1283
+ local apk_name
1284
+ apk_name=$(basename "$result_dir")
1285
+ local status
1286
+ status=$(cat "${result_dir}/status.txt" 2>/dev/null || echo "UNKNOWN")
1287
+
1288
+ if [ "$first" = true ]; then
1289
+ first=false
1290
+ else
1291
+ echo ","
1292
+ fi
1293
+
1294
+ echo " {"
1295
+ echo " \"apk\": \"$apk_name\","
1296
+ echo " \"status\": \"$status\","
1297
+
1298
+ if [ -f "${result_dir}/firebase_config.json" ]; then
1299
+ echo " \"config\": $(cat "${result_dir}/firebase_config.json"),"
1300
+ fi
1301
+
1302
+ echo " \"vulnerabilities\": ["
1303
+ if [ -f "${result_dir}/vulnerabilities.txt" ]; then
1304
+ local vfirst=true
1305
+ while IFS= read -r vuln; do
1306
+ [ -z "$vuln" ] && continue
1307
+ if [ "$vfirst" = true ]; then
1308
+ vfirst=false
1309
+ else
1310
+ echo ","
1311
+ fi
1312
+ echo -n " \"$vuln\""
1313
+ done <"${result_dir}/vulnerabilities.txt"
1314
+ echo ""
1315
+ fi
1316
+ echo " ]"
1317
+ echo -n " }"
1318
+ done
1319
+
1320
+ echo ""
1321
+ echo " ]"
1322
+ echo "}"
1323
+ } >"$JSON_REPORT"
1324
+
1325
+ log_success "Reports generated:"
1326
+ log_success " Text: $REPORT_FILE"
1327
+ log_success " JSON: $JSON_REPORT"
1328
+ }
1329
+
1330
+ main() {
1331
+ print_banner
1332
+
1333
+ if [ $# -lt 1 ]; then
1334
+ echo "Usage: $0 <apk_directory|apk_file> [--no-cleanup]"
1335
+ echo ""
1336
+ echo "Examples:"
1337
+ echo " $0 ./apks/ # Scan all APKs in directory"
1338
+ echo " $0 ./myapp.apk # Scan single APK"
1339
+ echo " $0 ./apks/ --no-cleanup # Keep decompiled files"
1340
+ echo ""
1341
+ echo "Extraction sources:"
1342
+ echo " • google-services.json"
1343
+ echo " • res/values/*.xml files"
1344
+ echo " • AndroidManifest.xml"
1345
+ echo " • assets/ (React Native, Flutter, Cordova)"
1346
+ echo " • res/raw/ resources"
1347
+ echo " • Smali/DEX code"
1348
+ echo " • Raw APK binary strings"
1349
+ echo ""
1350
+ echo "Tests performed:"
1351
+ echo " • Firebase Auth: signup, anonymous auth, email enumeration"
1352
+ echo " • Realtime Database: read, write, auth bypass"
1353
+ echo " • Firestore: read, write, collection enumeration"
1354
+ echo " • Storage: bucket listing (gs:// & appspot), write access"
1355
+ echo " • Cloud Functions: enumeration, unauthenticated access"
1356
+ echo " • Remote Config: public exposure"
1357
+ exit 1
1358
+ fi
1359
+
1360
+ local target="$1"
1361
+ local cleanup=true
1362
+ if [ "${2:-}" = "--no-cleanup" ]; then
1363
+ cleanup=false
1364
+ fi
1365
+
1366
+ check_dependencies
1367
+ setup_directories
1368
+
1369
+ if [ -d "$target" ]; then
1370
+ log_info "Scanning directory: $target"
1371
+ for apk in "$target"/*.apk; do
1372
+ [ -f "$apk" ] || continue
1373
+ process_apk "$apk"
1374
+ done
1375
+ elif [ -f "$target" ]; then
1376
+ log_info "Scanning single APK: $target"
1377
+ process_apk "$target"
1378
+ else
1379
+ log_error "Target not found: $target"
1380
+ exit 1
1381
+ fi
1382
+
1383
+ generate_report
1384
+
1385
+ if [ "$cleanup" = true ]; then
1386
+ log_info "Cleaning up decompiled files..."
1387
+ rm -rf "$DECOMPILED_DIR"
1388
+ fi
1389
+
1390
+ echo ""
1391
+ echo "════════════════════════════════════════════════════════════"
1392
+ echo " SCAN COMPLETE "
1393
+ echo "════════════════════════════════════════════════════════════"
1394
+ echo ""
1395
+ echo "Total APKs: $TOTAL_APKS"
1396
+
1397
+ if [ $VULNERABLE_APKS -gt 0 ]; then
1398
+ printf 'Vulnerable: %s%d%s\n' "$RED" "$VULNERABLE_APKS" "$NC"
1399
+ printf 'Total Issues: %s%d%s\n' "$RED" "$TOTAL_VULNS" "$NC"
1400
+ else
1401
+ printf 'Vulnerable: %s0%s\n' "$GREEN" "$NC"
1402
+ fi
1403
+
1404
+ echo ""
1405
+ echo "Results saved to: $OUTPUT_DIR"
1406
+ }
1407
+
1408
+ main "$@"