M00NLIG7/ChopChopGo
GitHub: M00NLIG7/ChopChopGo
基于Sigma规则的Linux日志取证与威胁猎杀工具,支持syslog、auditd、journald等多种日志格式的快速分析。
Stars: 202 | Forks: 16
[](https://goreportcard.com/report/github.com/M00NLIG7/ChopChopGo)
ChopChopGo 受 Chainsaw 启发,利用 Sigma 规则进行取证痕迹恢复,能够对日志和其他痕迹进行快速且全面的分析,以识别 Linux 上潜在的安全事件和威胁。
## 功能特性
- :dart: 使用 [Sigma](https://github.com/SigmaHQ/sigma) 检测规则和自定义 ChopChopGo 检测规则来猎杀威胁
- :zap: 极速运行,使用 Go 语言编写
- :feather: 简洁轻量的执行与输出格式,无冗余内容
- :computer: 在 Linux 上运行
```
$ ./ChopChopGo -target syslog -rules ./rules/linux/builtin/syslog/
▄████▄ ██░ ██ ▒█████ ██▓███ ▄████▄ ██░ ██ ▒█████ ██▓███ ▄████ ▒█████
▒██▀ ▀█ ▓██░ ██▒▒██▒ ██▒▓██░ ██▒ ▒██▀ ▀█ ▓██░ ██▒▒██▒ ██▒▓██░ ██▒ ██▒ ▀█▒▒██▒ ██▒
▒▓█ ▄ ▒██▀▀██░▒██░ ██▒▓██░ ██▓▒ ▒▓█ ▄ ▒██▀▀██░▒██░ ██▒▓██░ ██▓▒ ▒██░▄▄▄░▒██░ ██▒
▒▓▓▄ ▄██▒░▓█ ░██ ▒██ ██░▒██▄█▓▒ ▒ ▒▓▓▄ ▄██▒░▓█ ░██ ▒██ ██░▒██▄█▓▒ ▒ ░▓█ ██▓▒██ ██░
▒ ▓███▀ ░░▓█▒░██▓░ ████▓▒░▒██▒ ░ ░ ▒ ▓███▀ ░░▓█▒░██▓░ ████▓▒░▒██▒ ░ ░ ░▒▓███▀▒░ ████▓▒░
░ ░▒ ▒ ░ ▒ ░░▒░▒░ ▒░▒░▒░ ▒▓▒░ ░ ░ ░ ░▒ ▒ ░ ▒ ░░▒░▒░ ▒░▒░▒░ ▒▓▒░ ░ ░ ░▒ ▒ ░ ▒░▒░▒░
░ ▒ ▒ ░▒░ ░ ░ ▒ ▒░ ░▒ ░ ░ ▒ ▒ ░▒░ ░ ░ ▒ ▒░ ░▒ ░ ░ ░ ░ ▒ ▒░
░ ░ ░░ ░░ ░ ░ ▒ ░░ ░ ░ ░░ ░░ ░ ░ ▒ ░░ ░ ░ ░ ░ ░ ░ ▒
░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░
░ ░
By Keyboard Cowboys (M00NL1G7)
Using syslog file: /var/log/messages
100% |██████████████████████████████████████████████████████████████████████████████████████████████| (67504/67504, 27840 it/s)
+-----------------+--------------------------------+-----------------------------------------+
| TIMESTAMP | MESSAGE | TAGS |
+-----------------+--------------------------------+-----------------------------------------+
| Mar 2 20:04:38 | fedora systemd[1]: | attack.defense_evasion-attack.t1562.004 |
| | iptables.service: Deactivated | |
| | successfully. | |
| Mar 4 10:19:03 | DESKTOP-RNL1DBO systemd[1]: | attack.defense_evasion-attack.t1562.004 |
| | iptables.service: Deactivated | |
| | successfully. | |
+-----------------+--------------------------------+-----------------------------------------+
Processed 67504 syslog events
```
## 快速入门指南
### 下载与运行
若要获取包含 ChopChopGo 二进制文件及配套官方 Sigma 规则的一体化 zip 压缩包,请查看 [releases 部分](https://github.com/M00NLIG7/ChopChopGo/releases)。在该 releases 部分中,您还可以找到预编译的 ChopChopGo 纯二进制版本。
如果您想自行编译 ChopChopGo,可以克隆 ChopChopGo 仓库:
`git clone https://github.com/M00NLIG7/ChopChopGo.git`
然后运行以下命令自行编译代码:`go build`。
您可能需要安装 systemd 的开发文件(例如 `apt-get install libsystemd-dev`)
#### 命令示例
```
# 默认搜索 syslog
./ChopChopGo
# 使用官方 sigma rules 扫描 auditd log
./ChopChopGo -target auditd -rules ./rules/linux/auditd/ -file /opt/evidence/auditd.log
# 使用指定规则扫描 journald
./ChopChopGo -target journald -rules ./rules/linux/builtin/
# 使用自定义 field-mapping 文件
./ChopChopGo -target auditd -rules ./rules/linux/auditd/ -mapping ./my-mappings/auditd.yml
```
#### 替代输出格式
您可能希望以自动化方式使用 ChopChopGo。CSV 和 JSON 输出选项适用于此目的。使用这两个选项时,标题和进度统计信息不会打印到控制台。
替代输出格式写入 stdout —— 您可以在此进行处理(例如,将其写入文件以备后用)。
每个选项都可以使用 `-out` 参数指定。
##### CSV
```
./ChopChopGo -target syslog -rules ./rules/linux/builtin/syslog/ -out csv
```
##### JSON
```
./ChopChopGo -target syslog -rules ./rules/linux/builtin/syslog/ -out json
```
### 字段映射
ChopChopGo 通过 `mappings/` 中的 YAML 映射文件将 Sigma 规则字段名转换为日志原生字段名:
```
mappings/
auditd.yml # CommandLine→exe, Image→exe, ProcessId→pid, User→auid …
syslog.yml # Message→message, Hostname→facility …
journald.yml # Message→message, Timestamp→timestamp …
```
这些文件基于 `-target` 自动加载。如果缺少映射文件,工具将回退到直通模式(字段名按原样使用),因此现有行为保持不变。
要提供您自己的映射文件 —— 例如为了运行为不同 schema 编写的社区规则 —— 请使用 `-mapping` 标志:
```
./ChopChopGo -target auditd -rules ./rules/ -mapping ./mappings/custom-auditd.yml
```
映射文件如下所示:
```
source: auditd
fields:
CommandLine: exe # Sigma field → auditd native field
Image: exe
ProcessId: pid
User: auid
```
### 更新 Sigma 规则
本仓库包含一个简单的脚本,用于将包含的 Sigma 规则从 [Sigma Rules 仓库](https://github.com/SigmaHQ/sigma/)更新到最新状态。
```
./update-rules.sh
```
快速搜索与猎杀 Linux 取证痕迹
标签:DAST, EVTX分析, Go 语言, HTTP工具, Linux 安全, PFX证书, Python3.6, Sigma 规则, Syslog, Web报告查看器, 域名分析, 库, 应急响应, 开源安全工具, 恶意软件分析, 攻击检测, 数字取证, 无线安全, 日志审计, 自动化脚本, 逆向工程平台