Skip to content

gutddts/AutoForensic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AutoForensic

AutoForensic 是一个应急响应自动化取证收集工具,支持一键收集系统关键信息并生成分析报告。

功能特性

  • 系统信息 -- 操作系统版本、主机名、运行时间、CPU/内存/磁盘信息
  • 进程列表 -- PID、进程名、路径、CPU/内存使用率、启动用户
  • 网络连接 -- TCP/UDP 连接、本地/远程地址、连接状态、关联进程
  • 启动项 -- 注册表 Run 键、启动文件夹、计划任务、服务
  • 服务列表 -- 服务名称、状态、启动类型、可执行路径
  • 持久化分析 -- 检测常见的持久化后门机制
  • 异常检测 -- 标记可疑端口、高资源进程、非系统进程
  • 多种报告格式 -- JSON 结构化输出 + 美观的 HTML 报告

支持平台

  • Windows
  • Linux
  • macOS

安装

# 1. 安装依赖
pip install -r requirements.txt

# 2. 直接运行(无需安装)
python main.py

# 3. 或安装为系统命令
pip install -e .
autoforensic

使用方法

基本使用

# 默认生成 JSON + HTML 报告
python main.py

# 指定输出目录
python main.py --output-dir ./report

输出格式

# 仅 JSON 格式
python main.py --format json

# 仅 HTML 格式
python main.py --format html

# JSON + HTML(默认)
python main.py --format both

快速模式

快速模式只收集关键系统信息,跳过网络连接和启动项收集:

python main.py --quick

详细日志

显示更详细的运行日志(包括异常堆栈):

python main.py --verbose

组合使用

python main.py --output-dir ./report --format both --verbose

报告输出

HTML 报告

HTML 报告包含:

  • 摘要卡片(进程/连接/服务/启动项/发现/告警统计)
  • 系统信息总览
  • 进程列表(按 CPU 使用率排序)
  • 网络连接列表
  • 系统服务列表
  • 启动项列表
  • 持久化分析结果
  • 异常检测结果

所有样式均为内联 CSS,无需外部资源,可直接在浏览器中打开。

JSON 报告

JSON 报告包含完整的结构化数据,适合程序化处理。

项目结构

AutoForensic/
├── main.py                  # CLI入口
├── requirements.txt         # 依赖清单
├── setup.py                 # 安装配置
├── collector/               # 数据收集模块
│   ├── system_info.py       # 系统基本信息
│   ├── processes.py         # 进程列表
│   ├── network.py           # 网络连接
│   ├── startup.py           # 启动项
│   └── services.py          # 服务列表
├── analyzer/                # 分析模块
│   ├── persistence.py       # 持久化检测
│   └── anomaly.py           # 异常检测
├── reporter/                # 报告模块
│   ├── json_reporter.py     # JSON报告
│   └── html_reporter.py     # HTML报告
├── utils/                   # 工具模块
│   └── common.py            # 通用工具函数
└── samples/                 # 示例文件
    └── sample_report.json   # 示例报告

注意事项

  1. 某些数据收集需要管理员/root 权限(如完整的进程列表、服务信息)
  2. 网络连接收集在 Linux 上可能需要 root 权限
  3. 启动项收集在 Windows 上需要访问注册表的权限
  4. HTML 报告使用内联 CSS,可以直接在浏览器中打开查看

许可证

MIT License

About

Automated forensic collection tool for incident response — collect system/process/network/startup data, detect persistence mechanisms, output HTML+JSON reports

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors