tworjaga/bluescope

GitHub: tworjaga/bluescope

一款集成机器学习异常检测的跨平台蓝牙安全监控与分析平台,支持实时流量捕获、信号复制和安全审计。

Stars: 0 | Forks: 0

# 🔵 BlueScope [![Python](https://img.shields.io/badge/Python-3.11+-blue.svg)](https://www.python.org/) [![PyQt6](https://img.shields.io/badge/PyQt6-6.6+-green.svg)](https://www.riverbankcomputing.com/software/pyqt/) [![License](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) [![Version](https://img.shields.io/badge/Version-0.2.0-success.svg)](CHANGELOG.md) [![Platform](https://img.shields.io/badge/Platform-Windows%20%7C%20Linux%20%7C%20macOS-lightgrey.svg)]() [![Status](https://img.shields.io/badge/Status-Production%20Ready-brightgreen.svg)]()
一款专业级的蓝牙监控与分析工具,具备 ML 驱动的异常检测、实时可视化、信号复制、安全审计以及全面的设备画像功能。 ![BlueScope 截图](https://raw.githubusercontent.com/tworjaga/bluescope/main/docs/screenshot.png) ## 功能特性 ### 核心能力 - **实时蓝牙监控** - 实时捕获和分析 BLE 流量 - **专业 GUI** - 深色主题界面,包含 6 个功能选项卡 - **ML 驱动的分析** - 使用 Isolation Forest 和 Autoencoders 进行异常检测 - **设备画像** - 全面的设备行为分析 - **实时可视化** - 流量和 RSSI 的实时图表 - **统计仪表板** - 详细的指标和性能指示器 ### 信号复制与实时捕获 - **信号录制** - 实时捕获并存储蓝牙信号 - **信号复制** - 支持多种模式(立即、延迟、突发、随机)重放信号 - **实时信号表** - 实时可视化捕获的信号,带有 RSSI 颜色编码 - **导出/导入** - 将信号捕获保存为 JSON 以供后续分析 - **信号重放** - 复制捕获的流量模式用于测试 ### 安全分析 - **设备扫描器** - 发现并对附近的蓝牙设备进行画像 - **安全审计** - 全面的漏洞评估 - **信道分析器** - 分析 BLE 信道使用情况和干扰 - **法拉第模拟器** - RF 隔离效果的教育模拟 - **漏洞检测** - 识别已知的易受攻击设备特征 ### 蓝牙 Spam(安全测试) - **广播 Spam** - 泛洪广播信道(模拟模式) - **连接请求 Spam** - 测试设备弹性 - **L2CAP/ATT 数据包 Spam** - 协议级测试 - **真实传输** - 仅限 Linux,需要 root 权限和合适的硬件 ### 分析功能 - **行为引擎** - 模式检测和基线画像 - **异常检测** - 基于统计和 ML 的异常识别 - **设备追踪** - 同时监控多个设备 - **数据包分析** - 深度包检测和协议分析 - **会话重放** - 重放捕获的会话进行分析 ### 用户界面 - **6 个选项卡**:设备、数据包、异常、统计、图表、实时捕获 - **深色主题** - 专业 VS Code 风格设计 - **实时更新** - 每秒实时刷新数据 - **搜索与过滤** - 快速数据过滤和搜索 - **导出功能** - 支持 CSV 和 JSON 导出以进行进一步分析 ## 快速开始 ### 前置条件 - **Python 3.11+**(推荐 Python 3.14) - **Windows 10/11**(主要支持),Linux,macOS - **4GB RAM** 最低(推荐 8GB) - **100MB** 磁盘空间 ### 安装 #### 方法 1:一键启动(最简单) ``` # Clone the repository git clone https://github.com/tworjaga/bluescope.git cd bluescope # 运行 launcher start.bat ``` #### 方法 2:手动设置 ``` # Clone the repository git clone https://github.com/tworjaga/bluescope.git cd bluescope # 创建 virtual environment python -m venv venv # 激活 virtual environment venv\Scripts\activate # Windows source venv/bin/activate # Linux/Mac # 安装 dependencies pip install -r requirements-minimal.txt # 启动 application python main.py ``` #### 方法 3:包含所有功能的完整安装 ``` # 安装所有 dependencies,包括 ML 和 security features pip install -r requirements.txt # Launch python main.py ``` ## 使用指南 ### 启动 BlueScope 1. **启动应用程序**: - 运行 `start.bat`,或 - 运行 `python main.py` 2. **开始捕获**: - 点击绿色的“▶ Start Capture”按钮 - 观察实时数据填充所有面板 3. **探索功能**: - **设备选项卡**:查看发现的蓝牙设备 - **数据包选项卡**:检查捕获的数据包 - **异常选项卡**:查看 ML 检测到的异常 - **统计面板**:监控实时指标 - **图表**:可视化流量和 RSSI 数据 - **实时捕获**:录制和复制信号 ### 安全分析 1. **打开安全审计**:工具 > 安全审计 (Ctrl+Shift+A) 2. **运行设备扫描器**:点击“Start Security Scan” 3. **分析信道**:切换到“Channel Analyzer”选项卡 4. **查看结果**:查看漏洞和建议 ### 信号复制 1. **打开实时捕获**:切换到“Live Capture”选项卡 2. **开始录制**:点击“Start Recording” 3. **配置复制**:设置模式(立即/延迟/突发/随机) 4. **开始复制**:点击“▶ Start Duplication” 5. **重放信号**:使用“Replay”控件 ### 关键控件 - **Ctrl+P**:开始/停止捕获 - **Ctrl+Shift+A**:安全审计 - **Ctrl+Shift+D**:信号复制 - **Ctrl+Shift+S**:蓝牙 Spam(安全测试) - **Ctrl+S**:保存会话 - **Ctrl+E**:导出到 CSV - **Ctrl+R**:重置统计 - **F5**:刷新视图 - **F11**:切换全屏 ## 架构 ``` bluescope/ ├── main.py # Application entry point ├── frontend/ # GUI components │ ├── ui/ # UI widgets │ │ ├── main_window.py # Main application window │ │ ├── device_table.py # Device listing table │ │ ├── packet_table.py # Packet inspection table │ │ ├── statistics_panel.py # Real-time statistics │ │ ├── graphs.py # Traffic & RSSI graphs │ │ ├── anomaly_panel.py # Anomaly display │ │ ├── live_capture_view.py # Signal duplication UI │ │ ├── packet_inspector.py # Deep packet inspection │ │ ├── session_replay.py # Session replay controls │ │ ├── export_config_dialog.py # Export configuration │ │ └── alert_notification.py # Alert system │ └── themes/ # UI themes │ └── dark_theme.py # Dark theme styling ├── backend/ # Core backend modules │ ├── capture_manager.py # Bluetooth capture engine │ ├── signal_duplicator.py # Signal recording & replay │ ├── bluetooth_security.py # Security analysis tools │ ├── bluetooth_spam.py # Security testing (simulation) │ ├── linux_bluetooth_tx.py # Real transmission (Linux) │ ├── export_manager.py # Data export functionality │ ├── session_manager.py # Session management │ ├── protocol_parser.py # BLE protocol parsing │ ├── filter_engine.py # Packet filtering │ ├── ml_integration.py # Machine learning integration │ ├── multi_capture_manager.py # Multi-device capture │ ├── advanced_protocols.py # Advanced protocol support │ ├── plugin_system.py # Plugin architecture │ ├── error_handler.py # Error handling │ ├── performance_optimizer.py # Performance optimization │ └── platform_utils.py # Platform-specific utilities ├── analytics/ # Analytics engines │ ├── behavior_engine/ # Behavior analysis │ │ └── main.py │ └── anomaly_engine/ # Anomaly detection │ ├── main.py │ └── ml_detector.py ├── agents/ # Capture agents │ └── bt-capture/ # Rust-based capture agent │ └── src/ ├── config/ # Configuration files │ └── settings.yaml ├── docs/ # Documentation │ └── API_REFERENCE.md ├── exports/ # Export directory ├── logs/ # Application logs └── tests/ # Test suite ``` ## 配置 编辑 `config/settings.yaml` 进行自定义: ``` app: name: "BlueScope" version: "0.2.0" log_level: "INFO" capture: device: "auto" buffer_size: 10000 update_interval: 1000 backend: "mock" # Options: mock, bleak, rust analytics: behavior_engine: enabled: true baseline_window: 86400 anomaly_engine: enabled: true threshold: 2.5 signal_duplication: enabled: true auto_record: false default_mode: "immediate" security: auto_scan: false vulnerability_check: true ui: theme: "dark" update_rate: 1000 max_table_rows: 10000 ``` ## 依赖 ### 核心(最小安装) - **PyQt6** (>=6.6.0) - GUI 框架 - **NumPy** (>=1.26.0) - 数据处理 - **python-dotenv** (>=1.0.0) - 环境变量 - **PyYAML** (>=6.0.1) - 配置管理 ### ML 与分析(完整安装) - **scikit-learn** (>=1.8.0) - 机器学习算法 - **PyTorch** (>=2.9.0) - 深度学习框架 - **scipy** (>=1.16.0) - 科学计算 ### 安全与捕获(可选) - **bleak** (>=0.21.0) - 跨平台 BLE 库 - **pyusb** (>=1.2.1) - USB 设备访问 完整列表请参见 `requirements.txt`。 ## 测试 运行验证脚本: ``` python verify_installation.py ``` 运行后端测试: ``` python backend/bluetooth_security.py ``` 预期输出: ``` ============================================================ Bluetooth Security Module Test ============================================================ 1. Testing Bluetooth Scanner... Devices found: 4 Security issues: 10 Critical devices: 2 2. Testing Channel Analyzer... Total packets: 33 Interference detected: False 3. Testing Faraday Simulator... Devices blocked: 4 Remaining: 0 4. Testing Full Security Audit... Risk Level: LOW Key Findings: 4 ✓ All security module tests passed! ``` ## 法律声明 **仅供授权安全测试使用** BlueScope 包含的安全测试功能(蓝牙 Spam、信号复制)旨在用于: - 授权的渗透测试 - 受控环境下的安全研究 - 教育目的 - 测试您自己的设备 **请勿使用这些功能:** - 在未经明确许可的情况下攻击网络或设备 - 破坏公共蓝牙服务 - 违反任何法律法规 - 骚扰或监视个人 作者不对本软件的滥用负责。在测试任何蓝牙系统之前,请务必确保您拥有适当的授权。 ## 许可证 本项目根据 MIT 许可证授权 - 详情请参见 [LICENSE](LICENSE) 文件。 ## 支持 - **Issues**: [GitHub Issues](https://github.com/tworjaga/bluescope/issues) - **讨论**: [GitHub Discussions](https://github.com/tworjaga/bluescope/discussions) - **Email**: tworjaga@example.com ## 路线图 ### 版本 0.2.0(当前) - [x] 信号复制与实时捕获 - [x] 安全审计与设备扫描器 - [x] 信道分析器 - [x] 蓝牙 Spam(安全测试) - [x] 会话重放 - [x] 导出/导入功能 ### 版本 0.3.0(计划中) - [ ] 真实蓝牙硬件集成 - [ ] 高级协议解析器(BLE 5.0, Mesh) - [ ] 多设备同时捕获 - [ ] 云同步 - [ ] 高级 ML 模型 - [ ] 插件系统 ### 版本 1.0.0(未来) - [ ] 生产就绪版本 - [ ] 完整硬件支持(Ubertooth, HackRF) - [ ] 完整文档 - [ ] 企业功能 - [ ] 综合测试套件 ## 项目状态 - **版本**:0.2.0 - **状态**:生产就绪 - **最后更新**:2025 年 2 月 - **Python**:3.11+ - **平台**:Windows(主要),Linux,macOS ## Star 历史 如果您觉得这个项目有用,请考虑给它一个 star
标签:Apex, BLE分析, BlueScope, PyQt6, Python, PyTorch, Scikit-learn, 信号监控, 信号重放, 凭据扫描, 异常检测, 无后门, 服务器监控, 机器学习, 系统分析, 网络分析, 蓝牙安全, 蓝牙调试, 设备画像, 逆向工具