DavidVavilov/MalwareBox
GitHub: DavidVavilov/MalwareBox
一个开源Windows恶意软件分析沙箱,结合静态与动态技术检查可疑可执行文件并生成综合报告。
Stars: 3 | Forks: 0
# 恶意软件分析沙箱
一款结合了静态与动态分析技术的Windows恶意软件分析沙箱,用于检查可疑可执行文件。你只需提供一个文件,它将启动进程、监控其行为并生成一份综合报告。
## 工作原理
```
MalwareBox.exe
│
├── Static Analysis (runs before launch)
│ ├── StringsScan — extracts & categorises strings (IPs, DLLs, URLs, misc)
│ ├── VirusTotal — checks the file against the VirusTotal API
│ └── YaraScan — matches against 8 YARA rule sets
│
├── Launches the target process
│
└── Dynamic Analysis (3 threads in parallel, ~10 s window)
├── ProcessScan — monitors child process creation / deletion via WMI
├── PacketScan — captures network packets on the process's open ports
└── RegistryScan — watches registry keys referenced by the binary
│
└── Logger — merges all scan output into one report
```
## 项目结构
```
MalwareBox/
├── logic/logic/ # Main integrated codebase (start here)
│ ├── main.cpp # Entry point — orchestrates all scans
│ ├── StaticScans.cpp/h # Strings, VirusTotal, YARA wrappers
│ ├── ProcessScan.cpp/h # WMI-based child-process monitor
│ ├── RegistryScan.cpp/h# Registry key watcher (WinAPI)
│ ├── PacketScan.py # Network packet sniffer (Scapy)
│ ├── Yara-check.py # YARA rule matcher
│ ├── Logger.cpp/h # Combines scan logs into final report
│ ├── Helper.cpp/h # Shared utilities (command execution, etc.)
│ └── ProcessInformation.cpp/h # Launches & tracks the target process
│
├── PacketScan/ # Standalone PacketScan prototype (legacy)
├── ProcessScan/ # Standalone ProcessScan prototype (legacy)
├── RegistryScan/ # Standalone RegistryScan prototype (legacy)
├── StringsScan/ # Standalone StringsScan prototype (legacy)
└── Yara-Rules/ # Standalone Yara prototype + rule index files
```
## 系统要求
### 仅限Windows系统
动态分析组件使用了Windows特有的API(WMI/COM、WinAPI 注册表)和工具。
### 依赖项
| 工具/库 | 用途 |
|---|---|
| [Sysinternals strings.exe](https://docs.microsoft.com/en-us/sysinternals/downloads/strings) | 静态字符串提取 |
| [Python 3](https://www.python.org/) + [Scapy](https://scapy.net/) | 网络数据包捕获 |
| [YARA](https://github.com/VirusTotal/yara) + `yara-python` | 基于规则的恶意软件匹配 |
| VirusTotal API密钥 | 云端反病毒查询 |
| Visual Studio (C++17) | 构建C++组件 |
### Python 包
```
pip install scapy yara-python
```
## 构建
在Visual Studio中打开 `logic/logic.sln` 并以Release模式构建。输出的二进制文件期望 `strings.exe`、`Yara-check.py` 和YARA规则索引文件位于同一目录。
## 使用方法
```
MalwareBox.exe
```
该工具将会:
1. 运行静态扫描并将结果保存到单独的日志文件中
2. 启动目标可执行文件
3. 并行运行三个动态扫描约10秒
4. 将所有日志合并成一份综合报告
### 输出文件
| 文件 | 内容 |
|---|---|
| `strings_log.txt` | 提取的字符串(IP、DLL、URL、杂项) |
| `virustotal_log.txt` | VirusTotal扫描结果 |
| `yara_log.txt` | 匹配的YARA规则 |
| `packet_log.txt` | 捕获的网络数据包 |
| `process_log.txt` | 生成的子进程 |
| `registry_log.txt` | 注册表键值更改事件 |
| `output.txt` | 包含上述所有内容的综合报告 |
## YARA 规则集
运行时以下规则索引文件必须存在:
| 文件 | 覆盖范围 |
|---|---|
| `capabilities_index.yar` | 通用恶意软件能力 |
| `crypto_index.yar` | 加密相关例程 |
| `email_index.yar` | 基于电子邮件的威胁 |
| `exploit_kits_index.yar` | 漏洞利用工具包特征 |
| `maldocs_index.yar` | 恶意文档 |
| `malware_index.yar` | 通用恶意软件家族 |
| `mobile_malware_index.yar` | 移动端恶意软件 |
| `packers_index.yar` | 加壳器和混淆器 |
## 免责声明
本工具**仅用于教育和研究目的**。务必在隔离环境(虚拟机或专用沙箱)中运行恶意软件样本。作者对任何滥用行为概不负责。
标签:Ask搜索, C++, Conpot, DAST, meg, Python, Scapy, VirusTotal, Windows安全, WMI, YARA, 二进制发布, 云安全监控, 云资产可视化, 信息安全, 合规性检查, 字符串扫描, 开源工具, 恶意软件分析, 数据擦除, 无后门, 沙箱, 注册表监控, 端点可见性, 网络安全, 逆向工具, 隐私保护, 静态分析