saivineethsannithi/Malware-Analysis-Sandbox
GitHub: saivineethsannithi/Malware-Analysis-Sandbox
一套基于 VirtualBox 构建的个人恶意软件分析沙箱,提供从环境搭建、静态动态分析到 IOC 提取与报告生成的完整方法论和实战记录。
Stars: 0 | Forks: 0
# 🔬 恶意软件分析沙箱




## 📋 目录
- [概述](#-overview)
- [项目目标](#-project-goals)
- [实验室架构](#-lab-architecture)
- [使用工具](#-tools-used)
- [设置指南](#-setup-guide)
- [分析工作流](#-analysis-workflow)
- [样本调查报告](#-sample-investigation-report)
- [主要发现](#-key-findings)
- [妥协指标 (IOCs)](#-indicators-of-compromise-iocs)
- [项目结构](#-project-structure)
- [局限性](#-limitations)
- [下一步计划](#-next-steps)
- [资源](#-resources)
- [免责声明](#%EF%B8%8F-disclaimer)
## 🎯 概述
本项目记录了基于 VirtualBox 构建的**个人恶意软件分析沙箱**的设计、搭建和操作过程。该实验室用于安全地获取、剖析和表征从 MalwareBazaar 等公共威胁情报库中获取的真实恶意软件样本。
调查过程结合了:
- **静态分析** —— 在不执行二进制文件的情况下进行检查
- **动态分析** —— 在封闭的 VM 中观察运行时行为
- **IOC 提取** —— 为防御者构建可操作的情报
每个样本都被限制在仅主机网络中,因此没有任何恶意软件流量可以逃逸到互联网或主机。
## 🎯 项目目标
- 使用 VirtualBox + Windows 10 构建隔离沙箱
- 从可信的研究来源安全地获取恶意软件样本
- 执行静态分析(PE 结构、导入表、字符串、哈希)
- 执行动态分析(进程、注册表、文件和网络监控)
- 生成嵌入证据的专业调查报告
- 提取 IOC 并将行为映射到 MITRE ATT&CK 技术
## 🏗 实验室架构
```
┌──────────────────────────────────────────────────────────┐
│ HOST MACHINE │
│ (Never touches malware directly) │
│ │
│ ┌──────────────────────────────────────────────┐ │
│ │ VirtualBox Hypervisor │ │
│ │ │ │
│ │ ┌─────────────────────────────────────────┐ │ │
│ │ │ Windows 10 Victim VM │ │ │
│ │ │ (SOC-Lab-Win10-Victim) │ │ │
│ │ │ │ │ │
│ │ │ ▸ Windows Defender: DISABLED │ │ │
│ │ │ ▸ Windows Update: DISABLED │ │ │
│ │ │ ▸ Shared Clipboard: DISABLED │ │ │
│ │ │ ▸ Shared Folders: DISABLED │ │ │
│ │ │ ▸ Network: HOST-ONLY │ │ │
│ │ │ ▸ Snapshots: Clean Baseline ✓ │ │ │
│ │ │ │ │ │
│ │ │ Tools: PEStudio, ProcMon, Wireshark, │ │ │
│ │ │ Regshot, HxD, DIE, 7-Zip │ │ │
│ │ └─────────────────────────────────────────┘ │ │
│ └──────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────────┘
```
### 网络隔离
| 模式 | 用例 |
|------|----------|
| **Host-only Adapter** | 默认安全状态 —— VM 无法访问互联网或主机 |
| **NAT (Temporary)** | 仅在下载样本或工具时短暂启用 |
| **Not Attached** | 在需要最高隔离度的高风险引爆期间使用 |
## 🧰 使用工具
### 静态分析
| 工具 | 用途 |
|------|---------|
| **PEStudio** | 初始 PE 评估、导入表、指标分析 |
| **HxD** | 原始十六进制/字节级检查 |
| **Detect It Easy (DIE)** | 编译器/加壳识别 |
| **PowerShell `Get-FileHash`** | SHA-256 哈希计算 |
### 动态分析
| 工具 | 用途 |
|------|---------|
| **Process Monitor (Procmon)** | 文件、注册表和进程活动捕获 |
| **Wireshark** | 网络数据包捕获与分析 |
| **Regshot** | 前后注册表差异快照 |
| **Process Hacker / Process Explorer** | 实时进程树检查 |
### 样本来源
- [MalwareBazaar (abuse.ch)](https://bazaar.abuse.ch) —— 主要来源
- [theZoo](https://github.com/ytisf/theZoo) —— 记录完善的旧样本
- [VirusShare](https://virusshare.com) —— 大型存档(需注册)
- [Hybrid Analysis](https://www.hybrid-analysis.com) —— 预筛选报告
## ⚙️ 设置指南
### 1. 安装 VirtualBox 并创建目标 VM
```
# 下载 VirtualBox: https://www.virtualbox.org/wiki/Downloads
# 创建新 VM:
# - 名称:SOC-Lab-Win10-Victim
# - 操作系统:Windows 10 (64-bit)
# - 内存:4 GB
# - 硬盘:60 GB (dynamically allocated)
```
### 2. 配置 VM 设置
| 设置 | 值 |
|---------|-------|
| Network Adapter | Host-only Adapter |
| Shared Clipboard | Disabled |
| Drag-and-Drop | Disabled |
| Shared Folders | None |
| USB Controller | Disabled |
| Audio | Disabled |
### 3. 强化 VM 内的 Windows
- 禁用 **Windows Defender**(实时保护、云保护和篡改保护)
- 禁用 **SmartScreen**
- 通过 `services.msc` 禁用 **Windows Update** 服务
- 添加虚假用户数据(文档、浏览器历史记录、常见应用程序)
### 4. 安装分析工具
**仅在 VM 内部**下载所有工具(临时将网络切换为 NAT):
```
C:\Tools\
├── ProcMon\ → Process Monitor (Sysinternals)
├── Regshot\ → Registry diff tool
├── PEStudio\ → PE static analysis
├── DIE\ → Detect It Easy
└── HxD\ → Hex editor
```
Wireshark 和 7-Zip 通过其各自的安装程序安装到 `C:\Program Files\`。
### 5. 拍摄干净的基线快照
```
VirtualBox Manager → Snapshots → Take
Name: "Clean Baseline with Tools"
```
这是神圣的重置点。每次分析后都要还原到此处。
## 🔄 分析工作流
```
┌─────────────────┐
│ 1. Snapshot VM │ Take "Pre-Analysis" snapshot
└────────┬────────┘
▼
┌─────────────────┐
│ 2. Acquire │ Download password-protected ZIP from MalwareBazaar
│ Sample │ (password: "infected")
└────────┬────────┘
▼
┌─────────────────┐
│ 3. Static │ Hash → PEStudio → HxD → DIE
│ Analysis │ Document imports, strings, indicators
└────────┬────────┘
▼
┌─────────────────┐
│ 4. Setup │ Start ProcMon, Wireshark, Regshot (1st shot)
│ Monitoring │ Process Hacker for live view
└────────┬────────┘
▼
┌─────────────────┐
│ 5. Detonate │ Execute the sample, observe 10–15 minutes
└────────┬────────┘
▼
┌─────────────────┐
│ 6. Collect │ Save .pml, .pcapng, regshot diff, screenshots
│ Evidence │
└────────┬────────┘
▼
┌─────────────────┐
│ 7. Analyze │ Extract IOCs, map to MITRE ATT&CK
│ & Report │ Write investigation report
└────────┬────────┘
▼
┌─────────────────┐
│ 8. Restore │ Revert VM to "Clean Baseline" snapshot
└─────────────────┘
```
## 📊 样本调查报告
已为该项目中分析的样本生成了完整的调查报告。报告内容包括:
- 执行摘要
- 实验室环境文档
- 哈希计算证据
- PEStudio 静态分析发现
- 工具设置截图
- IOC 表
- MITRE ATT&CK 映射(计划中)
- 证据索引
📄 **详见:** [`reports/Malware_Analysis_Investigation_Report.docx`](./reports/)
## 🔍 主要发现
### 样本标识
| 字段 | 值 |
|-------|-------|
| **文件名** | `sample.exe.malware.exe` |
| **文件大小** | 4,913,080 字节 (~4.9 MB) |
| **文件类型** | 可执行文件, 32位, GUI |
| **编译器** | Microsoft Visual Studio 2013 (Linker 14.0) |
| **编译时间** | Thu Apr 23 13:04:42 UTC 2026 |
| **熵值** | 6.806 (中等) |
| **入口点** | 0x001EA78B (节 `.text`) |
### 关键静态发现 —— 泄露的 PDB 路径
该二进制文件包含一个泄露的开发 PDB 路径:
```
F:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\WinProcessListHelper\Release\ThunderSuspensionWindo...
```
**含义:**
- `WinProcessListHelper` → 暗示具有**进程枚举**能力
- `ThunderSuspensionWindo...` → 可能指的是 **Thunder/Xunlei** 下载管理器(中文软件),暗示了针对目标或伪装
### 可疑指标
- ⚠️ **118 个导入函数**被 PEStudio 标记为可疑
- ⚠️ **2 个库**被标记
- ⚠️ **资源签名未知** —— 可能存在隐藏的 payload
- ⚠️ **证书问题** —— 没有有效的数字签名
## 🚨 妥协指标 (IOCs)
| 类型 | 指标 |
|------|-----------|
| SHA-256 | `298FED5A7E12C093D51C3DD055257BF0B0E1C46BE2939908BC428C4A0E38C411` |
| 文件名 | `sample.exe.malware.exe` |
| 文件大小 | 4,913,080 字节 |
| PDB 路径 | `F:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\WinProcessListHelper\Release\...` |
| 编译器 | Visual Studio 2013 (MSVC 14.0) |
## 📁 项目结构
```
malware-analysis-sandbox/
│
├── README.md ← This file
├── docs/
│ ├── setup-guide.md ← Detailed VM setup walkthrough
│ ├── analysis-workflow.md ← Step-by-step analysis methodology
│ └── tool-reference.md ← Tool cheat sheets
│
├── reports/
│ └── Malware_Analysis_Investigation_Report.docx
│
├── screenshots/
│ ├── 01-vm-hardening/
│ ├── 02-sample-acquisition/
│ ├── 03-static-analysis/
│ └── 04-dynamic-analysis/
│
├── iocs/
│ └── sample-001-iocs.csv ← Extracted IOCs in CSV format
│
└── scripts/ ← (Optional) Automation helpers
└── hash-calculator.ps1
```
## ⚠️ 局限性
- 该沙箱使用 **host-only 网络**,因此命令与控制 (C2) 流量无法到达真实服务器。在未来的阶段中添加 **REMnux** 或 **INetSim** VM 将模拟互联网服务并允许更完整的行为观察。
- 某些恶意软件具有**沙箱感知能力**(通过进程、注册表项、低内存、无鼠标移动来检测 VirtualBox)并拒绝执行。
- 手动工作流非常耗时。计划通过 **Cuckoo Sandbox** 或 **CAPE Sandbox** 进行自动化增强。
- 需要特定操作系统版本、特权或参数的样本可能无法按预期被引爆。
## 🚀 下一步计划
- [ ] 添加 **REMnux VM** 用于伪造互联网模拟
- [ ] 集成 **Cuckoo Sandbox** 进行自动化引爆
- [ ] 构建一个 **Python 报告脚本** 以从日志中自动生成报告
- [ ] 基于提取的 IOC 创建 **YARA 规则**
- [ ] 为所有报告添加 **MITRE ATT&CK** 技术映射
- [ ] 建立 **ELK stack** 进行集中式日志分析
- [ ] 使用 Volatility 添加**内存分析**
## 📚 资源
### 官方文档
- [VirtualBox 用户手册](https://www.virtualbox.org/manual/)
- [Sysinternals Suite](https://learn.microsoft.com/en-us/sysinternals/)
- [Wireshark 用户指南](https://www.wireshark.org/docs/)
- [MITRE ATT&CK 框架](https://attack.mitre.org/)
### 威胁情报
- [MalwareBazaar](https://bazaar.abuse.ch/)
- [VirusTotal](https://www.virustotal.com/)
- [ANY.RUN](https://any.run/)
- [Hybrid Analysis](https://www.hybrid-analysis.com/)
### 学习资源
- [Practical Malware Analysis (书籍)](https://nostarch.com/malware) —— Sikorski & Honig
- [SANS FOR610](https://www.sans.org/cyber-security-courses/reverse-engineering-malware-malware-analysis-tools-techniques/)
- [REMnux 文档](https://docs.remnux.org/)
- [FLARE-VM](https://github.com/mandiant/flare-vm)
## ⚠️ 免责声明
使用本指南或复现此实验室,即表示您同意对您的行为承担全部责任,并确保所有活动均符合道德和法律规定。
## 👤 作者
**[Saivineeth sannithi]**
- 📧 [电子邮件](vineethsannithi1998@gmail.com)
## 📜 许可证
本项目仅限**教育用途**发布。详情请参见 [LICENSE](./LICENSE)。
## ⭐ 致谢
- [abuse.ch](https://abuse.ch/) 维护 MalwareBazaar
- [Mandiant](https://github.com/mandiant) 提供 FLARE-VM
- [Lenny Zeltser](https://zeltser.com/) 提供 REMnux
- Microsoft 的 Sysinternals 团队
- 开源恶意软件分析社区
Built with ☕ and a lot of snapshots.
标签:AI合规, ATT&CK映射, Cloudflare, DAST, IOC提取, MalwareBazaar, MITRE ATT&CK, PE结构分析, VirtualBox, Windows 10, 云安全监控, 云资产清单, 哈希校验, 失陷标示, 威胁情报, 安全实验, 安全实验室, 安全教育, 安全沙箱, 安全研究报告, 开发者工具, 恶意软件分析, 搜索语句(dork), 数据展示, 文件系统监控, 无线安全, 样本分析, 沙箱, 注册表监控, 漏洞分析, 生成式AI安全, 红队, 网络信息收集, 网络安全, 网络安全审计, 虚拟机, 行为监控, 路径探测, 逆向工程, 速率限制处理, 隐私保护, 静态分析