cognis-digital/blescope

GitHub: cognis-digital/blescope

一款用于嗅探并解码 BLE GATT 流量、识别设备指纹并在 CI 中自动断言不安全配对与特征的蓝牙设备安全审计工具。

Stars: 1 | Forks: 0

BLESCOPE # BLESCOPE ### 嗅探并解码 BLE GATT 流量,对设备配置文件进行指纹识别,并在 CI 中针对捕获的数据断言不安全的配对/特征。 [![PyPI](https://img.shields.io/pypi/v/cognis-blescope.svg?color=6b46c1)](https://pypi.org/project/cognis-blescope/) [![CI](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/00ef8a728f073130.svg)](https://github.com/cognis-digital/blescope/actions) [![License: COCL 1.0](https://img.shields.io/badge/License-COCL%201.0-2b6cb0.svg)](LICENSE) [![Suite](https://img.shields.io/badge/Cognis-Neural%20Suite-6b46c1.svg)](https://github.com/cognis-digital) *IoT / OT / 嵌入式 — 固件、总线及设备安全。*
``` pip install cognis-blescope blescope scan . # → prioritized findings in seconds ``` ## 用法 — 逐步指南 `blescope` 可解码 BLE GATT 捕获数据,对设备配置文件进行指纹识别,并对不安全的配对/访问进行断言。 1. **安装** (Python 3.10+): pip install -e . # 或:pipx install blescope 2. **扫描捕获数据**(人类可读报告): blescope scan demos/01-basic/frontdoor_lock.json 3. **筛选可操作的发现**(达到/超过特定严重级别的): blescope scan capture.json --min-severity medium 4. **将输出读取为** JSON,以便通过管道传输 / 集成到仪表板: blescope scan capture.json --format json | jq '.findings' cat capture.json | blescope scan - # stdin 5. **在 CI 中拦截不安全的设备** — 当报告任何可操作的发现时以退出码 `1` 退出,无异常时为 `0`,用法错误时为 `2`: - 运行:pip install -e . && blescope scan capture.json # 非零退出码将导致作业失败 ## 目录 - [为什么选择 blescope?](#why) · [功能](#features) · [快速开始](#quick-start) · [示例](#example) · [架构](#architecture) · [AI stack](#ai-stack) · [对比](#how-it-compares) · [集成](#integrations) · [随处安装](#install-anywhere) · [相关项目](#related) · [贡献](#contributing) ## 为什么选择 blescope? 智能锁和可穿戴设备的拆解文化 —— “这款 200 美元的锁使用 Just-Works 配对,并暴露了可写的解锁特征”这种话题极具传播性;且可从保存的捕获数据中复现。 `blescope` 是单一用途、可脚本化且可自托管的:将其指向目标,以您的工作流已支持的语言(表格 · JSON · SARIF)获取优先级排序的结果,据此拦截 CI 流程,并让 agent 通过 MCP 驱动它。
↑ 返回顶部
## 功能 - ✅ 解码 Uuid - ✅ 加载 Capture - ✅ Profile 指纹识别 - ✅ 审计 Pairing - ✅ 分析 Capture - ✅ 可在 Linux/macOS/Windows · Docker · devcontainer 上运行 - ✅ 提供 Python、JavaScript、Go 和 Rust 移植版 (`ports/`)
↑ 返回顶部
## 快速开始 ``` pip install cognis-blescope blescope --version blescope scan . # scan current project blescope scan . --format json # machine-readable blescope scan . --fail-on high # CI gate (non-zero exit) ```
↑ 返回顶部
## 示例 ``` $ blescope scan . [HIGH ] BLE-001 example finding (./src/app.py) [MEDIUM ] BLE-002 another signal (./config.yaml) 2 findings · risk score 5 · 38ms ```
↑ 返回顶部
## 架构 ``` flowchart LR IN[capture / scan] --> P[blescope
parse + map] P --> OUT[report] ```
↑ 返回顶部
## 从任何 AI stack 中使用它 `blescope` 可与所有流行的 AI 使用方式互操作: - **MCP server** — `blescope mcp` (Claude Desktop, Cursor, Cognis.Studio, [uncensored-fleet](https://github.com/cognis-digital/uncensored-fleet)) - **兼容 OpenAI / JSON** — 通过管道将 `blescope scan . --format json` 传给任何 agent 或 LLM - **LangChain · CrewAI · AutoGen · LlamaIndex** — 一行代码将 CLI/JSON 封装为工具 - **CI / 脚本** — 为非 AI pipeline 提供退出码 + SARIF
↑ 返回顶部
## 对比 | | **Cognis blescope** | Sniffle + gattacker | |---|:---:|:---:| | 可自托管,无需账号 | ✅ | 视情况而定 | | 单一命令,零配置 | ✅ | ⚠️ | | 支持用于 CI 的 JSON + SARIF | ✅ | 视情况而定 | | 原生支持 MCP (AI agent) | ✅ | ❌ | | 多语言移植版 (JS/Go/Rust) | ✅ | ❌ | | 开源许可 | ✅ COCL | 视情况而定 | *本着 **Sniffle + gattacker** 的精神打造,以 Cognis 的方式重新呈现。遗漏了致谢?欢迎提交 PR。*
↑ 返回顶部
## 集成 可接入您的技术栈:用于代码扫描的 **SARIF**、用于一切的 **JSON**、用于 AI agent 的 **MCP server** (`blescope mcp`),以及用于 SIEM/Slack/Jira 的 webhook 转发器。请参阅 [`docs/INTEGRATIONS.md`](docs/INTEGRATIONS.md)。
↑ 返回顶部
## 安装 — 各种方式,各个平台 ``` pip install "git+https://github.com/cognis-digital/blescope.git" # pip (works today) pipx install "git+https://github.com/cognis-digital/blescope.git" # isolated CLI uv tool install "git+https://github.com/cognis-digital/blescope.git" # uv pip install cognis-blescope # PyPI (when published) docker run --rm ghcr.io/cognis-digital/blescope:latest --help # Docker brew install cognis-digital/tap/blescope # Homebrew tap curl -fsSL https://raw.githubusercontent.com/cognis-digital/blescope/main/install.sh | sh ``` | Linux | macOS | Windows | Docker | Cloud | |---|---|---|---|---| | `scripts/setup-linux.sh` | `scripts/setup-macos.sh` | `scripts/setup-windows.ps1` | `docker run ghcr.io/cognis-digital/blescope` | [DEPLOY.md](docs/DEPLOY.md) (AWS/Azure/GCP/k8s) |
↑ 返回顶部
## 相关 Cognis 工具 - [`fwxray`](https://github.com/cognis-digital/fwxray) — 对比两个固件镜像,并准确呈现更改的内容:新二进制文件、更改的配置标志、新增证书以及偏移的熵区域。 - [`canzap`](https://github.com/cognis-digital/canzap) — 使用微型 YAML DSL 从 .pcap 或 SocketCAN 接口重放、模糊测试并断言 CAN 总线流量。 - [`sbomb`](https://github.com/cognis-digital/sbomb) — 直接从解包的固件根文件系统生成 CycloneDX SBOM,并标记具有已知 CVE 和 EOL 内核的组件。 - [`mqttspy`](https://github.com/cognis-digital/mqttspy) — 被动映射 MQTT broker:枚举 topic,检测未经身份验证的写入,发现 payload 中的 PII/机密,并生成风险报告。 - [`uefiscan`](https://github.com/cognis-digital/uefiscan) — 审计 UEFI 固件转储,查找缺失的 Secure Boot 密钥、未签名模块、S3 启动脚本漏洞以及已知的 SMM 威胁。 - [`modpot`](https://github.com/cognis-digital/modpot) — 启动一个高交互的 Modbus/DNP3 ICS 蜜罐,将攻击者的寄存器读取/写入记录为结构化 JSON。 **探索套件 →** [🗂️ 所有 170+ 工具](https://github.com/cognis-digital/cognis-neural-suite) · [⭐ awesome-cognis](https://github.com/cognis-digital/awesome-cognis) · [🔗 cognis-sources](https://github.com/cognis-digital/cognis-sources) · [🤖 uncensored-fleet](https://github.com/cognis-digital/uncensored-fleet) · [🧠 engram](https://github.com/cognis-digital/engram)
↑ 返回顶部
## 互操作性 `{}` 与 300+ 工具的 Cognis suite 组合使用 — JSON 输入/输出以及共享的 兼容 OpenAI 的 `/v1` 骨干网络。有关套件映射、组合模式和参考技术栈,请参阅 **[INTEROP.md](INTEROP.md)**。 ## 许可证 在 **Cognis Open Collaboration License (COCL) v1.0** 下提供源码 — 可免费用于个人、内部评估、研究和教育用途;**商业/生产用途需要许可证** (licensing@cognis.digital)。请参阅 [LICENSE](LICENSE)。
Cognis Digital · Cognis Neural Suite 中的 170+ 工具之一 · Making Tomorrow Better Today
标签:可视化界面, 开源框架, 持续集成, 数据可视化, 日志审计, 物联网安全, 蓝牙, 请求拦截, 逆向工具