Shivammyadav/Malware-Analysis-Sandbox
GitHub: Shivammyadav/Malware-Analysis-Sandbox
一个开源的模块化恶意软件分析沙箱,在隔离环境中对可疑文件执行静态、动态和网络分析并生成详细报告。
Stars: 0 | Forks: 0
# 🦠 恶意软件分析沙箱
一个使用 Python 构建的模块化、开源恶意软件分析沙箱。对可疑文件执行**静态**、**动态**和**网络**分析——并生成详细的 HTML/JSON 报告。
## 📸 功能
| 类别 | 功能 |
|---|---|
| **静态分析** | PE 头解析、熵值计算、字符串提取、YARA 扫描、哈希计算 (MD5/SHA1/SHA256) |
| **动态分析** | 进程监控、文件系统更改检测、注册表监控 (Windows) |
| **网络分析** | DNS 查询捕获、HTTP/S 流量记录、IP 信誉查询 |
| **报告** | 包含时间线、IOC 和严重性评分的 JSON + HTML 报告 |
| **CLI 界面** | 带有丰富输出的简单命令行工具 |
| **Docker 支持** | 预构建的隔离容器环境 |
## 🗂️ 项目结构
```
malware-analysis-sandbox/
├── sandbox/
│ ├── core/ # Orchestration engine
│ ├── static/ # Static analysis modules
│ ├── dynamic/ # Dynamic analysis modules
│ ├── network/ # Network capture & analysis
│ └── reports/ # Report generation & templates
├── cli/ # Command-line interface
├── config/ # Configuration files
├── tests/ # Unit & integration tests
├── scripts/ # Helper & setup scripts
├── docs/ # Documentation
├── Dockerfile
├── docker-compose.yml
└── requirements.txt
```
## 🚀 快速开始
### 选项 1:Docker(推荐)
```
git clone https://github.com/Shivammyadav/malware-analysis-sandbox.git
cd malware-analysis-sandbox
docker-compose up --build
docker exec -it malware-sandbox python -m cli.main analyze /samples/suspicious.exe
```
### 选项 2:本地(Python 3.9+)
```
git clone https://github.com/Shivammyadav/malware-analysis-sandbox.git
cd malware-analysis-sandbox
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python scripts/download_yara_rules.py
python -m cli.main analyze /path/to/sample.exe
```
## 🔧 用法
```
# 完整分析
python -m cli.main analyze malware.exe
# 仅静态分析
python -m cli.main analyze malware.exe --mode static
# 使用自定义超时
python -m cli.main analyze malware.exe --timeout 120
# 保存报告
python -m cli.main analyze malware.exe --output ./reports/
# JSON 输出
python -m cli.main analyze malware.exe --format json
# Hash 查找
python -m cli.main hash malware.exe
# YARA 扫描
python -m cli.main yara malware.exe --rules ./config/rules/
```
## ⚙️ 配置
编辑 `config/config.yaml`:
```
analysis:
timeout: 60
max_file_size: 50MB
sandbox_mode: full
yara:
rules_path: ./config/rules/
community_rules: true
network:
capture_interface: eth0
dns_log: true
http_log: true
reporting:
format: html
output_dir: ./reports/
```
## 🧪 运行测试
```
pytest tests/ -v
pytest tests/ --cov=sandbox --cov-report=html
```
## 🤝 贡献
1. Fork 该仓库
2. 创建一个功能分支:`git checkout -b feature/new-analyzer`
3. 提交您的更改
4. 发起一个 Pull Request
## 📄 许可证
MIT 许可证 — 详见 [LICENSE](LICENSE)。
标签:DAST, Docker, Python, 云安全监控, 动态沙箱, 合规性检查, 安全防御评估, 恶意软件分析, 无后门, 请求拦截, 逆向工具, 静态分析