Aholic-sec/incident-response-host-triage
GitHub: Aholic-sec/incident-response-host-triage
跨 Agent 的主机事件响应取证工具,提供 Windows/Linux 只读采集器并支持 AI 自动分析日志生成报告。
Stars: 1 | Forks: 0
# 事件响应主机取证
跨 Agent 主机事件响应取证技能,以及适用于 Windows 和 Linux 的只读采集器。
本仓库设计用于两种用例:
1. 从 GitHub URL 将该技能安装到 AI agent 环境中。
2. 下载采集器脚本,在目标主机上运行它们,并使用 AI agent 分析生成的 `IR-Logs-*` 目录。
## 安全性
采集器是只读的。它们不会删除文件、终止进程、隔离样本、清除日志、更改配置或上传数据。
生成的 `IR-Logs-*` 目录可能包含敏感的主机信息。请勿提交或发布采集到的日志。
## 仓库布局
- `SKILL.md`:Codex 技能入口点。
- `AGENT_GUIDE.md`:面向其他 AI agent 的跨 Agent 使用指南。
- `scripts/windows-ir-collector.bat`:单一 Windows 入口点。它会自动检测现代 PowerShell 支持,并在遗留系统上回退到内置的 BAT 命令。
- `scripts/windows-ir-collector.ps1`:现代 Windows 采集器,在可用时会被 BAT 入口点自动调用。
- `scripts/linux-ir-collector.sh`:适用于常见的 Ubuntu、Debian、CentOS、类 RHEL 系统的 Linux 采集器。
- `references/analysis-playbook.md`:分析工作流和证据标准。
- `references/malware-coverage.md`:威胁覆盖范围和检测启发式规则。
- `references/report-template.md`:Markdown 报告模板。
- `schemas/ir-log-manifest.schema.json`:清单 schema。
## Windows 采集
将这些文件复制到目标主机的同一目录下:
```
windows-ir-collector.bat
windows-ir-collector.ps1
```
以管理员身份运行 `windows-ir-collector.bat`。
对于无法使用 PowerShell 或 PowerShell 版本过旧的系统,`windows-ir-collector.bat` 会自动使用其内置的 BAT 回退模式。如果仅复制了 BAT 文件,回退模式仍会运行,但覆盖范围会有所减少。
脚本会创建:
```
IR-Logs-Windows-HOSTNAME-TIMESTAMP\
```
完成后,控制台会显示清晰的完成横幅并等待按键。
用于无需暂停的自动化场景:
```
windows-ir-collector.bat --no-pause
```
## Linux 采集
将 `scripts/linux-ir-collector.sh` 复制到目标主机:
```
chmod +x linux-ir-collector.sh
./linux-ir-collector.sh
```
尽可能以 root 身份运行,以获得更全面的覆盖范围。普通用户执行仍然有效,但某些日志和防火墙/账户详细信息可能无法获取。
脚本会创建:
```
IR-Logs-Linux-HOSTNAME-TIMESTAMP/
```
## AI 分析提示词
采集完成后,将生成的 `IR-Logs-*` 目录提供给 AI agent,并使用如下提示词:
```
Use the incident-response-host-triage skill to analyze this IR-Logs directory.
Read manifest.json first, follow AGENT_GUIDE.md and references/analysis-playbook.md,
then generate an evidence-backed incident response report in Chinese.
Every finding must cite the original log file.
```
## 编码说明
Windows 采集器会尽可能写入 UTF-8 编码。
- 现代 PowerShell 模式会记录 `encoding=utf-8` 和 `codepage=65001`。
- 遗留 BAT 模式会记录 `encoding=utf-8-best-effort`、`system/original_codepage.txt` 和 `system/active_codepage.txt`。
如果旧版本地化 Windows 的输出仍然显示为乱码,请使用采集器记录的原始 OEM 代码页对受影响的日志进行解码,在简体中文 Windows 上通常是 CP936。
标签:AI合规, Libemu, PB级数据处理, 主机取证, 安全运维, 库, 应急响应, 自动化收集, 跨平台脚本, 防御加固