开源的活动目录(Active Directory)、ADCS 和 Entra ID / Azure 攻击路径分析工具, 使用 Rust 构建,专为超大规模环境设计。CopperHound 可将 SharpHound、 bloodhound-python、ldapdomaindump 和 AzureHound 的输出、原始 LDIF 转储以及 Sysinternals AD Explorer 快照导入内存映射图存储,并直接在其上运行 路径、暴露面和 CHQL 查询,无需图数据库。单个 容器即可提供 Web UI 和 REST API。

![]() |
![]() |
![]() |
截图使用虚构的演示数据(scripts/demo_data.py)。
文档: 用户指南 · 部署 · 数据源 · REST API · CHQL · 边参考 · 性能 · 架构
docker compose up -d --build
docker compose logs copperhound | grep "Initial admin password"
打开 http://127.0.0.1:8090,以 admin 身份登录,将你的 SharpHound /
AzureHound .zip 或 .json 文件拖放到 Data 标签页,然后点击 Rebuild
graph。COPPERHOUND_ADMIN_PASSWORD 用于设置密码,COPPERHOUND_PORT /
COPPERHOUND_HOST 用于更改发布地址(默认为
127.0.0.1:8090,因此它可以与运行在 8080 端口上的 BloodHound 并存)。
还没有数据? python scripts/demo_data.py demo/ 会生成一个虚构的
环境(包含 AD、ADCS 和 Entra ID,并带有刻意设置的弱点)供你上传;参见
使用演示数据试用。
不使用 Docker:cd web && npm ci && npm run build,然后
cargo run --release -- serve(默认值:127.0.0.1:8080,数据位于 ./data,
UI 来自 ./web/dist)。
账户、API 令牌、监视文件夹、计划报告、变更告警、HTTPS 和单点登录(OpenID Connect、SAML 2.0):docs/DEPLOYMENT.md。
每次数据导入后在后台计算:
CLI 等效命令:copperhound findings corp.chg、copperhound plan corp.chg --steps 10。
一个 WebGL 图形画布(sigma.js),带有搜索、路径查找、节点详情、每条派生边的 “这是如何推导出来的?”,以及 CHQL 编辑器和查询库,还有 发现、修复、区域、态势、报告、数据和管理 页面。带截图的演练:docs/USER_GUIDE.md。
一种只读的 Cypher 方言,编译为原生图操作 — 支持多个
模式和 MATCH 子句、OPTIONAL MATCH、WITH、聚合、
ORDER BY/SKIP/LIMIT、UNION、无向和可变长度跳数、路径
函数和模式谓词。大多数 BloodHound CE 和旧版查询可
原样运行;参见 CHQL 参考和 Cypher 兼容性表。
MATCH p = shortestPath((u:User {name:'[email protected]'})-[*1..]->(t {tier0:true})) RETURN p
MATCH p = allShortestPaths((g:Group)-[*1..]->(t {tier0:true})) WHERE g.name STARTS WITH 'DOMAIN USERS@' RETURN p
MATCH (u:User {hasspn:true, enabled:true}) WHERE u.pwdlastset < 1600000000 RETURN u.name, u.pwdlastset
MATCH (g:Group)-[:AdminTo]->(c:Computer) RETURN g.name, count(c)
MATCH (p)-[r:ADCSESC1|ADCSESC6a]->(d:Domain) RETURN p, r, d
MATCH (n {owned:true}), (m:Group) WHERE m.objectid ENDS WITH '-512' MATCH p = shortestPath((n)-[*1..]->(m)) RETURN p
MATCH (dc)-[:MemberOf*0..]->(g:Group) WHERE g.objectid ENDS WITH '-516' WITH collect(dc) AS dcs
MATCH (c:Computer {unconstraineddelegation:true}) WHERE NOT c IN dcs RETURN c
在命令行中:copperhound query corp.chg "MATCH …"。days_ago(n)
提供相对时间戳,例如 WHERE u.lastlogontimestamp < days_ago(90)。
UI 内置 159 个预置查询,分为 15 个类别(域信息、危险权限、Kerberos、委派、ACL 滥用、会话与横向移动、GPO 与 OU、卫生、最短路径、Tier Zero、已拥有、ADCS、Azure / Entra ID、Azure 资源和混合),每个查询都带有标签,并已针对合成图进行测试。你自己的查询可以保存在服务器端。
记录从内存映射文件中由每个核心扫描,写入一个压缩的稀疏行图,该图可在毫秒内打开;路径和 Tier Zero 暴露作为专门构建的 BFS 遍历在其上运行。一个 10 GB 的 SharpHound 收集(1250 万个对象,6570 万条边)可在 23–31 秒内完成摄取,而在其上计算到 Tier Zero 的最短路径耗时不到 1 毫秒。设计、瓶颈算法和基准测试: docs/PERFORMANCE.md。
# Ingest: any mix of .json files, .zip archives and directories
copperhound ingest 20241105_BloodHound.zip ldd_out/ -o corp.chg
# Several collections of the same domain: the newest collection wins per object
# (see docs/DATA.md; `--merge union` for a plain union)
copperhound ingest 20241001093000_BloodHound.zip 20241105101500_BloodHound.zip -o corp.chg
copperhound stats corp.chg
# Shortest attack path (names or SIDs/GUIDs, case-insensitive)
copperhound path corp.chg --from [email protected] --to "DOMAIN [email protected]"
copperhound path corp.chg --from [email protected] --to-tier0 --exclude HasSession
# Tier Zero exposure and the edges whose removal cuts the most attack paths
copperhound tier0 corp.chg --top 25
copperhound tier0 corp.chg --json > exposure.json
# Blast radius
copperhound reach corp.chg --from WS042.CORP.LOCAL
# Property filter (JSON filter tree, see docs/API.md) and name search
copperhound filter corp.chg '{"and":[{"kind":"User"},{"truthy":"enabled"},{"truthy":"hasspn"}]}'
copperhound search corp.chg backup --kind User
copperhound columns corp.chg # list property columns (builds them for older graphs)
--all-edges 包含不可遍历的边(例如 GetChanges、TrustedBy);
--exclude A,B 丢弃指定类型的边;--threads N 限制并行度。
SharpHound(v4–v6、CE)和 bloodhound-python JSON、SharpHound ADCS、AzureHound
(v2、v3)、ldapdomaindump、LDIF(ldapsearch、ldifde、gzip 压缩)、Sysinternals AD
Explorer 快照,以及用于自定义节点和边类型的 OpenGraph JSON,支持以文件、
目录或 .zip 归档形式提供。CopperHound 也可以通过 LDAP 自行采集。
同一域的多个采集结果会逐对象合并,最新的优先。
格式、原始 LDAP 采集、派生边、Tier Zero 默认值及合并规则:
docs/DATA.md。