CreatmanCEO/security-scanner

GitHub: CreatmanCEO/security-scanner

基于 Telegram 机器人的移动安全扫描器,通过 VPN 流量分析无需安装应用即可检测手机上的恶意软件、间谍软件和后门等威胁。

Stars: 1 | Forks: 0

**🌐 语言 / Язык** [![English](https://img.shields.io/badge/English-blue?style=for-the-badge)](README.md) [![Русский](https://img.shields.io/badge/Русский-red?style=for-the-badge)](README.ru.md)
# 安全扫描机器人 **通过 VPN 流量分析检测移动威胁——无需安装应用。** Telegram 上的 [@secure_scanbot](https://t.me/secure_scanbot) [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE) [![Stars](https://img.shields.io/github/stars/CreatmanCEO/security-scanner?style=flat&color=yellow)](https://github.com/CreatmanCEO/security-scanner/stargazers) [![Validate](https://static.pigsec.cn/wp-content/uploads/repos/2026/05/0c86a43163001037.svg)](https://github.com/CreatmanCEO/security-scanner/actions/workflows/validate.yml) [![Bot](https://img.shields.io/badge/%40secure__scanbot-LIVE-22c55e?logo=telegram)](https://t.me/secure_scanbot) [![Platform](https://img.shields.io/badge/platform-Telegram-blue.svg)](https://t.me/secure_scanbot) [![IDS 规则](https://img.shields.io/badge/Suricata%20rules-18%2C987-orange.svg)](#suricata-ids-integration) [![Stalkerware 数据库](https://img.shields.io/badge/stalkerware%20domains-919-red.svg)](#layer-3-blacklist-correlation) [![JA3 指纹](https://img.shields.io/badge/JA3%20malware%20fingerprints-97-purple.svg)](#layer-4-ja3-tls-fingerprinting) ## 界面预览
Onboarding flow — three Telegram screens: phone-virus-scan greeting with the five-step explanation, the policy disclaimer 'we do not read your messages or see your passwords — only what your phone is connecting to', and the VPN-client picker for Android (Hiddify, v2rayNG, NekoBox) and iPhone (Streisand, Hiddify)
1 — Onboarding & VPN setup
Plain-language explanation of how the scan works, an explicit privacy disclaimer ("we don't read your messages — only what your phone is connecting to"), and per-OS VPN-client links with Russia-aware AppStore / Google Play fallbacks.
Scan flow — three Telegram screens: scan started with VPN setup instructions, two ways to provide the VLESS key with copy-to-clipboard, and the final report-delivery screen reporting 'Your phone is safe — 729 connections to 29 services in 10 minutes' with a downloadable HTML report attachment
2 — Active scan and report delivery
Live scan progress with two VPS-key delivery modes (subscription URL recommended, raw VLESS as fallback), then the final report — connection counts, distinct services, and an HTML attachment for offline reading. AI-adaptive: same data, three reading levels.
## 目录 - [项目概述](#project-overview) - [为什么会有这个项目——起源故事](#why-this-exists--the-origin-story) - [工作原理——架构概述](#how-it-works--architecture-overview) - [四层检测引擎](#four-layer-detection-engine) - [第一层:基于端口的威胁检测](#layer-1-port-based-threat-detection) - [第二层:行为流量分析](#layer-2-behavioral-traffic-analysis) - [第三层:黑名单关联](#layer-3-blacklist-correlation) - [第四层:JA3 TLS 指纹识别](#layer-4-ja3-tls-fingerprinting) - [IP 富化](#ip-enrichment) - [误报防护](#false-positive-protection) - [设备制造商遥测](#device-manufacturer-telemetry) - [机器人用户体验流程——完整用户旅程](#bot-ux-flow--complete-user-journey) - [AI 自适应报告](#ai-adaptive-reports) - [真实世界案例研究](#real-world-case-study--26-ssh-connections-on-a-xiaomi-device) - [技术栈](#technology-stack) - [Suricata IDS 集成](#suricata-ids-integration) - [开源集成](#open-source-integrations) - [与现有解决方案的对比](#comparison-with-existing-solutions) - [API 与可扩展性](#api-and-extensibility) - [未来路线图](#future-roadmap) - [文档](#documentation) - [许可证](#license) ## 项目概述 安全扫描机器人是一个基于 Telegram 的移动安全扫描器,完全通过网络流量分析来检测移动设备上的恶意软件、间谍软件、加密货币矿工、后门和可疑遥测数据。 **核心理念:** 手机上的每种恶意软件最终都必须通过网络进行通信。RAT 会连接到其命令和控制 (C2) 服务器。间谍软件会将窃取的数据上传到供应商域。加密矿工会连接到矿池。后门会打开反向 shell。通过将手机流量路由到配备了入侵检测系统、行为分析引擎和威胁情报源的 VPN 端点,我们可以在手机上不安装任何软件的情况下识别受损设备。 ### 价值主张 | 适用对象 | 获得的价值 | |----------|--------------| | **普通用户** | 用通俗易懂的语言解释手机在后台的活动 | | **父母 / 伴侣** | 检测通过物理接触安装的间谍软件 | | **安全研究人员** | 映射到已知恶意软件家族的网络级 IoC 检测 | | **注重隐私的用户** | 全面了解制造商的遥测和跟踪行为 | | **IT 管理员** | 无需部署 MDM 即可进行大规模移动设备评估 | ### 检测内容 | 威胁类别 | 检测方法 | 示例 | |----------------|-----------------|----------| | **远程访问木马** | C2 端口签名 + 信标模式 | AhMyth, SpyNote, AndroRAT, Metasploit | | **后门 / 反向 Shell** | 来自移动设备的出站 SSH/Telnet(异常) | SSH 隧道、Telnet 访问、ADB 暴露 | | **摄像头/麦克风视频流** | 向未知服务器持续上传流 | RTSP 流、WebRTC 数据窃取 | | **间谍软件** | 来自 AssoEchap 数据库的 919 个已知域 | TheTruthSpy, FlexiSpy, mSpy, Spyzie, Hoverwatch | | **加密货币矿工** | Stratum 协议检测 + 矿池域 | 挖掘门罗币的矿工、HiddenMiner、ADB.Miner | | **僵尸网络成员** | 信标分析(周期性 C2 回调) | IRC 僵尸网络、HTTP 僵尸网络、DGA 域 | | **键盘记录器** | 频繁的小数据外发模式 | 商业键盘记录器、RAT 键盘记录模块 | | **广告软件 / 跟踪器** | 域名与已知广告网络的分类比对 | 激进的广告 SDK、跟踪像素 | | **国家级间谍软件** | 高端口 C2 + CloudFront 基础设施 | NSO Pegasus 行为指标 | ## 为什么会有这个项目——起源故事 这个项目源于一次真实的发现。 一位朋友求助,因为他们的小米手机表现异常——过热、电池耗电快,偶尔还会出现无法解释的数据使用量激增。我们通过将手机连接到启用日志记录的 VPN 服务器,设置了一次简单的流量捕获。 **我们的发现:手机发起了 26 个活动的 SSH 连接。** 手机没有任何正当理由发起 SSH 连接,完全没有。SSH 是一种服务器管理协议。在一台普通消费级小米设备上发现 26 个并发的出站 SSH 会话,只意味着一件事:手机上的某个东西正在维持与外部服务器的持久后门隧道。 进一步分析显示: - 连接到位于 6 个国家的 14 个独立 IP 地址 - 信标模式:每 45 秒重新连接一次,带有 15% 的抖动 - 在充电时间(凌晨 2 点 - 6 点)进行数据外发 - 部分连接通过 Dynamic DNS 服务路由 这不是小米的遥测数据。这是一个 RAT——根据端口分布(7771、7775 和其他一些高端口),很可能是 SpyNote 变种。 **问题变得很清晰:** 没有简单的工具可以让普通人在网络层面检查他们的手机是否被入侵。像 MVT 这样的现有解决方案需要取证专业知识。商业防病毒应用基于签名,会遗漏网络层面的威胁。PiRogue 则需要硬件设置。 构建安全扫描机器人正是为了填补这一空白——通过简单的 Telegram 机器人界面,让网络级的移动威胁检测变得触手可及。 ## 工作原理——架构概述 ``` ┌──────────────────────────────────────────────────────────────────┐ │ USER'S PHONE │ │ │ │ User connects to VPN (VLESS+Reality) │ │ All traffic routes through our analysis server │ └────────────────────┬─────────────────────────────────────────────┘ │ │ Encrypted tunnel (VLESS + Reality protocol) │ ┌────────────────────▼─────────────────────────────────────────────┐ │ VPN ANALYSIS SERVER │ │ │ │ ┌─────────────────────────────────────────────────────────┐ │ │ │ xray-core (VLESS+Reality) │ │ │ │ - Terminates VPN tunnel │ │ │ │ - Analyzes connection METADATA ONLY │ │ │ │ (IP, port, SNI, volumes) │ │ │ │ - No TLS interception, no MitM, no CA certificates │ │ │ │ - No PCAP storage — traffic analyzed, not saved │ │ │ │ - Logs connections to access.log │ │ │ └──────────────┬──────────────────────────────────────────┘ │ │ │ │ │ ┌──────────────▼──────────────────────────────────────────┐ │ │ │ Suricata IDS (18,987 rules) │ │ │ │ - ET MOBILE_MALWARE rules │ │ │ │ - ET TROJAN rules │ │ │ │ - ET MALWARE rules │ │ │ │ - Custom mobile-specific rules │ │ │ │ - Outputs: eve.json (alerts + flow records) │ │ │ └──────────────┬──────────────────────────────────────────┘ │ │ │ │ │ ┌──────────────▼──────────────────────────────────────────┐ │ │ │ Zeek Network Monitor │ │ │ │ - Connection logs (conn.log) │ │ │ │ - DNS query logs (dns.log) │ │ │ │ - SSL/TLS certificate logs (ssl.log) │ │ │ │ - HTTP transaction logs (http.log) │ │ │ └──────────────┬──────────────────────────────────────────┘ │ │ │ │ │ ┌──────────────▼──────────────────────────────────────────┐ │ │ │ MalwareDetector — Four-Layer Analysis Engine │ │ │ │ │ │ │ │ Layer 1: Port Analysis (35+ known threat ports) │ │ │ │ └─ Instant match against RAT/backdoor/miner ports │ │ │ │ │ │ │ │ Layer 2: Behavioral Analysis │ │ │ │ ├─ Beaconing detection (C2 callbacks) │ │ │ │ ├─ Data exfiltration patterns │ │ │ │ ├─ Streaming detection (camera/mic) │ │ │ │ └─ Keylogger traffic patterns │ │ │ │ │ │ │ │ Layer 3: Blacklist Correlation │ │ │ │ ├─ 919 stalkerware domains (AssoEchap) │ │ │ │ ├─ Mining pool domains │ │ │ │ ├─ Dynamic DNS services (C2 infrastructure) │ │ │ │ └─ Known malware C2 domains │ │ │ │ │ │ │ │ Layer 4: JA3 TLS Fingerprinting │ │ │ │ ├─ 97 malware fingerprints (abuse.ch SSLBL) │ │ │ │ └─ Detects malware by TLS handshake on port 443 │ │ │ └──────────────┬──────────────────────────────────────────┘ │ │ │ │ │ ┌──────────────▼──────────────────────────────────────────┐ │ │ │ IP Enrichment │ │ │ │ - Offline prefix matching (Google, Apple, Meta, etc.) │ │ │ │ - IP-API.com lookups (org, ASN, country) │ │ │ │ - SQLite cache (24h TTL) │ │ │ │ - AbuseIPDB / OTX threat intelligence │ │ │ └──────────────┬──────────────────────────────────────────┘ │ │ │ │ │ ┌──────────────▼──────────────────────────────────────────┐ │ │ │ AI Analyzer (adaptive report generation) │ │ │ │ - Receives aggregated findings, NOT raw traffic │ │ │ │ - Determines user technical level (beginner/mid/expert) │ │ │ │ - Generates human-readable threat report │ │ │ │ - Specific recommendations: Malwarebytes, Dr.Web, │ │ │ │ TinyCheck (no generic "block the port" advice) │ │ │ │ - Models: Groq LLaMA 3.3 70B / Google Gemini │ │ │ └──────────────┬──────────────────────────────────────────┘ │ │ │ │ └─────────────────┼────────────────────────────────────────────────┘ │ ┌─────────────────▼────────────────────────────────────────────────┐ │ TELEGRAM BOT │ │ │ │ - Delivers scan report to user │ │ - Manages VPN credentials (auto-provisioning) │ │ - Tracks scan history in SQLite │ │ - Handles user interactions via FSM │ └──────────────────────────────────────────────────────────────────┘ ``` ### 数据流(逐步说明) 1. **用户通过** Telegram 机器人启动扫描(`/scan` 命令) 2. **机器人配置**一个临时 VLESS+Reality VPN 配置 3. **用户使用** v2rayNG (Android) 或 Shadowrocket (iOS) 将手机连接到 VPN 4. **所有手机流量**通过分析服务器进行路由,具有可配置的扫描窗口(默认:30 分钟,管理员:10 分钟) 5. **Suricata** 针对 18,987 条规则执行实时签名匹配 6. **Zeek** 生成结构化的连接/DNS/TLS 日志 7. **xray-core** 记录所有连接元数据(目标 IP、端口、协议) 8. **
标签:Beacon Object File, C2, Docker, IP 地址批量处理, JA3指纹, Metaprompt, RAT检测, Rootkit, Suricata, Telegram Bot, TLS指纹识别, VPN流量分析, Zeek, 信息安保, 入侵检测系统, 后门检测, 威胁情报, 安全数据湖, 安全防御评估, 开发者工具, 开源安全工具, 挖矿木马检测, 流量监控, 现代安全运营, 目录枚举, 移动安全, 网络安全, 网络流量分析, 自定义DNS解析器, 自托管, 请求拦截, 跟踪软件检测, 逆向工具, 逆向工程平台, 隐私保护, 黑名单关联