cognis-digital/redpath

GitHub: cognis-digital/redpath

Active Directory 攻击路径映射工具,通过最小成本路径算法计算攻击路线并生成修复优先级建议。

Stars: 0 | Forks: 0

REDPATH # REDPATH ### Active Directory 攻击路径映射工具 — 最小成本路径 + 修复优先级 [![PyPI](https://img.shields.io/pypi/v/cognis-redpath.svg?color=6b46c1)](https://pypi.org/project/cognis-redpath/) [![CI](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/6524fc6ee9181044.svg)](https://github.com/cognis-digital/redpath/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) *红队 / 进攻性安全 — 用于授权测试的对抗性工具。*
``` pip install cognis-redpath redpath scan . # → prioritized findings in seconds ``` ## 使用说明 — 分步指南 1. **安装** (Python 3.9+): pip install redpath # 或者:pipx install redpath 2. 从攻击图 JSON 文件中**枚举攻击路径**: redpath paths graph.json 3. 针对同一图谱**获取优先级修复建议**: redpath remediate graph.json 4. **获取机器可读的输出。** 全局 `--format` 标志需放在子命令之前: redpath --format json paths graph.json > paths.json 5. **解读结果。** `paths` 列出了攻击者在图中可能采取的路线;`remediate` 则对能切断最多路径的割点进行排名。解析 JSON 即可将其接入工单系统或仪表盘系统。 6. **集成到 CI 中。** 每当建模的图发生变化时,重新生成路径分析: redpath --format json remediate graph.json > remediation.json ## 目录 - [为什么选择 redpath?](#why) · [功能](#features) · [快速开始](#quick-start) · [示例](#example) · [架构](#architecture) · [AI stack](#ai-stack) · [对比](#how-it-compares) · [集成](#integrations) · [任意平台安装](#install-anywhere) · [相关工具](#related) · [贡献](#contributing) ## 为什么选择 redpath? Active Directory 攻击路径映射工具 — 提供最小成本路径 + 修复优先级 — 无需搭建重型基础设施。 `redpath` 具有单一用途、可脚本化且支持自托管:将其指向目标,即可获得符合您现有工作流格式的优先级结果(table · JSON · SARIF),据此拦截 CI,并允许 agent 通过 MCP 进行调用。
↑ 回到顶部
## 功能 - ✅ 加载图 - ✅ 最短路径 - ✅ 映射攻击路径 - ✅ 修复优先级 - ✅ 加载图文件 - ✅ 支持 Linux/macOS/Windows · Docker · devcontainer 运行 - ✅ 提供 Python、JavaScript、Go 和 Rust 的移植版 (`ports/`)
↑ 回到顶部
## 快速开始 ``` pip install cognis-redpath redpath --version redpath scan . # scan current project redpath scan . --format json # machine-readable redpath scan . --fail-on high # CI gate (non-zero exit) ```
↑ 回到顶部
## 示例 ``` $ redpath scan . [HIGH ] RED-001 example finding (./src/app.py) [MEDIUM ] RED-002 another signal (./config.yaml) 2 findings · risk score 5 · 38ms ```
↑ 回到顶部
## 架构 ``` flowchart LR IN[input] --> P[redpath
analyze + score] P --> OUT[report] ```
↑ 回到顶部
## 从任何 AI stack 中使用 `redpath` 兼容所有主流的 AI 使用方式: - **MCP server** — `redpath mcp` (Claude Desktop, Cursor, Cognis.Studio, [uncensored-fleet](https://github.com/cognis-digital/uncensored-fleet)) - **兼容 OpenAI / JSON** — 通过管道将 `redpath scan . --format json` 传递给任何 agent 或 LLM - **LangChain · CrewAI · AutoGen · LlamaIndex** — 一行代码即可将 CLI/JSON 封装为工具 - **CI / 脚本** — 为非 AI pipeline 提供 exit code + SARIF
↑ 回到顶部
## 对比 | | **Cognis redpath** | BloodHoundAD | |---|:---:|:---:| | 支持自托管,无需账号 | ✅ | 视情况而定 | | 单一命令,零配置 | ✅ | ⚠️ | | 适用于 CI 的 JSON + SARIF | ✅ | 视情况而定 | | 原生支持 MCP (AI agents) | ✅ | ❌ | | 多语言移植版 (JS/Go/Rust) | ✅ | ❌ | | 开源协议 | ✅ COCL | 视情况而定 | *秉承 **BloodHoundAD/BloodHound** 的精神,以 Cognis 的方式重新构建。如果遗漏了某项致谢?欢迎提交 PR。*
↑ 回到顶部
## 集成 可无缝接入您的技术栈:用于代码扫描的 **SARIF**,适用于任何场景的 **JSON**,用于 AI agent 的 **MCP server** (`redpath mcp`),以及用于 SIEM/Slack/Jira 的 webhook 转发器。详见 [`docs/INTEGRATIONS.md`](docs/INTEGRATIONS.md)。
↑ 回到顶部
## 安装 — 全方式、全平台 ``` pip install "git+https://github.com/cognis-digital/redpath.git" # pip (works today) pipx install "git+https://github.com/cognis-digital/redpath.git" # isolated CLI uv tool install "git+https://github.com/cognis-digital/redpath.git" # uv pip install cognis-redpath # PyPI (when published) docker run --rm ghcr.io/cognis-digital/redpath:latest --help # Docker brew install cognis-digital/tap/redpath # Homebrew tap curl -fsSL https://raw.githubusercontent.com/cognis-digital/redpath/main/install.sh | sh ``` | Linux | macOS | Windows | Docker | Cloud | |---|---|---|---|---| | `scripts/setup-linux.sh` | `scripts/setup-macos.sh` | `scripts/setup-windows.ps1` | `docker run ghcr.io/cognis-digital/redpath` | [DEPLOY.md](docs/DEPLOY.md) (AWS/Azure/GCP/k8s) |
↑ 回到顶部
## 相关 Cognis 工具 - [`c2detect`](https://github.com/cognis-digital/c2detect) — C2 服务器指纹识别工具 — Cobalt Strike, Sliver, Mythic, Havoc, Brute Ratel - [`payloadlab`](https://github.com/cognis-digital/payloadlab) — 静态恶意载荷分析器 — PE/ELF/LNK/macro/OneNote - [`pwnreview`](https://github.com/cognis-digital/pwnreview) — 渗透测试报告生成器 — 将 YAML 发现结果转化为 CREST 级别的 PDF - [`crackq`](https://github.com/cognis-digital/crackq) — 自托管密码破解队列 — 带审计日志的多用户 hashcat **探索全套工具 →** [🗂️ 全部 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+ 件工具之一 · Making Tomorrow Better Today
标签:LNA, Python, Web报告查看器, 反取证, 可视化界面, 安全评估, 攻击路径分析, 数据可视化, 无后门, 日志审计, 活动目录, 请求拦截, 逆向工具, 防御 remediation