Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2024-4309-Analysis — BGT-Pentest-LAB 最终项目:小米 HyperOS 系统更新 OTA 签名验证绕过(CVE-2024-4309)深度分析。 | Kitploit
工具/GitHubGitHub/winslowe/cve-2024-4309-analysis
漏洞分析漏洞利用密码学渗透测试移动安全学习与教育事件响应二进制利用实验室与实践
GitHubwinslowe/cve-2024-4309-analysis

CVE-2024-4309-Analysis

BGT-Pentest-LAB 最终项目:小米 HyperOS 系统更新 OTA 签名验证绕过(CVE-2024-4309)深度分析。

查看仓库
112个月前尚未审核

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

🛡️ CVE-2024-4309

小米HyperOS系统更新器 — OTA签名验证绕过与RCE


CVSS RCE Python


Status Course License Docker Tests Zero Deps


⚠️ 仅限教育用途 — 禁止在真实系统上使用。




📋 项目概述 / Project Overview

为 BGT-Pentest-LAB 网络安全期末项目而准备。

本仓库包含对Xiaomi HyperOS System Updater组件中存在的CVE-2024-4309漏洞的深入分析、攻击模拟、检测引擎和交互式Web仪表盘,该漏洞允许远程代码执行(RCE)。

🔴 漏洞摘要

字段值
CVE IDCVE-2024-4309
组件System Updater (HyperOS)
严重性🔴 Critical (CVSS 9.1)
CWECWE-347: 不正确的加密签名验证
影响持久RCE, Root权限
修复HyperOS 1.0.4.0+

🎯 攻击向量

指标值
Attack Vector相邻网络
Complexity低
Privileges无
User Interaction无
Scope已改变
CVSS VectorAV:A/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N



💀 攻击流程 / Attack Kill Chain

root@kitploit:~
flowchart TD
    subgraph MITM ["阶段1: 网络访问劫持 (MITM)"]
        A["🌐 1. MITM (ARP Spoofing)"] --> B["🎯 2. DNS Hijack (update.miui.com)"]
    end

    subgraph INJECTION ["阶段2: 数据库与数据包操纵"]
        B --> C["💾 3. 哈希注入 (ota_hashes.db)"]
        C --> D["📦 4. 恶意OTA包准备"]
    end

    subgraph BYPASS ["阶段3: 安全检测绕过"]
        D --> E["🔓 5. RSA签名绕过 (Fast Channel)"]
        E --> F["⚡ 6. 哈希验证绕过 (strstr Bug)"]
    end

    subgraph EXPLOIT ["阶段4: 权限提升与数据渗出"]
        F --> G["💀 7. RCE与持久Root (system.img Flash)"]
    end

    %% 样式定义
    style MITM fill:#0f172a,stroke:#38bdf8,stroke-width:1px,color:#38bdf8
    style INJECTION fill:#0f172a,stroke:#818cf8,stroke-width:1px,color:#818cf8
    style BYPASS fill:#0f172a,stroke:#f59e0b,stroke-width:1px,color:#f59e0b
    style EXPLOIT fill:#0f172a,stroke:#ef4444,stroke-width:2px,color:#ef4444

    style A fill:#1e293b,stroke:#0284c7,stroke-width:2px,color:#e2e8f0
    style B fill:#1e293b,stroke:#0284c7,stroke-width:2px,color:#e2e8f0
    style C fill:#1e293b,stroke:#4f46e5,stroke-width:2px,color:#e2e8f0
    style D fill:#1e293b,stroke:#4f46e5,stroke-width:2px,color:#e2e8f0
    style E fill:#451a03,stroke:#d97706,stroke-width:2px,color:#fef3c7
    style F fill:#451a03,stroke:#d97706,stroke-width:2px,color:#fef3c7
    style G fill:#4c0519,stroke:#e11d48,stroke-width:3px,color:#ffe4e6
📖 详细说明 — 点击查看每一步的技术细节
步骤动作技术细节
1MITM位置通过ARP欺骗或虚假Wi-Fi热点截获网络流量
2DNS劫持将update.miui.com的DNS响应指向攻击者服务器
3哈希注入向ota_hashes.db数据库注入部分恶意哈希
4恶意OTA包创建带有X-Xiaomi-Fast-Channel: true头的虚假update.zip
5RSA绕过MiuiRecoveryVerifier看到Fast Channel头,跳过RSA验证
6哈希绕过quickHashCheck → strstr()部分匹配 → 绕过
7RCE在Recovery模式下刷入恶意system.img → 持久Root



⚙️ 开发工具 / Developed Tools




🖥️ C2 Dashboard
app.py

使用高级Web面板逐步可视化攻击模拟的交互式仪表盘。
包含Kill chain、风险评分、实时日志。




⚔️ 攻击模拟器
attack.py

使用虚假OTA服务器进行MITM攻击模拟。
4个REST端点、恶意ZIP生成、
哈希注入和Fast Channel绕过。




🔍 检测引擎
detector.py

三阶段OTA安全扫描器。
包含strstr()检测、Fast Channel分析、
风险评分和IoC报告。


🔧 修复演示
fix_demo.py

strstr() vs strcmp()交互式
比较与补丁演示。


📄 报告生成器
report_generator.py

生成PDF就绪的专业HTML
漏洞分析报告。


🧪 测试套件
test_suite.py

27个自动化单元测试。
攻击+检测器集成测试。




🐛 根本原因 / Root Cause

❌ 漏洞代码 (strstr)✅ 修复代码 (strcmp)
root@kitploit:~
// NativeVerifier.cpp — BUG!
bool quickHashCheck(const char* hash) {
    for (int i = 0; i < count; i++) {
        if (strstr(whitelist[i], hash))
            return true;  // 子串匹配 ⚠️
    }
    return false;
}
root@kitploit:~
// NativeVerifier.cpp — FIXED
bool quickHashCheck(const char* hash) {
    for (int i = 0; i < count; i++) {
        if (strcmp(whitelist[i], hash) == 0)
            return true;  // 完全匹配 ✅
    }
    return false;
}
🔴 8个字符足够 — 暴力破解: 2³²🟢 需要64个字符 — 暴力破解: 2²⁵⁶



🗂 仓库结构 / Repository Structure

root@kitploit:~
📦 CVE-2024-4309-Analysis
├── 📄 README.md                    # 本文件
├── 📄 ROADMAP.md                   # 项目路线图(5个阶段)
├── 🐳 Dockerfile                   # 容器配置
├── 🐳 docker-compose.yml           # 服务编排文件
├── 🔑 .env.example                 # 环境变量模板
├── 📄 .gitignore                   # Git排除规则
├── 📄 requirements.txt             # 依赖列表(零依赖)
│
├── 📁 docs/
│   ├── 📁 presentations/           # 🎨 演示文件(HTML幻灯片, 信息图)
│   ├── 📁 research/                # 🔬 研究笔记与深入分析
│   └── 📁 references/              # 📚 参考文献与引用
│
└── 📁 src/
    ├── 🖥️  app.py                   # C2 Web仪表盘(高级UI)
    ├── ⚔️  attack.py                # OTA MITM攻击模拟器
    ├── 🔍 detector.py               # 多层次攻击检测引擎
    ├── 🔧 fix_demo.py               # strstr() vs strcmp()演示
    ├── 📄 report_generator.py       # 生成PDF就绪的HTML报告
    └── 🧪 test_suite.py             # 27个自动化单元测试



🚀 安装 / Getting Started

前置条件

  • Python 3.12+(无外部依赖 — 仅使用标准库)
  • Docker (可选)

📥 克隆

root@kitploit:~
git clone https://github.com/Winslowe/CVE-2024-4309-Analysis.git
cd CVE-2024-4309-Analysis
cp .env.example .env

🐳 使用Docker运行

root@kitploit:~
docker-compose up -d

Dashboard → http://127.0.0.1:5000

🐍 不使用Docker运行

root@kitploit:~
# 终端1 — C2 Dashboard
python src/app.py

# 终端2 — 攻击服务器
python src/attack.py

# 终端3 — 检测引擎
python src/detector.py

🧪 运行测试

root@kitploit:~
python src/test_suite.py
# 或
python -m pytest src/test_suite.py -v



📊 交付物 / Deliverables

交付文件状态
漏洞研究与日志docs/research/✅
PoC脚本src/ (6个文件)✅
可视化分析(信息图)docs/presentations/✅
C2 Web仪表盘src/app.py✅
自动化测试套件src/test_suite.py (27个测试)✅
PDF就绪报告report_generator.py✅
Docker支持Dockerfile + docker-compose.yml✅



📚 文档 / Documentation

文档描述
docs/research/🔬 深入分析与研究笔记
docs/presentations/🎨 HTML演示与信息图文件
docs/references/sources.md📚 完整参考文献列表
ROADMAP.md🗺️ 5阶段项目路线图



🔗 参考资料 / References

来源链接
Xiaomi Security Bulletintrust.mi.com/misrc/bulletins/advisory
QDebugger Researchota-security.q-debugger.com
CWE-347cwe.mitre.org/data/definitions/347
Android RecoverySystem APIdeveloper.android.com
Xiaomi OTA Researchgithub.com/nicene-0



🎓 学术信息 / Academic Information

👨‍🏫 导师 / Instructor

姓名Keyvan Arasteh

👤 学生 / Student

姓名SamuroDev
学号``

📚 课程 / Course

课程渗透测试 / Penetration Testing
代码BGT006 · 3 ECTS
学期2025-2026春季
大学İstinye Üniversitesi



使用 🐍 Python 构建 · 零依赖 · 为 BGT-Pentest-LAB 期末项目制作
© 2026 — 仅限教育和研究用途。

下载工具