itsraval/MHATOD
GitHub: itsraval/MHATOD
MHATOD 是一个通过并行查询 VirusTotal 和 MalwareBazaar 在线数据库并结合 AvClass 自动分类恶意软件家族的哈希分析工具,将多源元数据整合为结构化输出以支持下游安全分析。
Stars: 0 | Forks: 0
# MHATOD - 针对开源数据的恶意软件哈希分析工具
MHATOD 是一个 Python 工具,通过查询在线数据库([VirusTotal](https://www.virustotal.com/gui/search/) 和 [MalwareBazaar](https://bazaar.abuse.ch/))来收集和分类恶意软件元数据,并通过 [AVClass](https://github.com/malicialab/avclass/tree/master) 使用家族和标签分类丰富结果。结果将导出为结构化的 JSON 和 CSV 文件,以便进行下游分析。
本项目是在 [Edinburgh Napier University](https://www.napier.ac.uk/courses/msc-cyber-security-postgraduate-full-time) 攻读高级安全与数字鉴证理学硕士期间,作为学位论文 [**"现代演变勒索软件攻击数据窃取方法的行为分析"**](https://github.com/itsraval/MHATOD/blob/main/Docs/Behavioural_Analysis_of_Current_Evolution_Ransomware_Attack_Exfiltration_Methods.pdf) 的一部分开发的。
## 功能
- **VirusTotal 集成** - 获取文件类型、首次提交日期、威胁分类、YARA 结果以及各 AV 引擎的检测结果
- **MalwareBazaar 集成** - 获取文件类型、架构、签名、ClamAV 结果以及供应商情报(ANY.RUN、Intezer、Triage、ReversingLabs)
- **AvClass 标注** - 使用 AvClass 分类器从 VirusTotal 输出中提取恶意软件家族名称和威胁标签
- **并行查询** - 通过 `ThreadPoolExecutor` 并发运行 VirusTotal 和 MalwareBazaar 请求
- **威胁标签聚合** - 跨所有数据源的 token 级别标签提取和频率排名;可选的 top-5 过滤
- **结构化输出** - 每个哈希生成独立的 JSON 文件,加上每个模块的整合 JSON 和 CSV 文件,以及最终的组合数据集
- **可恢复扫描** - `--skip-lines` 允许您从上一次运行中断的地方继续
## 学术背景
MHATOD 是作为理学硕士论文 **"现代演变勒索软件攻击数据窃取方法的行为分析"** (Edinburgh Napier University,2024)的一部分开发的。该论文调查了基于数据窃取的勒索软件的分类和行为分析。这些恶意软件会在加密之前窃取数据,或者直接以窃取数据代替加密(双重勒索)。完整的论文可在 `Docs/` 目录中找到。
## 项目结构
```
MHATOD/
├── MHATOD.py # Entry point
├── .env # API keys (not committed)
├── pyproject.toml
├── README.md
├── requirements.txt
├── Docs/
│ └── Behavioural_Analysis_of_Current_Evolution_Ransomware_Attack_Exfiltration_Methods.pdf
├── scripts/
│ └── hash_gathering/
│ ├── HashesCleaner.html # Browser tool: extract & clean SHA256 hashes
│ └── README.md # Usage guide for hash gathering scripts
└── src/
├── cli.py # Argument parsing and .env loading
├── utils.py # Shared helpers (I/O, folder setup, tag extraction)
└── modules/
├── virustotal_client.py # VirusTotal API v3 client
├── malwarebazaar_client.py # MalwareBazaar API v1 client
├── avclass_labeler.py # AvClass subprocess wrapper
└── combine_modules.py # Merges outputs into a unified dataset
```
## 环境要求
- Python 3.8+
- **VirusTotal** API 密钥(支持免费版本) - [点击此处获取](https://www.virustotal.com/gui/join-us)
- **MalwareBazaar** API 密钥 - [点击此处获取](https://bazaar.abuse.ch/api/)
- 已安装 [AvClass](https://github.com/malicialab/avclass) 并可在 `PATH` 中使用
## 安装说明
```
git clone https://github.com/itsraval/MHATOD.git
cd MHATOD
pip install -r requirements.txt
pip install avclass2 # or follow AvClass installation instructions
```
## 配置
在项目根目录创建一个 `.env` 文件:
```
VIRUSTOTAL_API_KEY=your_virustotal_key_here
MALWAREBAZAAR_API_KEY=your_malwarebazaar_key_here
```
密钥也可以直接作为 CLI 标志传入,这将覆盖 `.env` 中的值。
## 使用方法
```
python MHATOD.py 标签:Ask搜索, AVClass, ClamAV, CSV, DAST, ESC4, JSON, MalwareBazaar, OSINT, Python, VirusTotal, Web 安全测试, YARA, 云资产可视化, 勒索软件分析, 哈希查询, 威胁情报, 家族分类, 并发查询, 开发者工具, 恶意软件分析, 数字取证, 数据丰富, 无后门, 沙箱, 网络安全, 自动化脚本, 逆向工具, 隐私保护