SecurityRonin/forensic-catalog

GitHub: SecurityRonin/forensic-catalog

一个零依赖的 Rust 静态取证知识目录,提供 150+ 工件描述与 MITRE ATT&CK 映射,用于快速检索与优先级排序。

Stars: 0 | Forks: 0

[![crates.io](https://img.shields.io/badge/crates.io-forensic--catalog-orange?style=for-the-badge)](https://crates.io/crates/forensic-catalog) [![docs](https://img.shields.io/badge/docs-docs.rs-blue?style=for-the-badge)](https://docs.rs/forensic-catalog) [![license](https://img.shields.io/badge/license-Apache--2.0-blue?style=for-the-badge)](LICENSE) [![rust](https://img.shields.io/badge/rust-1.75+-orange?style=for-the-badge&logo=rust)](https://www.rust-lang.org) [![sponsor](https://img.shields.io/badge/sponsor-h4x0r-ff69b4?style=for-the-badge&logo=github-sponsors)](https://github.com/sponsors/h4x0r) # forensic-catalog 作为代码的数字取证知识 — 零依赖,仅使用 `std`,可嵌入任何 Rust 二进制文件。 ## 快速开始 ``` [dependencies] forensic-catalog = "0.1" ``` ``` use forensic_catalog::ports::is_suspicious_port; use forensic_catalog::catalog::{CATALOG, TriagePriority}; // Instant port check — no allocations assert!(is_suspicious_port(4444)); // Metasploit default // Pull every Critical-priority artifact, sorted for triage let critical: Vec<_> = CATALOG .for_triage() .into_iter() .filter(|d| d.triage_priority == TriagePriority::Critical) .collect(); ``` ## 内容包含 | 模块 | 覆盖范围 | 关键函数 / 常量 | |---|---|---| | `ports` | C2 端口、Cobalt Strike、Tor、WinRM、RAT 默认端口 | `is_suspicious_port(port)` | | `lolbins` | Windows 与 Linux 的 LOLBins | `WINDOWS_LOLBINS`, `LINUX_LOLBINS` | | `processes` | 已知恶意进程名称 | `MALWARE_PROCESS_NAMES` | | `commands` | 反向 Shell、PowerShell 滥用、下载启动器 | 模式切片 | | `paths` | 可疑文件系统路径 | 路径切片 | | `persistence` | Windows Run 键、Linux cron/init、macOS LaunchAgents | `WINDOWS_RUN_KEYS`, `LINUX_PERSISTENCE_PATHS`, `MACOS_PERSISTENCE_PATHS` | | `catalog` | 150+ 个 `ArtifactDescriptor`,包含 MITRE ATT&CK、分类优先级、解码逻辑 | `CATALOG` | | `antiforensics` | 反取证指示路径与模式 | 指示切片 | | `encryption` | 全磁盘加密工件路径、凭据存储位置 | 路径切片 | | `remote_access` | 远程访问工具指示(RMM、RAT、VPN) | 指示切片 | | `third_party` | OneDrive、PuTTY 等第三方应用工件路径 | 路径切片 | | `pca` | Windows Program Compatibility Assistant 工件 | 路径 / 键常量 | ## `ForensicCatalog` API `catalog` 模块是核心功能。每个工件描述符都是一个 `const` 可构造的 `ArtifactDescriptor` —— 包含 MITRE ATT&CK 标签、分类优先级、保留周期、交叉关联链接以及内嵌解码逻辑的静态结构体。无需 I/O,直到查询时才进行分配。 ### 按 MITRE 技术查询 ``` use forensic_catalog::catalog::CATALOG; // All artifacts relevant to process injection let artifacts = CATALOG.by_mitre("T1055"); for d in &artifacts { println!("{} — {}", d.id, d.meaning); } ``` ### 分类优先级的集合列表 ``` let ordered = CATALOG.for_triage(); // Critical → High → Medium → Low for d in ordered.iter().take(10) { println!("[{:?}] {} — {}", d.triage_priority, d.id, d.name); } ``` ### 关键词搜索 ``` let hits = CATALOG.filter_by_keyword("prefetch"); // matches on name or meaning, case-insensitive ``` ### 结构化过滤 ``` use forensic_catalog::catalog::{ArtifactQuery, DataScope, HiveTarget}; let hits = CATALOG.filter(&ArtifactQuery { scope: Some(DataScope::User), hive: Some(HiveTarget::NtUser), ..Default::default() }); ``` ### 解码原始工件数据 ``` use forensic_catalog::catalog::CATALOG; let descriptor = CATALOG.by_id("userassist").unwrap(); let record = CATALOG.decode(descriptor, value_name, raw_bytes)?; // record.fields — decoded field name/value pairs // record.timestamp — ISO 8601 UTC string, if present // record.mitre_techniques — inherited from the descriptor ```
ArtifactDescriptor 字段 | 字段 | 类型 | 描述 | |---|---|---| | `id` | `&'static str` | 机器可读标识符(例如 `"userassist"`) | | `name` | `&'static str` | 人类可读显示名称 | | `artifact_type` | `ArtifactType` | `RegistryKey`, `RegistryValue`, `File`, `Directory`, `EventLog`, `MemoryRegion` | | `hive` | `Option` | 注册表蜂巢,或文件/内存工件为 `None` | | `key_path` | `&'static str` | 相对于蜂巢根路径的路径 | | `scope` | `DataScope` | `User`, `System`, `Network`, `Mixed` | | `os_scope` | `OsScope` | `Win10Plus`, `Linux`, `LinuxSystemd` 等 | | `decoder` | `Decoder` | `Identity`, `Rot13Name`, `FiletimeAt`, `BinaryRecord`, `Utf16Le`, … | | `meaning` | `&'static str` | 取证意义 | | `mitre_techniques` | `&'static [&'static str]` | ATT&CK 技术 ID | | `fields` | `&'static [FieldSchema]` | 解码输出字段结构 | | `retention` | `Option<&'static str>` | 工件通常保留的周期 | | `triage_priority` | `TriagePriority` | `Critical` / `High` / `Medium` / `Low` | | `related_artifacts` | `&'static [&'static str]` | 交叉关联工件 ID |
## 设计哲学 - **零依赖** — `Cargo.toml` 不包含 `[dependencies]`。没有传递性的供应链风险。 - **无 I/O** — 所有函数均基于传入的值操作。读取文件、注册表或内存是调用方的职责。 - **`const`/`static` 友好** — `ArtifactDescriptor` 及其所有枚举类型均可在 `const` 上下文中构造。编译时扩展目录。 - **测试驱动** — 每个指示表均包含正负测试用例。运行 `cargo test` 验证覆盖。 - **可扩展** — 每个模块相互独立。仅引入所需部分。 ## 使用方 - [`forensic-pivot`](https://github.com/SecurityRonin/forensic-pivot) — 跨证据源交叉引用工件的关联引擎 - [`RapidTriage`](https://github.com/SecurityRonin/RapidTriage) — 实时事件响应分类工具 ## 许可证 Apache-2.0 — 参见 [LICENSE](LICENSE)。 由 [@h4x0r](https://github.com/sponsors/h4x0r) 赞助。
标签:1.75+, Apache-2.0, Cloudflare, crates.io, docs.rs, h4x0r, LOLBins, MITRE ATT&CK, PE 加载器, Rust, SecList, StruQ, Triage, XML注入, 关键路径, 内存取证, 凭证取证, 协议分析, 反取证, 取证, 可疑端口, 可视化界面, 威胁情报, 子域名变形, 安全评估, 嵌入, 库, 库, 应急响应, 应急响应, 开发者工具, 恶意进程, 数字取证, 权限提升, 标准库, 磁盘取证, 网络安全审计, 网络流量审计, 网络调试, 自动化, 自动化脚本, 赞助, 通知系统, 零依赖