扫描器
- 作者仓库星标 0
- 作者更新于 2026年8月24日 23:09
- 作者仓库 skills
- 领域
- 通用
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @trailofbits · 未声明许可证
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部接口密钥
- 需要 · Vendor-specific
- 兼容的系统
- 未声明(默认跨平台)
- 运行环境要求
- 未检出明确要求
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 命令执行
- 网络行为
- 允许外网请求
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
cat firebase_scan_*/scan_report.txt
第 1 步:验证输入
首先,验证目标是否存在:如果 `$ARGUMENTS` 为空,则要求用户提供 APK 路径。
第 2 步:运行扫描仪
在目标上执行捆绑的扫描器脚本:扫描器将: 使用 apktool 反编译 APK 从所有来源(google-services.json、XML 资源、资产、smali 代码、DEX 字符串)提取 Firebase 配置 测试身份验证端点(开放注册、匿名身份验证、电子邮件枚举)
第 3 步:展示结果
扫描完成后,阅读并总结结果: 以这种格式呈现结果:
# 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:
- [Vulnerability Patterns Reference](references/vulnerabilities.md)
## 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:
```bash
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:
```bash
{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 and summarize the results:
```bash
cat firebase_scan_*/scan_report.txt
```
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](references/vulnerabilities.md) for secure code examples.
---
## Manual Testing (If Scanner Fails)
If the scanner script is unavailable or fails, perform manual extraction and testing:
### Extract Configuration
Search for Firebase config in decompiled APK:
```bash
# Decompile
apktool d -f -o ./decompiled $ARGUMENTS
# Find google-services.json
find ./decompiled -name "google-services.json"
# Search XML resources
grep -r "firebaseio.com\|appspot.com\|AIza" ./decompiled/res/
# Search assets (hybrid apps)
grep -r "firebaseio.com\|AIza" ./decompiled/assets/
```
### Test Endpoints
Once you have the PROJECT_ID and API_KEY:
**Authentication:**
```bash
# Test open signup
curl -s -X POST -H "Content-Type: application/json" \
-d '{"email":"test@test.com","password":"Test123!","returnSecureToken":true}' \
"https://identitytoolkit.googleapis.com/v1/accounts:signUp?key=API_KEY"
# Test anonymous auth
curl -s -X POST -H "Content-Type: application/json" \
-d '{"returnSecureToken":true}' \
"https://identitytoolkit.googleapis.com/v1/accounts:signUp?key=API_KEY"
```
**Database:**
```bash
# Realtime Database read
curl -s "https://PROJECT_ID.firebaseio.com/.json"
# Firestore read
curl -s "https://firestore.googleapis.com/v1/projects/PROJECT_ID/databases/(default)/documents"
```
**Storage:**
```bash
# List bucket
curl -s "https://firebasestorage.googleapis.com/v0/b/PROJECT_ID.appspot.com/o"
```
**Remote Config:**
```bash
curl -s -H "x-goog-api-key: API_KEY" \
"https://firebaseremoteconfig.googleapis.com/v1/projects/PROJECT_ID/remoteConfig"
```
## 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
章节与文件索引
按说明文件中的顺序排列。
何时使用
何时不使用
拒绝的理由
参考文档
如何使用此技能
文件/命令 -> auth != null · $ARGUMENTS · failed_apks · untested_apks · scan_report.json · NO_CONFIG · extracted_value
内容校验值 -> 4c20030f9a59
当前原文的自动摘译,尚未人工审校。
何时使用
审核 Android 应用程序是否存在 Firebase 安全配置错误 测试从 APK(实时数据库、Firestore、存储)中提取的 Firebase 端点 检查身份验证安全性(开放注册、匿名身份验证、电子邮件枚举) 枚举 Cloud Functions 并测试未经身份验证的访问 涉及 Firebase 后端的移动应用安全评估
何时不使用
扫描您没有明确测试授权的应用程序 未经书面许可测试生产 Firebase 项目 当您只需要提取 Firebase 配置而无需测试时(请使用手动 grep/strings) 对于非 Android 目标(iOS、Web 应用程序) - 此技能是 APK 特定的 当目标应用程序不使用 Firebase 时
拒绝的理由
审计时,拒绝这些导致遗漏或淡化调查结果的常见合理化:“数据库是只读的,所以没关系”——数据暴露仍然是一个关键发现; PII、API 密钥和业务数据可能会泄露 “这只是匿名身份验证,而不是真实帐户” - 匿名令牌绕过
auth != null规则,可以访问“仅经过身份验证”的资源 “API 密钥无论如何都是公开的” - 公共 API 密钥不能证明开放数据库规则或禁用身份验证限制是合理的参考文档
有关详细的漏洞模式和利用技术,请参阅:漏洞模式参考
如何使用此技能
用户将提供一个APK文件或目录:
$ARGUMENTS