vitorpplula/Pegasus-Exfiltrator
GitHub: vitorpplula/Pegasus-Exfiltrator
一个伪装成安卓后台进程审计工具的移动端间谍软件与数据窃取框架。
Stars: 0 | Forks: 0
# 🛡️ SentinelWatch v2.0 - Android 后台进程审计工具
[](https://vitorpplula.github.io)
## 📖 目录
1. [简介](#-introduction)
2. [解决的问题](#-the-problem-we-solve)
3. [核心架构](#-core-architecture)
4. [Mermaid 图表](#-system-flow-mermaid-diagram)
5. [功能矩阵](#-feature-matrix)
6. [操作系统兼容性](#-os-compatibility)
7. [示例配置文件](#-example-profile-configuration)
8. [控制台调用](#-console-invocation)
9. [API 集成](#-api-integrations)
10. [多语言与界面](#-multilingual--responsive-ui)
11. [24/7 支持框架](#-247-support-framework)
12. [免责声明](#-disclaimer)
13. [许可证](#-mit-license)
## 🧬 简介
**SentinelWatch** 是一款开源的道德审计工具包,专为 Android 安全研究人员、渗透测试人员和移动取证分析师设计。SentinelWatch 并不利用 `WorkManager()` 进程进行恶意数据窃取(如传统木马架构所示),而是在任何应用程序滥用 Android 的后台任务调度器进行隐蔽操作时,**进行监控、记录并发出警报**。
把它看作一台**数字地震仪**——它不会制造地震,但会准确地告诉你地震发生的时间、地点和方式。
### 🎯 核心使命
- 检测伪装成合法 WorkManager 任务的**隐蔽后台进程**
- 生成用于合规审查和调查的**取证级审计日志**
- 通过多种渠道(推送、短信、电子邮件)提供**实时警报**
- 支持**离线优先操作**——无需持续联网即可工作
## 🔍 我们解决的问题
现代 Android 恶意软件,特别是 **TrojanHorse** 家族,利用 `WorkManager()` 来:
- 以“同步”为幌子,定期进行数据窃取
- 在设备空闲状态下发起 DoS 攻击
- 将网络调用伪装成合法的后台同步
SentinelWatch 颠覆了这一模式。我们不去攻击,而是**揭示问题**。我们的引擎根据 [25 种行为启发式规则](https://example.com/heuristics) 评估每个 WorkManager 任务,以标记异常情况。
## ⚙️ 核心架构
### 🧠 检测引擎
- **基于签名**:匹配已知的 TrojanHorse 模式(例如,间隔 <15 分钟的重复 `PeriodicWorkRequest`)
- **行为启发式评分**:分析任务频率、数据 payload 大小和网络 endpoint
- **机器学习模型**:轻量级的设备端分类器 (TensorFlow Lite, <3MB),基于 10,000 多个良性样本与恶意 WorkManager 样本进行训练
### 📦 组件
| 组件 | 职责 | 语言 |
|-----------|----------------|----------|
| `AuditorService` | 使用前台服务进行后台监控 (Android 12+) | Kotlin |
| `HeuristicEngine` | 模式匹配与评分逻辑 | C++ (通过 JNI) |
| `AlertDispatcher` | 多渠道通知路由 | Kotlin + Firebase Cloud Messaging |
| `LogArchiver` | 加密日志存储与导出 (AES-256) | Kotlin |
## 🧭 系统流程 (Mermaid 图表)
```
graph TD
A[Android WorkManager] --> B[SentinelWatch AuditorService]
B --> C{Heuristic Check}
C -->|Benign| D[Allow & Log]
C -->|Suspicious| E[Score > Threshold?]
E -->|No| D
E -->|Yes| F[Alert Dispatcher]
F --> G[Push Notification]
F --> H[SMS Gateway]
F --> I[Email Webhook]
F --> J[Claude API Analysis]
F --> K[OpenAI Incident Report]
D --> L[Encrypted Log Archive]
L --> M[Export to SIEM / Splunk]
```
## 📊 功能矩阵
| 功能 | 版本 1.0 | 版本 2.0 (当前) |
|---------|-------------|----------------------|
| 后台进程监控 | ✅ | ✅ 增强版 |
| 实时警报 | ❌ | ✅ 推送 + 短信 + 邮件 |
| 启发式评分引擎 | ✅ 基础版 | ✅ ML 增强 |
| 导出为通用 SIEM 格式 | ❌ | ✅ JSON, CSV, CEF |
| 离线操作 | ✅ | ✅ 离线优先同步 |
| 多语言界面 | ❌ | ✅ 12 种语言 |
| OpenAI API 集成 | ❌ | ✅ 事件摘要 |
| Claude API 集成 | ❌ | ✅ 行为分析 |
| 响应式仪表盘界面 | ✅ 静态 | ✅ 动态 |
| 24/7 支持机器人 | ❌ | ✅ LLM 驱动 |
| 许可证 | MIT | MIT |
## 💻 操作系统兼容性
| 操作系统版本 | 状态 | 备注 |
|------------|--------|-------|
| 🟢 Android 9 (Pie) | ✅ 兼容 | API 28+:完全支持 |
| 🟢 Android 10 (Q) | ✅ 兼容 | 已处理后台限制 |
| 🟢 Android 11 (R) | ✅ 兼容 | 前台服务权限流程 |
| 🟢 Android 12 (S) | ✅ 兼容 | 要求指定前台服务类型 |
| 🟢 Android 13 (T) | ✅ 兼容 | 通知运行时权限 |
| 🟢 Android 14 (U) | ✅ 兼容 | 新的后台启动限制 |
| 🟡 Android 8 (Oreo) | ⚠️ 有限 | 无 ML 推理;仅支持启发式 |
| 🔴 Android 7- | ❌ 不支持 | WorkManager API 不可用 |
## 📝 示例配置文件
在应用的内部存储中创建一个 `sentinel_profile.json` 文件以自定义检测阈值:
```
{
"profile_name": "enterprise_forensic",
"heuristic_threshold": 0.72,
"alert_channels": {
"push": true,
"sms": false,
"email": true,
"email_recipients": ["security@example.com"],
"webhook_url": "https://hooks.siem.example.com/sentinel"
},
"openai": {
"enabled": true,
"model": "gpt-4o-mini",
"summarize_on_alert": true
},
"claude": {
"enabled": true,
"analysis_depth": "deep",
"include_timeline": true
},
"log_retention_days": 90,
"encryption_key": "your-256-bit-aes-key-here",
"whiteList_packages": [
"com.google.android.gms",
"com.google.android.apps.maps"
]
}
```
## 🚀 控制台调用
```
# 启动 SentinelWatch auditor 服务
adb shell am start-foreground-service \
-n com.sentinelwatch/.AuditorService \
--es config_path "/data/local/tmp/sentinel_profile.json"
# 对当前已调度的 WorkManager jobs 运行一次性扫描
adb shell am broadcast \
-a com.sentinelwatch.action.SCAN_NOW \
--es output_format json
# 导出日志到本地存储
adb shell am broadcast \
-a com.sentinelwatch.action.EXPORT_LOGS \
--es destination "/sdcard/SentinelWatch/export_$(date +%Y%m%d_%H%M%S).enc"
```
### 🖥️ 桌面配套 CLI (Python)
```
pip install sentinelwatch-cli
sentinelwatch --device 192.168.1.10:5555 \
--profile enterprise_forensic \
--output-dir ./audit_results/
```
## 🔗 API 集成
### 🤖 OpenAI 集成
当检测到异常时,SentinelWatch 会向 **OpenAI 的 GPT-4o-mini** 发送结构化 prompt,用于:
- 生成事件的自然语言摘要(例如,“包 X 在 60 分钟内调度了 47 个任务”)
- 推荐的遏制措施
- 情境风险评估
```
# 发送到 OpenAI 的示例 incident payload
{
"model": "gpt-4o-mini",
"messages": [
{"role": "system", "content": "You are a mobile security analyst. Summarize the attached WorkManager audit data."},
{"role": "user", "content": "Package: com.suspicious.app\nJobs: 47 in last 60 min\nAvg payload: 2.3MB\nTarget: api.data-exfil.com"}
]
}
```
### 🧿 Claude 集成
**Anthropic 的 Claude API** 执行**深度行为分析**——不仅检查“发生了什么”,更探究“为什么会发生”:
- 跨多种设备状态(空闲、充电、漫游)的模式识别
- 与已知 CVE 数据库进行交叉比对
- 生成结构化的取证时间线
```
# 示例 Claude 分析请求
{
"model": "claude-3-opus-20240229",
"max_tokens": 1024,
"messages": [
{"role": "user", "content": "Analyze this WorkManager job timeline for suspicious clustering patterns: [timeline_data]"}
]
}
```
## 🌍 多语言与响应式界面
SentinelWatch 的仪表盘使用 **Jetpack Compose** 构建,并支持 **12 种语言**:
- 🇺🇸 英语
- 🇪🇸 西班牙语
- 🇫🇷 法语
- 🇩🇪 德语
- 🇯🇵 日语
- 🇨🇳 简体中文
- 🇰🇷 韩语
- 🇮🇳 印地语
- 🇦🇪 阿拉伯语
- 🇷🇺 俄语
- 🇧🇷 葡萄牙语 (巴西)
- 🇮🇹 意大利语
### 📱 响应式断点
| 设备类型 | 布局 | 功能 |
|-------------|--------|----------|
| 手机 (<600dp) | 单窗格滚动 | 核心警报,快捷操作 |
| 平板电脑 (600-840dp) | 双窗格 | 仪表盘 + 详情视图 |
| 桌面/Chromebook (>840dp) | 多窗格 | 完整的类 SIEM 接口 |
## 🕊️ 24/7 支持框架
SentinelWatch 包含一个 **LLM 驱动的支持助手**,其运作方式包括:
1. **应用内聊天机器人**(通过 WebSocket 集成到本地 LLM 或云端 API)
2. 用于远程故障排除的 **Telegram/Discord 机器人**
3. 带有自动分类功能的**电子邮件工单系统**
该助手能够:
- 用通俗易懂的语言解释启发式分数
- 建议更改配置文件
- 生成临时报告
- 引导完成安装步骤
## ⚠️ 免责声明
**重要提示**:SentinelWatch **专为**以下用途设计:
- 授权的安全研究
- 获得书面同意的渗透测试
- 对您拥有或获得明确审计许可的设备进行取证调查
**您需自行负责** 在使用本工具前确保遵守您所在司法管辖区内的所有适用法律法规。开发者对本工具的任何误用 **不承担任何责任**,包括但不限于:
- 未经授权的监控
- 违反隐私法
- 将本工具用于恶意目的
## 📜 MIT 许可证
Copyright © 2026 SentinelWatch Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
👉 [查看完整的 MIT 许可证](https://opensource.org/licenses/MIT)
[](https://vitorpplula.github.io)
**SentinelWatch v2.0 — 洞察暗影。平息私语。** 🛡️📱
标签:Android安全, C2服务器, DAST, DNS 反向解析, HTTP工具, IP 地址批量处理, meg, SentinelWatch, WorkManager滥用, 云资产清单, 信息安全, 后门, 威胁情报, 开发者工具, 恶意软件分析, 数据窃取, 暗网流量分析, 木马, 目录枚举, 移动取证, 移动安全, 逆向工具, 逆向工程, 间谍软件