rushi0818/Forensiclens

GitHub: rushi0818/Forensiclens

ForensicLens 将内存分析、痕迹收集、时间轴重建和哈希校验等 DFIR 功能整合于单一 Web 界面,帮助分析师在学习与初始应急响应中高效完成数字取证调查。

Stars: 0 | Forks: 0

# 🔬 ForensicLens — 数字取证与事件响应工具包 ![Python](https://img.shields.io/badge/Python-3.14-blue?logo=python) ![Flask](https://img.shields.io/badge/Flask-3.x-black?logo=flask) ![Volatility](https://img.shields.io/badge/Volatility3-Memory_Analysis-purple) ![License](https://img.shields.io/badge/License-MIT-green) ![Status](https://img.shields.io/badge/Status-Active-brightgreen) ![Platform](https://img.shields.io/badge/Platform-Windows%20%7C%20Linux-lightgrey) ## 📌 什么是 ForensicLens? ForensicLens 是一款 DFIR 工具包,旨在帮助分析师在安全事件发生后进行调查。 虽然传统的威胁检测工具(如 ThreatLens)能够实时预防攻击,但 ForensicLens 主要致力于解决以下核心问题: 它被构建用于展示企业环境中事件响应(Incident Response)团队所使用的真实 DFIR 工作流。 ## ⚡ 模块 | 模块 | 描述 | 实际应用场景 | |--------|-------------|----------------| | 🧠 内存分析器 | 使用 Volatility3 进行 RAM 转储分析 | 查找隐藏在内存中的恶意软件 | | 🗂️ 痕迹收集器 | 实时系统取证 | 浏览器历史记录、进程、启动项 | | 📅 时间轴构建器 | 时序事件重建 | 还原攻击序列 | | 🔓 哈希校验器 | 证据完整性 + 证据监管链 | 合法取证证据记录 | ## 🆚 ForensicLens 与行业标准工具对比 这是最重要的部分 —— 了解 ForensicLens 在专业取证生态系统中的定位。 ### 工具直接对比 | 功能 | Autopsy | EnCase | FTK | Volatility3 | **ForensicLens** | |---------|---------|--------|-----|-------------|-----------------| | **价格** | 免费 | $3,000+/年 | $2,000+/年 | 免费 | **免费** | | **平台** | Win/Linux | Windows | Windows | 仅支持 CLI | **Web 浏览器** | | **内存分析** | ✅ 基础 | ✅ 深度 | ✅ 深度 | ✅ 专家级 | ⚠️ 基础 | | **磁盘取证** | ✅ 完整 | ✅ 完整 | ✅ 完整 | ❌ | ❌ | | **时间轴分析** | ✅ | ✅ | ✅ | ❌ | ✅ 基础 | | **证据监管链** | ✅ 认证 | ✅ 认证 | ✅ 认证 | ❌ | ✅ 基础 | | **法庭采证** | ⚠️ | ✅ | ✅ | ❌ | ❌ | | **学习曲线** | 高 | 极高 | 极高 | 专家级 | **低** | | **Web 界面** | ❌ | ❌ | ❌ | ❌ | **✅** | | **多合一 UI** | ❌ | ✅ | ✅ | ❌ | **✅** | | **自定义规则** | ⚠️ | ⚠️ | ⚠️ | ✅ | **✅** | | **API 集成** | ❌ | ❌ | ❌ | ❌ | **✅ VirusTotal** | | **开源** | ✅ | ❌ | ❌ | ✅ | **✅** | ### ForensicLens 的优势 ``` ┌─────────────────────────────────────────────────────┐ │ Professional Tools Problem: │ │ Analyst needs 4-5 separate tools open at once │ │ → Volatility (terminal) │ │ → Autopsy (GUI) │ │ → Hash calculator (separate) │ │ → Timeline (manual Excel) │ │ → Report (manual Word) │ │ │ │ ForensicLens Solution: │ │ Everything in ONE browser tab ✅ │ └─────────────────────────────────────────────────────┘ ``` ### 专业工具的优势 ``` ForensicLens is NOT a replacement for: → Court-certified forensic investigations → Deep disk forensics (file carving, deleted partition recovery) → Mobile device forensics → Enterprise-scale incident response → Chain of custody for legal proceedings ForensicLens IS a great tool for: → Learning DFIR concepts practically → Quick triage during initial IR → SOC portfolio demonstration → Teaching forensics workflows → Rapid artifact collection ``` ### 真正的核心价值 ``` Other tools exist. ForensicLens was built to UNDERSTAND them. Anyone can run Autopsy. Building a forensics platform from scratch proves you understand what Autopsy is actually doing under the hood. That understanding is what recruiters pay for. ``` ## 🏗️ 项目结构 ``` ForensicLens/ ├── app.py # Flask web application ├── requirements.txt # Python dependencies ├── README.md ├── forensics/ │ ├── __init__.py │ ├── memory_analyzer.py # Volatility3 integration │ ├── artifact_collector.py # Live system forensics │ ├── timeline_builder.py # Log parsing & timeline │ └── hash_verifier.py # MD5/SHA1/SHA256 + VT ├── templates/ │ └── index.html # ForensicLens UI ├── uploads/ # Evidence files (gitignored) └── reports/ # Generated reports (gitignored) ``` ## 🖥️ 截图 ### 内存分析 ![内存分析](https://raw.githubusercontent.com/rushi0818/Forensiclens/main/screenshots/memory_analysis.png) ### 痕迹收集 ![痕迹收集](https://raw.githubusercontent.com/rushi0818/Forensiclens/main/screenshots/artifact_collection.png) ### 时间轴构建器 ![时间轴](https://raw.githubusercontent.com/rushi0818/Forensiclens/main/screenshots/timeline.png) ### 哈希校验器与证据监管链 ![哈希校验器](https://raw.githubusercontent.com/rushi0818/Forensiclens/main/screenshots/hash_verifier.png) ## 🚀 如何运行 ### Windows(推荐) ``` # Clone repository git clone https://github.com/YOUR_USERNAME/forensiclens.git cd forensiclens # Install dependencies pip install -r requirements.txt # 运行 python app.py # 打开浏览器 # http://127.0.0.1:5002 ``` ### Linux / Kali ``` git clone https://github.com/YOUR_USERNAME/forensiclens.git cd forensiclens pip3 install -r requirements.txt python3 app.py ``` ## 📦 环境要求 ``` flask psutil requests volatility3 python-dotenv ``` 安装所有依赖: ``` pip install -r requirements.txt ``` ## 🧠 模块深入解析 ### 模块 1 — 内存分析器 使用 **Volatility3**(行业标准)来分析 RAM 转储。 **提取内容:** - 正在运行的进程及其 PID - 捕获时的网络连接 - 注入的代码(malfind 插件) - 可疑进程检测 **支持的 Volatility 插件:** ``` windows.pslist → Process list windows.netscan → Network connections windows.malfind → Code injection detection windows.cmdline → Process command lines ``` **真实 DFIR 工作流:** ``` Incident detected ↓ Take memory dump (WinPmem / LiME) ↓ Upload to ForensicLens ↓ Get instant analysis report ↓ Escalate findings ``` ### 模块 2 — 痕迹收集器 使用 **psutil** 和系统 API 收集实时系统痕迹。 **收集内容:** - 正在运行的进程(CPU、内存使用情况) - 活动的网络连接 - 启动/持久化项目 - 用户账户 - 最近访问的文件 **MITRE ATT&CK 覆盖范围:** ``` T1547 — Boot or Logon Autostart (startup items) T1078 — Valid Accounts (user accounts) T1057 — Process Discovery (processes) T1049 — System Network Connections (connections) ``` ### 模块 3 — 时间轴构建器 解析日志文件并重建按时间顺序排列的事件时间轴。 **支持的日志格式:** - Linux auth.log / syslog - Windows 事件日志导出文件 - Apache / Nginx 访问日志 - 任何自定义的文本日志文件 **事件检测:** ``` FAILED_LOGIN → Brute force attempts SUCCESS_LOGIN → Successful authentication SUDO_USAGE → Privilege escalation USER_CREATED → Persistence via new account DOWNLOAD → Malware download attempts EXECUTION → Command execution ``` ### 模块 4 — 哈希校验器与证据监管链 计算加密哈希值并生成正式的证据记录。 **哈希算法:** - MD5(32 字符)— 旧版兼容 - SHA1(40 字符)— 中等强度 - SHA256(64 字符)— 行业标准 **证据监管链记录包含:** ``` { "case_number" : "CASE-2026-001", "analyst" : "Analyst Name", "collected_at" : "2026-07-04 10:30:00", "evidence": { "filename" : "suspicious.exe", "md5" : "...", "sha1" : "...", "sha256" : "..." }, "vt_result" : { "malicious": 45, "total": 72 } } ``` ## 🔑 API 密钥(可选) 用于 VirusTotal 哈希检查: 1. 在 [virustotal.com](https://www.virustotal.com) 注册 2. 进入 Profile → API Key 3. 打开 `forensics/hash_verifier.py` 4. 替换 `YOUR_VIRUSTOTAL_API_KEY_HERE` ## 📚 展示技能 - ✅ 数字取证与事件响应 (DFIR) - ✅ 内存取证 (Volatility3) - ✅ 实时痕迹收集 - ✅ 日志分析与时间轴重建 - ✅ 证据完整性与证据监管链 - ✅ MITRE ATT&CK 框架映射 - ✅ Python 开发 (Flask, psutil) - ✅ VirusTotal API 集成 ## 🔗 相关项目 | 项目 | 描述 | 链接 | |---------|-------------|------| | 🔍 ThreatLens | 钓鱼与恶意软件检测平台 | [GitHub](#) | | 📊 Wazuh SOC | 企业级 SIEM 配置 | [GitHub](#) | ## ⚠️ 免责声明 ForensicLens 仅用于**教育和授权的取证调查目的**。在对任何系统执行 取证分析之前,请务必获得适当的法律授权。请勿在您不拥有或未获得明确许可 进行调查的系统上使用。 ## 📄 许可证 MIT 许可证 — 可免费使用、修改和分发,但需注明出处。 *作为 SOC Analyst 作品集的一部分构建 — 展示 DFIR 技能*
标签:Flask, JARM, Python, 内存分析, 库, 应急响应, 数字取证, 无后门, 流量嗅探, 自动化脚本, 逆向工具