janderik/forensis
GitHub: janderik/forensis
Forensis 是一款用 Python 编写的数字取证工具包,提供内存分析、磁盘取证、文件雕刻、时间线分析和报告生成等一站式 DFIR 调查能力。
Stars: 0 | Forks: 0
# Forensis 🔍
[](https://www.python.org/downloads/)
[](LICENSE)
[](https://github.com/forensis/forensis/actions/workflows/ci.yml)
[](https://github.com/psf/black)
[](https://pycqa.github.io/isort/)
一款专家级数字取证工具包,用于内存分析、磁盘取证、时间线重建、哈希计算和报告生成——所有操作均针对取证镜像进行,并提供只读保证。
## 功能
- **内存分析** — 列出 Windows 内存转储(raw、crash、hibernation)中的进程、网络连接和已加载模块。
- **磁盘取证** — 创建取证磁盘镜像(dd 风格),通过基于签名的雕刻(carving)恢复文件(JPEG, PNG, PDF, DOCX, ZIP, ELF),并浏览文件系统结构。
- **时间线分析** — 根据文件系统元数据和事件日志构建超级时间线;使用统计和时间聚类检测异常。
- **哈希** — 计算证据文件的 SHA-256, SHA-1 和 MD5 哈希值;以标准哈希集格式(NSRL, CSV)导出。
- **报告** — 生成包含完整调查结果、案件元数据和证据详情的 HTML 和 JSON 取证报告。
- **CLI** — 统一的命令行界面,提供直观的子命令(`forensis memory`, `forensis disk`, `forensis timeline`, `forensis hash`, `forensis report`)。
## 架构
```
forensis/
├── src/
│ ├── cli.py # CLI entry point (click/argparse)
│ ├── memory/
│ │ ├── analyzer.py # Process/module enumeration from dumps
│ │ ├── processes.py # Process struct parsing (EPROCESS)
│ │ └── network.py # Network connection enumeration
│ ├── disk/
│ │ ├── imager.py # dd-style disk imaging
│ │ ├── carver.py # Signature-based file carving
│ │ └── filesystem.py # Filesystem navigation (FAT/NTFS/ext4)
│ ├── timeline/
│ │ ├── builder.py # Timeline construction from metadata
│ │ └── analyzer.py # Anomaly detection
│ ├── hashing/
│ │ └── hasher.py # Multi-algorithm hashing
│ └── reporting/
│ └── report.py # HTML/JSON report generation
└── tests/ # pytest-based test suite
```
所有操作对源证据均为**只读**。镜像获取过程在不修改源的情况下采集数据;雕刻(carving)和分析仅从获取的镜像中读取。
## 安装
### 从源码安装
```
git clone https://github.com/forensis/forensis.git
cd forensis
pip install -r requirements.txt
pip install -e .
```
### 使用 Docker
```
docker build -t forensis .
docker run --rm -v /path/to/evidence:/data forensis disk image /data/source.dd /data/output.img
```
## 用法
### 内存分析
```
# 列出 memory dump 中的进程
forensis memory processes memdump.raw
# 列出网络连接
forensis memory network memdump.raw
# 完整内存分析
forensis memory analyze memdump.raw
```
### 磁盘取证
```
# 创建取证镜像 (dd 风格)
forensis disk image /dev/sda case/images/device.dd --log case/logs/acquisition.log
# 从镜像中 Carve 文件
forensis disk carve evidence.dd --output carved/ --types jpeg,png,pdf
# 列出文件系统内容
forensis disk ls image.dd --path /home/user
```
### 时间线分析
```
# 从 disk image 构建时间线
forensis timeline build image.dd --output timeline.csv
# 分析异常
forensis timeline analyze timeline.csv --output anomalies.json
```
### 哈希
```
# 使用所有算法对证据文件进行 Hash
forensis hash evidence.dd --sha256 --sha1 --md5 --output hashes.txt
```
### 报告
```
# 生成综合取证报告
forensis report generate --case "CASE-001" --case-id "2024-001" \
--findings findings.json --evidence evidence.dd \
--hash sha256:abc123... --output report.html --format html
```
## 开发
```
# 安装 dev dependencies
pip install -r requirements-dev.txt
# 运行测试
pytest tests/ -v --cov=src
# 格式化代码
black src/ tests/
isort src/ tests/
```
## 许可证
MIT License — 见 [LICENSE](LICENSE)。
标签:JARM, Python, 内存分析, 安全规则引擎, 数字取证, 文件雕刻, 无后门, 磁盘取证, 自动化脚本, 请求拦截, 逆向工具