Agent Skills › trailofbits/skills › firebase-apk-scanner

firebase-apk-scanner

GitHub

用于扫描Android APK以检测Firebase安全配置错误(如开放数据库、存储桶、认证问题)的技能。适用于移动应用安全审计、授权渗透测试及Firebase后端风险评估,帮助发现未授权访问和数据泄露风险。

plugins/firebase-apk-scanner/skills/firebase-apk-scanner/SKILL.md trailofbits/skills

Trigger Scenarios

Android APK文件安全审计 Firebase后端配置漏洞测试 移动应用渗透测试

Install

npx skills add trailofbits/skills --skill firebase-apk-scanner -g -y
More Options

Non-standard path

npx skills add https://github.com/trailofbits/skills/tree/main/plugins/firebase-apk-scanner/skills/firebase-apk-scanner -g -y

Use without installing

npx skills use trailofbits/skills@firebase-apk-scanner

指定 Agent (Claude Code)

npx skills add trailofbits/skills --skill firebase-apk-scanner -a claude-code -g -y

安装 repo 全部 skill

npx skills add trailofbits/skills --all -g -y

预览 repo 内 skill

npx skills add trailofbits/skills --list

SKILL.md

Frontmatter
{
    "name": "firebase-apk-scanner",
    "description": "Scans Android APKs for Firebase security misconfigurations including open databases, storage buckets, authentication issues, and exposed cloud functions. Use when analyzing APK files for Firebase vulnerabilities, performing mobile app security audits, or testing Firebase endpoint security. For authorized security research only.",
    "allowed-tools": "Bash({baseDir}\/scanner.sh:*) Bash(apktool:*) Bash(curl:*) Read Grep Glob",
    "argument-hint": [
        "apk-file-or-directory"
    ],
    "disable-model-invocation": true
}

Firebase APK Security Scanner

You are a Firebase security analyst. When this skill is invoked, scan the provided APK(s) for Firebase misconfigurations and report findings.

When to Use

  • Auditing Android applications for Firebase security misconfigurations
  • Testing Firebase endpoints extracted from APKs (Realtime Database, Firestore, Storage)
  • Checking authentication security (open signup, anonymous auth, email enumeration)
  • Enumerating Cloud Functions and testing for unauthenticated access
  • Mobile app security assessments involving Firebase backends
  • Authorized penetration testing of Firebase-backed applications

When NOT to Use

  • Scanning apps you do not have explicit authorization to test
  • Testing production Firebase projects without written permission
  • When you only need to extract Firebase config without testing (use manual grep/strings instead)
  • For non-Android targets (iOS, web apps) - this skill is APK-specific
  • When the target app does not use Firebase

Rationalizations to Reject

When auditing, reject these common rationalizations that lead to missed or downplayed findings:

  • "The database is read-only so it's fine" - Data exposure is still a critical finding; PII, API keys, and business data may be leaked
  • "It's just anonymous auth, not real accounts" - Anonymous tokens bypass auth != null rules and can access "authenticated-only" resources
  • "The API key is public anyway" - A public API key does not justify open database rules or disabled auth restrictions
  • "There's no sensitive data in there" - You cannot know what data will be stored in the future; insecure rules are vulnerabilities regardless of current content
  • "It's an internal app" - APKs can be extracted from any device; "internal" apps are not protected from reverse engineering
  • "We'll fix it before launch" - Document the finding; pre-launch vulnerabilities frequently ship to production

Reference Documentation

For detailed vulnerability patterns and exploitation techniques, consult:

How to Use This Skill

The user will provide an APK file or directory: $ARGUMENTS

Workflow

Step 1: Validate Input

First, verify the target exists:

ls -la "$ARGUMENTS"

If $ARGUMENTS is empty, ask the user to provide an APK path.

Step 2: Run the Scanner

Execute the bundled scanner script on the target:

{baseDir}/scanner.sh "$ARGUMENTS"

The scanner will:

  1. Decompile the APK using apktool
  2. Extract Firebase configuration from all sources (google-services.json, XML resources, assets, smali code, DEX strings)
  3. Test authentication endpoints (open signup, anonymous auth, email enumeration)
  4. Test Realtime Database (unauthenticated read/write, auth bypass)
  5. Test Firestore (document access, collection enumeration)
  6. Test Storage buckets (listing, write access)
  7. Test Cloud Functions (enumeration, unauthenticated access)
  8. Test Remote Config exposure
  9. Generate reports in text and JSON format

Step 3: Present Results

After the scanner completes, read scan_report.json (and scan_report.txt for the narrative) in the exact directory it printed as Results saved to:. Do not use a firebase_scan_* glob: it also matches every earlier scan in the current directory.

The scanner exits nonzero after writing its report when no APK could be tested (every APK failed to decompile or had no Firebase config). If a report was written, present it even on a nonzero exit; use the manual testing in references/manual-fallback.md only when no report exists.

State what the scanner did not cover: it probes Cloud Functions only in us-central1, and tests auth, Cloud Functions and Remote Config only for the first project ID and API key it extracted.

Present findings in this format:


Scan Summary

Metric Value
APKs Scanned X
Vulnerable X
Failed to scan X
No Firebase config X
Total Issues X

Take these from failed_apks and untested_apks in scan_report.json. Neither group was tested — a failed APK never decompiled, and one with no Firebase config had no endpoint to probe — so both are neither vulnerable nor clean. Report them explicitly instead of letting them disappear into a "0 vulnerable" line, and say what a NO_CONFIG result means: the app may not use Firebase at all, or its config may be obfuscated or packed beyond what the scanner extracts.

Extracted Configuration

Field Value
Project ID extracted_value
Database URL extracted_value
Storage Bucket extracted_value
API Key extracted_value
Auth Domain extracted_value

Vulnerabilities Found

Severity Issue Evidence
CRITICAL Description Brief evidence
HIGH Description Brief evidence

Remediation

Provide specific fixes for each vulnerability found. Reference the Vulnerability Patterns for secure code examples.


Manual Testing (If Scanner Fails)

Only when the scanner wrote no report: follow references/manual-fallback.md.

Severity Classification

  • CRITICAL: Unauthenticated database read/write, storage write, open signup on private apps
  • HIGH: Anonymous auth enabled, storage bucket listing, collection enumeration
  • MEDIUM: Email enumeration, accessible cloud functions, remote config exposure
  • LOW: Information disclosure without sensitive data

Important Guidelines

  1. Authorization required - Only scan APKs you have permission to test
  2. Clean up test data - The scanner automatically removes test entries it creates
  3. Save tokens - If anonymous auth succeeds, use the token for authenticated bypass testing
  4. Test all regions - Cloud Functions may be deployed to us-central1, europe-west1, asia-east1, etc.
  5. Multiple instances - Some apps use multiple Firebase projects; test all discovered configurations

Version History

  • 5c99c03 Current 2026-10-19 18:32

    修复报告统计错误,优化JSON报告读取逻辑,仅在无报告时加载手动测试参考,并改进路径空格处理。

  • 7dee682 2026-08-28 20:20

    修复scanner.sh路径引用错误,调整命令入口命名以解决不可达问题,优化空目录或未成功反编译APK时的退出状态与报告逻辑。

  • 9b28133 2026-08-20 09:17

Same Skill Collection

plugins/audit-context-building/skills/audit-context-building/SKILL.md
plugins/building-secure-contracts/skills/algorand-vulnerability-scanner/SKILL.md
plugins/building-secure-contracts/skills/cairo-vulnerability-scanner/SKILL.md
plugins/building-secure-contracts/skills/cosmos-vulnerability-scanner/SKILL.md
plugins/building-secure-contracts/skills/solana-vulnerability-scanner/SKILL.md
plugins/building-secure-contracts/skills/substrate-vulnerability-scanner/SKILL.md
plugins/building-secure-contracts/skills/ton-vulnerability-scanner/SKILL.md
plugins/burpsuite-project-parser/skills/burpsuite-project-parser/SKILL.md
plugins/c-review/skills/c-review/SKILL.md
plugins/chrome-mcp-troubleshooting/skills/chrome-mcp-troubleshooting/SKILL.md
plugins/claude-in-chrome-troubleshooting/skills/chrome-mcp-troubleshooting/SKILL.md
plugins/constant-time-analysis/skills/constant-time-analysis/SKILL.md
plugins/devcontainer-setup/skills/devcontainer-setup/SKILL.md
plugins/differential-review/skills/differential-review/SKILL.md
plugins/dimensional-analysis/skills/dimensional-analysis/SKILL.md
plugins/dwarf-expert/skills/dwarf-expert/SKILL.md
plugins/fp-check/skills/fp-check/SKILL.md
plugins/gh-cli/skills/gh-cli/SKILL.md
plugins/git-cleanup/skills/git-cleanup/SKILL.md
plugins/goal-prompt/skills/goal-prompt/SKILL.md
plugins/let-fate-decide/skills/let-fate-decide/SKILL.md
plugins/modern-cpp/skills/modern-cpp/SKILL.md
plugins/modern-python/skills/modern-python/SKILL.md
plugins/mutation-testing/skills/mutation-testing/SKILL.md
plugins/open-sourcing/skills/open-sourcing/SKILL.md
plugins/post-patch-validation/skills/post-patch-validation/SKILL.md
plugins/review-walkthrough/skills/review-walkthrough/SKILL.md
plugins/rust-review/skills/rust-review/SKILL.md
plugins/second-opinion/skills/second-opinion/SKILL.md
plugins/semgrep-rule-creator/skills/semgrep-rule-creator/SKILL.md
plugins/semgrep-rule-variant-creator/skills/semgrep-rule-variant-creator/SKILL.md
plugins/sharp-edges/skills/sharp-edges/SKILL.md
plugins/skill-improver/skills/skill-improver/SKILL.md
plugins/spec-to-code-compliance/skills/spec-to-code-compliance/SKILL.md
plugins/static-analysis/skills/sarif-parsing/SKILL.md
plugins/supply-chain-risk-auditor/skills/supply-chain-risk-auditor/SKILL.md
plugins/testing-handbook-skills/skills/address-sanitizer/SKILL.md
plugins/testing-handbook-skills/skills/aflpp/SKILL.md
plugins/testing-handbook-skills/skills/atheris/SKILL.md
plugins/testing-handbook-skills/skills/cargo-fuzz/SKILL.md
plugins/testing-handbook-skills/skills/coverage-analysis/SKILL.md
plugins/testing-handbook-skills/skills/fuzzing-dictionary/SKILL.md
plugins/testing-handbook-skills/skills/fuzzing-obstacles/SKILL.md
plugins/testing-handbook-skills/skills/harness-writing/SKILL.md
plugins/testing-handbook-skills/skills/libafl/SKILL.md
plugins/testing-handbook-skills/skills/libfuzzer/SKILL.md
plugins/testing-handbook-skills/skills/ossfuzz/SKILL.md
plugins/testing-handbook-skills/skills/ruzzy/SKILL.md
plugins/testing-handbook-skills/skills/testing-handbook-generator/SKILL.md

Metadata

Files
0
Version
5c99c03
Hash
1c63bf5e
Indexed
2026-08-20 09:17

ホーム - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-10-22 04:31
浙ICP备14020137号-1