hhalsancak70/malware-analysis-sandbox-lab
GitHub: hhalsancak70/malware-analysis-sandbox-lab
一套完全隔离的教学型恶意软件分析沙箱环境,覆盖静态分析、动态监控、网络捕获、IOC 提取、SIEM 集成和自动化报告生成的完整分析工作流。
Stars: 0 | Forks: 0
# 🔬 恶意软件分析沙箱实验室








**一个隔离、安全的恶意软件分析实验室环境,用于静态分析、IOC 提取、
检测工程和结构化报告 —— 仅使用 EICAR 测试文件和良性样本构建。**
[📁 项目结构](#-project-structure) • [🛡️ 安全策略](#️-safety--ethical-boundaries) • [🚀 快速开始](#-quick-start) • [📋 路线图](#-roadmap)
## 📌 项目概述
**恶意软件分析沙箱实验室** 是一个结构化、可写入简历的网络安全项目,展示了
恶意软件分析师的完整工作流程:从接收可疑样本到交付
专业的事件报告。
### 本项目展示了什么
| 技能领域 | 工具与技术 |
|---|---|
| 🔍 **静态分析** | 哈希计算、字符串提取、PE头分析、YARA 扫描 |
| 📊 **动态分析** | Sysmon 遥测、Procmon 监控、Regshot 注册表差异比对 |
| 🌐 **网络监控** | tcpdump、Wireshark、FakeNet-NG / INetSim 模拟 |
| 🎯 **IOC 提取** | 基于正则表达式的 IP、域名、URL、哈希、邮箱提取 |
| 📡 **SIEM 集成** | Wazuh 日志收集、仪表板和告警 |
| 🛡️ **检测工程** | YARA 规则、Sigma 规则 |
| 📝 **报告** | 自动化 Markdown 报告生成 |
## 🏗️ 实验室架构
```
┌─────────────────────────────────────────────────────────┐
│ macOS Host Machine │
│ (UTM Hypervisor + Docker) │
│ │
│ ┌──────────────────┐ ┌──────────────────────────┐ │
│ │ Wazuh SIEM │ │ Host-Only Network │ │
│ │ (Docker) │◄───│ 192.168.100.0/24 │ │
│ │ Port: 1514 │ │ (No internet access) │ │
│ └──────────────────┘ └──────────┬───────────────┘ │
└─────────────────────────────────────┼───────────────────┘
│
┌───────────────────────┤
│ │
┌────────────▼──────────┐ ┌────────▼────────────────┐
│ Windows Analysis VM │ │ REMnux / Ubuntu VM │
│ (UTM) │ │ (UTM) │
│ │ │ │
│ • Sysmon │ │ • FakeNet-NG / INetSim │
│ • Procmon │ │ • Wireshark / tcpdump │
│ • Process Explorer │ │ • YARA │
│ • Autoruns │ │ • strings / exiftool │
│ • Regshot │ │ • python3 scripts │
│ • Wireshark │ │ • jq │
│ • Wazuh Agent │ │ • Wazuh Agent │
└───────────────────────┘ └─────────────────────────┘
```
### 关键隔离规则
- ✅ Host-Only 网络(虚拟机无法访问互联网)
- ✅ 共享剪贴板:**已禁用**
- ✅ 拖放功能:**已禁用**
- ✅ 共享文件夹:**已禁用**
- ✅ 在每次分析会话前拍摄 VM 快照
- ✅ 在每次分析会话后恢复快照
## 📁 项目结构
```
malware-analysis-sandbox-lab/
│
├── README.md # This file — project overview
│
├── docs/ # All documentation
│ ├── project-scope.md # FAZ 0: Project plan & scope
│ ├── safety-checklist.md # Pre/during/post analysis safety
│ ├── analysis-methodology.md # 7-phase DFIR methodology
│ ├── lab-architecture.md # Detailed architecture + ASCII diagrams
│ ├── setup-guide.md # UTM + 4 hypervisor setup guide
│ ├── troubleshooting.md # Common issues and fixes
│ ├── windows-tools-guide.md # FAZ 6: 9 Windows analysis tools
│ ├── linux-tools-guide.md # FAZ 7: 11 Linux/REMnux tools
│ ├── network-monitoring-guide.md # FAZ 8: FakeNet/INetSim/tcpdump
│ ├── wazuh-integration-guide.md # FAZ 9: Wazuh Docker + Agent setup
│ └── cv-and-github-guide.md # FAZ 11: CV bullets & interview prep
│
├── scripts/ # Python automation scripts
│ ├── hash_file.py # Compute MD5/SHA1/SHA256
│ ├── static_analyzer.py # Full static analysis pipeline
│ ├── ioc_extractor.py # Extract IOCs from text/logs
│ ├── create_case_folder.py # Auto-create case directory structure
│ └── report_generator.py # Generate Markdown reports from JSON
│
├── configs/ # Tool configuration notes
│ ├── sysmon-notes.md # Sysmon config and event ID reference
│ ├── wazuh-notes.md # Wazuh setup and integration notes
│ └── network-notes.md # Network isolation configuration notes
│
├── yara/ # YARA detection rules
│ └── example_safe_rules.yar # Safe demo rules (EICAR, benign patterns)
│
├── sigma/ # Sigma detection rules
│ └── suspicious_process_example.yml # Example defensive Sigma rule
│
├── reports/ # Analysis reports
│ └── sample-analysis-report.md # Demo report from FAZ 10 walkthrough
│
├── cases/ # Individual analysis cases (auto-generated)
│ └── CASE-YYYYMMDD-HHMM/ # Created by create_case_folder.py
│ ├── sample/ # Test file (safe only)
│ ├── static/ # Static analysis output (JSON, MD)
│ ├── dynamic/ # Sysmon/Procmon logs
│ ├── network/ # PCAP files and notes
│ ├── memory/ # Memory dump notes (future)
│ ├── iocs/ # Extracted IOC files (JSON, CSV)
│ ├── screenshots/ # Evidence screenshots
│ └── report.md # Per-case final report
│
├── pcaps/ # Network captures (sanitized, lab-only)
│ └── README.md
│
├── samples/ # Safe test samples only
│ └── README.md # Safety policy and naming convention
│
└── screenshots/ # Lab setup and analysis screenshots
└── README.md
```
## 🛡️ 安全与道德边界
| 规则 | 详情 |
|---|---|
| 🚫 无真实恶意软件 | 本仓库中没有任何真实的恶意软件 |
| 🚫 无攻击性代码 | 没有键盘记录器、后门或漏洞利用代码 |
| 🚫 无真实目标 | 未针对真实的系统、人员或组织 |
| 🚫 无规避技术 | 不演示 AV/EDR 绕过 |
| ✅ 仅限 EICAR 测试文件 | 安全、标准化的杀毒软件测试字符串 |
| ✅ 隔离的 VM 环境 | 所有测试均在带有 Host-Only 网络的 UTM 虚拟机内进行 |
| ✅ 基于快照的分析 | 每次会话后将虚拟机恢复至纯净状态 |
| ✅ 仅专注于防御 | 检测、分析、日志记录和报告 |
## 🚀 快速开始
### 前置条件
```
# macOS: 安装 Homebrew(如果尚未安装)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# 安装 Python 3
brew install python3
# 安装 Python 依赖
pip3 install -r requirements.txt
```
### 对安全测试文件运行静态分析
```
# 克隆 repository
git clone https://github.com/YOUR_USERNAME/malware-analysis-sandbox-lab.git
cd malware-analysis-sandbox-lab
# 创建新的 case 文件夹
python3 scripts/create_case_folder.py
# 计算文件 hashes
python3 scripts/hash_file.py --file samples/eicar_test.txt
# 运行静态分析(仅安全文件)
python3 scripts/static_analyzer.py --file samples/eicar_test.txt --output json
# 从分析输出中提取 IOC
python3 scripts/ioc_extractor.py --input static/analysis_output.json
# 生成最终报告
python3 scripts/report_generator.py --input static/analysis_output.json --output reports/
```
## 🔬 分析工作流
```
[RECEIVE SAMPLE]
│
▼
[VERIFY SAFETY] ← Hash check, file type, known safe sample only
│
▼
[RESTORE SNAPSHOT] ← Clean VM baseline
│
▼
[STATIC ANALYSIS] ← hash_file.py → static_analyzer.py → ioc_extractor.py
│
▼
[DYNAMIC ANALYSIS] ← Sysmon + Procmon in Windows VM
│
▼
[NETWORK MONITORING] ← FakeNet / tcpdump in REMnux VM
│
▼
[LOG COLLECTION] ← Wazuh aggregates all events
│
▼
[IOC EXTRACTION] ← ioc_extractor.py on all outputs
│
▼
[REPORT GENERATION] ← report_generator.py → Markdown report
│
▼
[RESTORE SNAPSHOT] ← Return VM to clean baseline
```
## 🛠️ 使用的工具
### 宿主机
`Python 3` · `Docker` · `UTM` · `YARA` · `jq`
### Windows 分析虚拟机
`Sysmon` · `Procmon` · `Process Explorer` · `Autoruns` · `Regshot` · `Wireshark` · `FakeNet-NG` · `Wazuh Agent`
### Linux / REMnux 虚拟机
`strings` · `exiftool` · `file` · `tcpdump` · `Wireshark` · `YARA` · `INetSim` · `Wazuh Agent`
### SIEM
`Wazuh Manager` (Docker) · `Wazuh Dashboard` (基于 Kibana)
### 检测
`YARA` · `Sigma`
## 📊 示例输出
```
{
"file_name": "eicar_test.txt",
"sha256": "275a021bbfb6489e54d471899f7db9d1663fc695ec2fe2a2c4538aabf651fd0f",
"md5": "44d88612fea8a8f36de82e1278abb02f",
"sha1": "3395856ce81f2b7382dee72602f798b642f14140",
"file_size_bytes": 68,
"file_type": "ASCII text",
"strings": { "total": 1 },
"iocs": { "md5": 1, "sha1": 1, "sha256": 1 },
"yara_matches": ["EICAR_Test_File"],
"analysis_timestamp": "2026-04-29T22:00:00"
}
```
## 📋 路线图
- [x] FAZ 0 — 项目规划与范围界定
- [x] FAZ 1 — 实验室文件夹结构
- [x] FAZ 2 — 隔离设计文档
- [x] FAZ 3 — 完整文档套件
- [x] FAZ 4 — 静态分析 Python 脚本
- [x] FAZ 5 — YARA 和 Sigma 检测规则
- [x] FAZ 6 — Windows VM 工具设置指南
- [x] FAZ 7 — Linux/REMnux 工具文档
- [x] FAZ 8 — 网络监控计划
- [x] FAZ 9 — Wazuh SIEM 集成
- [x] FAZ 10 — 端到端样本分析演练
- [x] FAZ 11 — 简历和 GitHub 展示
- [x] FAZ 12 — 质量保证检查清单
## 📊 项目指标
| 指标 | 数值 |
|---|---|
| 文件总数 | 54 |
| 代码总行数 | ~9,200 |
| Python 脚本 | 5 (~2,000 行) |
| 文档 | ~7,200 行 |
| YARA 规则 | 6 |
| Sigma 规则 | 4 |
| Wazuh 自定义规则 | 5 |
| 分析阶段 | 7 |
| 演示案例 | 1 (EICAR) |
| 支持的虚拟机管理程序 | 4 |
## 📄 许可证
本项目基于 MIT 许可证授权。
引用的所有工具归其各自所有者所有。
仅为防御性安全教育及简历作品集目的而构建。
标签:DAST, DNS信息、DNS暴力破解, Docker Compose, IOC提取, PE头分析, Python, Sigma规则, Sysmon, URL发现, Wazuh, Wireshark, YARA规则, 云安全监控, 句柄查看, 威胁情报, 安全分析与报告, 安全实验室, 安全检测, 开发者工具, 恶意软件分析, 数字取证, 无后门, 无线安全, 沙箱环境, 目标导入, 网络安全, 网络安全审计, 网络安全教学, 网络安全项目, 自动化脚本, 请求拦截, 逆向工具, 隐私保护, 静态分析