andreafortuna/autotimeliner
GitHub: andreafortuna/autotimeliner
基于 Volatility3 自动从内存镜像中提取并合并多维度取证时间线,输出统一排序的 CSV 文件。
Stars: 133 | Forks: 21
# AutoTimeliner
[](https://www.python.org/)
[](https://github.com/volatilityfoundation/volatility3)
[](LICENSE)
AutoTimeliner 针对 Windows、Linux 和 macOS 内存镜像运行多个 Volatility3 插件,然后将它们的输出合并为一个经过排序的 CSV 时间线:
### 通用时间线插件
| 插件 | 捕获内容 |
|---|---|
| `timeliner` | 跨插件时间戳事件(支持的所有操作系统系列) |
### Windows 插件集
| 插件 | 捕获内容 |
|---|---|
| `timeliner` | 来自进程、注册表、句柄等的时间戳 |
| `mftscan` | 内存中找到的 MFT 文件项 |
| `shellbags` | 来自注册表配置单元的用户文件夹访问历史记录 |
### Linux 插件集
| 插件 | 捕获内容 |
|---|---|
| `linux.pslist` | 进程启动/退出时间线上下文 |
| `linux.bash` | Shell 命令历史记录证据 |
| `linux.lsof` | 来自进程的打开文件证据 |
### macOS 插件集
| 插件 | 捕获内容 |
|---|---|
| `mac.pslist` | 进程启动/退出时间线上下文 |
| `mac.bash` | Shell 命令历史记录证据 |
| `mac.lsof` | 来自进程的打开文件证据 |
### Windows 进程与执行分析
| 插件 | 捕获内容 |
|---|---|
| `psscan` | 带有时间戳的活动、已终止和隐藏进程 |
| `cmdline` | 每个进程的命令行参数 |
| `userassist` | 来自 Windows 注册表的程序执行证据 |
### Windows 网络分析
| 插件 | 捕获内容 |
|---|---|
| `netscan` | 带有创建时间戳的网络连接 |
### Windows 恶意软件检测
| 插件 | 捕获内容 |
|---|---|
| `malfind` | 代码注入和可疑内存区域 |
| `svcscan` | Windows 服务(用于持久化检测) |
### 其他 Windows 插件(可选)
| 插件 | 捕获内容 |
|---|---|
| `dlllist` | 每个进程加载的 DLL |
| `filescan` | 获取时内存中打开的文件 |
| `handles` | 打开的句柄(文件、注册表项、互斥锁) |
| `envars` | 进程的环境变量 |
## 依赖项
| 依赖项 | 版本 | 备注 |
|---|---|---|
| Python | ≥ 3.9 | |
| [Volatility3](https://github.com/volatilityfoundation/volatility3) | ≥ 2.5 | 通过 Poetry/pip 自动安装 |
| [jsonschema](https://pypi.org/project/jsonschema/) | ≥ 4.0 | 启用 Volatility3 schema 验证并避免 `Dependency for validation unavailable: jsonschema` 警告 |
| [mactime](https://www.sleuthkit.org/) | 任意 | **可选** — 仅 `--use-mactime` 旧版模式需要 |
## 安装
### 使用 Poetry (推荐)
```
git clone https://github.com/andreafortuna/autotimeliner.git
cd autotimeliner
poetry install
```
### 使用 pip
```
pip install .
```
## 用法
```
autotimeliner -f IMAGEFILE [-t TIMEFRAME] [-o OUTPUT] [options]
```
### 选项
| 标志 | 描述 |
|---|---|
| `-f`, `--imagefile` | 内存转储文件或 glob 模式 (例如 `'*.raw'`) |
| `-t`, `--timeframe` | 过滤至 `YYYY-MM-DD..YYYY-MM-DD` 范围 |
| `-o`, `--output` | 输出 CSV 路径 (默认: `-timeline.csv`) |
| `--os-hint` | 强制指定镜像操作系统系列 (`windows`, `linux`, `mac`; 别名: `win`, `macos`, `darwin`) 并跳过自动识别 |
| `--skip-timeliner` | 跳过 timeliner 插件 |
| `--skip-mftscan` | 跳过 mftscan 插件 |
| `--skip-shellbags` | 跳过 shellbags 插件 |
| `--skip-psscan` | 跳过进程扫描 |
| `--skip-cmdline` | 跳过命令行提取 |
| `--skip-netscan` | 跳过网络连接扫描 |
| `--skip-userassist` | 跳过程序执行证据收集 |
| `--skip-svcscan` | 跳过 Windows 服务扫描 |
| `--skip-malfind` | 跳过恶意软件/注入检测 |
| `--with-dlllist` | 启用 DLL 分析 (较慢) |
| `--with-filescan` | 启用打开文件扫描 (记录较多) |
| `--with-handles` | 启用句柄扫描 (记录较多) |
| `--with-envars` | 启用环境变量提取 |
| `--use-mactime` | 旧版模式:使用外部 `mactime` 二进制文件 |
| `-v`, `--verbose` | 启用 debug 日志记录 |
| `--version` | 打印版本并退出 |
### 示例
从单个镜像中提取完整时间线:
```
autotimeliner -f TargetServer.raw
```
过滤至特定时间窗口:
```
autotimeliner -f TargetServer.raw -t 2023-10-17..2023-10-21
```
处理目录中的所有 `.raw` 文件并指定输出路径:
```
autotimeliner -f './*.raw' -o /evidence/timeline.csv
```
在您已知转储文件的操作系统时加快启动速度:
```
autotimeliner -f TargetServer.raw --os-hint windows
```
为方便起见使用 macOS 别名值:
```
autotimeliner -f MacbookCapture.mem --os-hint darwin
```
仅运行 timeliner 和 shellbags (跳过 MFT 扫描):
```
autotimeliner -f TargetServer.raw --skip-mftscan
```
完整取证扫描 (Windows 插件集 + 可选的扩展插件):
```
autotimeliner -f TargetServer.raw --with-dlllist --with-filescan --with-handles --with-envars
```
快速恶意软件重点扫描:
```
autotimeliner -f TargetServer.raw --skip-timeliner --skip-mftscan --skip-shellbags
```
Linux 重点关注的时间线收集 (自动启用 linux 插件):
```
autotimeliner -f UbuntuWorkstation.mem
```
macOS 重点关注的时间线收集 (自动启用 macOS 插件):
```
autotimeliner -f MacbookCapture.mem
```
## 输出
输出的 CSV 包含以下列:
| 列 | 描述 |
|---|---|
| `Timestamp (UTC)` | ISO 8601 UTC 时间戳 |
| `Source` | 生成记录的插件 |
| `Description` | 文件名、路径、进程或注册表项 |
| `Detail` | 时间戳类型、用户或额外上下文 |
| `Inode` | MFT inode 编号 (适用处) |
| `UID` / `GID` | 用户/组标识符 |
| `Size` | 文件大小,以字节为单位 |
| `Mode` | 文件模式字符串 |
## 识别性能
AutoTimeliner 包含多项优化以缩短识别时间:
- `--os-hint` 完全绕过自动操作系统探测。
- 探测顺序通过文件名提示进行了优化 (例如 `linux`, `ubuntu`, `macos`)。
- 识别结果按镜像键 (`path + size + mtime`) 进行缓存。
缓存文件:
```
~/.cache/autotimeliner/volatility3/.autotimeliner_profile_cache.json
```
在检测期间,日志包含探测进度和结果消息,例如:
```
OS probe attempt: family=windows plugin=windows.info.Info
OS probe returned no rows: windows.info.Info
Memory image identification succeeded: os=linux profile=linux:... probe=linux.banners.Banners
```
## 从 v1 (Volatility2) 迁移
完整比较请参见 [docs/migration.md](docs/migration.md)。
主要变更:
- **Volatility3 配置文件识别** — AutoTimeliner 通过 Volatility3 插件执行尽最大努力的操作系统/配置文件探测。
- **自动符号表设置** — Windows/macOS/Linux 符号包会自动下载并安装。
- **`-p / --customprofile` 已弃用** — 它会被静默忽略。
- **`mftparser` → `mftscan`** — 相同的数据,新的插件名称。
- **不会将 body 文件写入磁盘** — 数据直接通过 Python 流向 CSV。
- **`mactime` 现为可选** — 使用 `--use-mactime` 以运行旧版 body-file 工作流。
## 开发
```
poetry install
poetry run pytest
```
## 许可证
MIT — 详见 [LICENSE](LICENSE)。
## 作者
Andrea Fortuna — [andrea@andreafortuna.org](mailto:andrea@andreafortuna.org) — [andreafortuna.org](https://andreafortuna.org)
标签:HTTPS请求, HTTP请求, Linux取证, macOS取证, MFT解析, Python, Ruby on Rails, SecList, Shellbags, UserAssist, Volatility3, Windows取证, 代码注入检测, 内存取证, 内存转储, 子域名变形, 库, 应急响应, 持久化检测, 数字取证, 数据合并, 无后门, 电子取证, 网络安全, 网络连接分析, 自动化脚本, 进程分析, 逆向工具, 隐私保护