cognis-digital/ttphunt

GitHub: cognis-digital/ttphunt

基于规则包在日志中狩猎 MITRE ATT&CK 技术的轻量级威胁检测工具。

Stars: 0 | Forks: 0

TTPHUNT # TTPHUNT ### 使用规则包在日志中狩猎 MITRE ATT&CK 技术 [![PyPI](https://img.shields.io/pypi/v/cognis-ttphunt.svg?color=6b46c1)](https://pypi.org/project/cognis-ttphunt/) [![CI](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/8faaee636b055452.svg)](https://github.com/cognis-digital/ttphunt/actions) [![License: COCL 1.0](https://img.shields.io/badge/License-COCL%201.0-2b6cb0.svg)](LICENSE) [![Suite](https://img.shields.io/badge/Cognis-Neural%20Suite-6b46c1.svg)](https://github.com/cognis-digital) *Cognis Neural Suite 的一部分。*
``` pip install cognis-ttphunt ttphunt scan . # → prioritized findings in seconds ``` ## 使用说明 — 逐步指南 1. **安装** (Python 3.9+): pip install ttphunt 2. 使用内置规则包在日志文件(JSON array 或 JSONL)中**狩猎 ATT&CK 技术**: ttphunt hunt auth.jsonl 3. **调整狩猎。** 通过 `--min-severity` 提高基线,限定特定的技术,或者提供你自己的规则包: ttphunt hunt auth.jsonl --min-severity high -t T1110 -t T1078 -r my_rules.json 4. **读取或导出输出。** 输出 JSON 以供工具使用,或者将 HTML 报告写入文件: ttphunt hunt auth.jsonl --format json -o findings.json ttphunt hunt auth.jsonl --format html -o report.html 5. **在 CI 中检查规则。** 列出活动的规则包,以作为 pipeline 的一部分验证覆盖范围: ttphunt rules --format json | jq '.[].technique' ## 目录 - [为什么选择 ttphunt?](#why) · [功能](#features) · [快速开始](#quick-start) · [示例](#example) · [架构](#architecture) · [AI 技术栈](#ai-stack) · [对比](#how-it-compares) · [集成](#integrations) · [随处安装](#install-anywhere) · [相关项目](#related) · [贡献](#contributing) ## 为什么选择 ttphunt? 使用规则包在日志中狩猎 MITRE ATT&CK 技术 —— 而无需搭建重量级的基础设施。 `ttphunt` 是单用途、可脚本化且可自托管的:将其指向目标,以你的工作流已经使用的格式(table · JSON · SARIF)获取经过优先级排序的结果,将其作为 CI 的把关工具,并让 agent 通过 MCP 驱动它。
↑ 回到顶部
## 功能 - ✅ 加载事件 - ✅ 从文本加载事件 - ✅ 加载规则 - ✅ 狩猎 - ✅ 汇总 - ✅ 运行于 Linux/macOS/Windows · Docker · devcontainer - ✅ 提供 Python、JavaScript、Go 和 Rust 移植版 (`ports/`)
↑ 回到顶部
## 快速开始 ``` pip install cognis-ttphunt ttphunt --version ttphunt scan . # scan current project ttphunt scan . --format json # machine-readable ttphunt scan . --fail-on high # CI gate (non-zero exit) ```
↑ 回到顶部
## 示例 ``` $ ttphunt scan . [HIGH ] TTP-001 example finding (./src/app.py) [MEDIUM ] TTP-002 another signal (./config.yaml) 2 findings · risk score 5 · 38ms ```
↑ 回到顶部
## 架构 ``` flowchart LR IN[input] --> P[ttphunt
analyze + score] P --> OUT[report] ```
↑ 回到顶部
## 从任何 AI 技术栈中使用 `ttphunt` 与所有流行的 AI 使用方式兼容: - **MCP server** — `ttphunt mcp` (Claude Desktop, Cursor, Cognis.Studio, [uncensored-fleet](https://github.com/cognis-digital/uncensored-fleet)) - **兼容 OpenAI / JSON** — 通过管道将 `ttphunt scan . --format json` 传给任何 agent 或 LLM - **LangChain · CrewAI · AutoGen · LlamaIndex** — 一行代码即可将 CLI/JSON 封装为工具 - **CI / 脚本** — 为非 AI pipeline 提供 exit code + SARIF
↑ 回到顶部
## 对比 | | **Cognis ttphunt** | 典型工具 | |---|:---:|:---:| | 可自托管,无需账户 | ✅ | 视情况而定 | | 单一命令,零配置 | ✅ | ⚠️ | | 适用于 CI 的 JSON + SARIF | ✅ | 视情况而定 | | 原生支持 MCP (AI agent) | ✅ | ❌ | | 多语言移植版 (JS/Go/Rust) | ✅ | ❌ | | 开放许可证 | ✅ COCL | 视情况而定 |
↑ 回到顶部
## 集成 接入你的技术栈:用于代码扫描的 **SARIF**,用于一切的 **JSON**,用于 AI agent 的 **MCP server** (`ttphunt mcp`),以及用于 SIEM/Slack/Jira 的 webhook 转发器。参见 [`docs/INTEGRATIONS.md`](docs/INTEGRATIONS.md)。
↑ 回到顶部
## 安装 — 各种方式,全平台 ``` pip install "git+https://github.com/cognis-digital/ttphunt.git" # pip (works today) pipx install "git+https://github.com/cognis-digital/ttphunt.git" # isolated CLI uv tool install "git+https://github.com/cognis-digital/ttphunt.git" # uv pip install cognis-ttphunt # PyPI (when published) docker run --rm ghcr.io/cognis-digital/ttphunt:latest --help # Docker brew install cognis-digital/tap/ttphunt # Homebrew tap curl -fsSL https://raw.githubusercontent.com/cognis-digital/ttphunt/main/install.sh | sh ``` | Linux | macOS | Windows | Docker | 云平台 | |---|---|---|---|---| | `scripts/setup-linux.sh` | `scripts/setup-macos.sh` | `scripts/setup-windows.ps1` | `docker run ghcr.io/cognis-digital/ttphunt` | [DEPLOY.md](docs/DEPLOY.md) (AWS/Azure/GCP/k8s) |
↑ 回到顶部
## 相关的 Cognis 工具 **探索全套工具 →** [🗂️ 全部 170+ 工具](https://github.com/cognis-digital/cognis-neural-suite) · [⭐ awesome-cognis](https://github.com/cognis-digital/awesome-cognis) · [🔗 cognis-sources](https://github.com/cognis-digital/cognis-sources) · [🤖 uncensored-fleet](https://github.com/cognis-digital/uncensored-fleet) · [🧠 engram](https://github.com/cognis-digital/engram)
↑ 回到顶部
## 互操作性 `{}` 与包含 300+ 工具的 Cognis 套件组合使用 —— JSON 输入/输出以及共享的 兼容 OpenAI 的 `/v1` 骨干。请参阅 **[INTEROP.md](INTEROP.md)** 了解 套件图谱、组合模式和参考技术栈。 ## 许可证 源代码可见,基于 **Cognis Open Collaboration License (COCL) v1.0** —— 可免费用于个人、内部评估、研究和教育用途;**商业/生产用途需要许可证** (licensing@cognis.digital)。参见 [LICENSE](LICENSE)。
Cognis Digital · Cognis Neural Suite 中 170+ 工具之一 · 让明天在今天更美好
标签:Cloudflare, MITRE ATT&CK, Python, SIEM/规则引擎, 可视化界面, 数据可视化, 无后门, 日志审计, 请求拦截, 逆向工具