x-glacier/kali-pentest / kali-pentest-zh
kali-pentest-zh
Flagged通过 SSH 或 Docker 使用 Kali Linux CLI 工具执行授权渗透测试。 覆盖:信息收集、漏洞分析、嗅探与欺骗、Web/API 渗透、漏洞利用、密码攻击、无线、云原生安全、RFID/NFC、VoIP/ICS、逆向工程、取证分析、后渗透/C2、报告生成。
references/post-exploitation/tools/bloodhound.md
View on GitHub# BloodHound
- **Category**: Post-Exploitation / Active Directory Attack Path Analysis
- **Risk Level**: 🟡 Medium
---
## 描述
BloodHound 通过图数据库可视化 Active Directory 环境中的权限关系和攻击路径,帮助快速找到从普通用户到域管理员的最短路径。SharpHound 是数据收集组件,在目标域中运行收集数据后导入 BloodHound 分析。
### 主要组件
| 组件 | 说明 |
|------|------|
| **BloodHound GUI** | 图形分析界面,运行在 Kali 上 |
| **Neo4j** | 图数据库后端,BloodHound 依赖它 |
| **SharpHound** | Windows 数据收集器(.exe,运行在目标域内)|
| **bloodhound-python** | 远程收集(从 Kali 直接查询,无需到目标机器)|
## 安装
```bash
# 安装(传统 BloodHound 4.x)
sudo apt install bloodhound neo4j
# 启动 Neo4j 数据库
sudo neo4j start
# 访问 http://localhost:7474 修改默认密码(neo4j/neo4j → 自定义)
# 启动 BloodHound GUI
bloodhound-start
# --- BloodHound Community Edition (CE) v5+ 可通过 Docker 部署 ---
# git clone https://github.com/SpecterOps/BloodHound.git
# cd BloodHound && docker compose -f examples/docker-compose/docker-compose.yml up
# 访问 http://localhost:8080 (首次运行时打印凭据)
# CE 采集优先使用当前 SharpHound 发布版
```
## 参数说明
| 参数 | 说明 |
|-------------|------|
| `SharpHound.exe -c <methods>` | 采集方法:Group、LocalAdmin、Session、Trusts、Default、All、DCOnly、ACL、ObjectProps |
| `-d <domain>` | 要查询的域 |
| `--domaincontroller <host>` | 查询的域控 |
| `--outputdirectory <dir>` | 采集结果输出目录 |
| `--zipfilename <file>` | 采集数据的 zip 文件名 |
| `bloodhound-python -c <methods>` | 采集方法:Group、LocalAdmin、Session、Trusts、Default、All、DCOnly |
| `bloodhound-ce-python -c <methods>` | BloodHound CE 远程采集方法选择 |
| `-ns <ip>` | 用于查询的备用名称服务器 |
## 常用命令
### SharpHound 数据收集(在目标机器上运行)
```powershell
# 下载 SharpHound:
# BloodHound 4.x: https://github.com/SpecterOps/BloodHound-Legacy/tree/master/Collectors
# BloodHound CE: https://github.com/SpecterOps/SharpHound (注意版本匹配!)
# 全量采集
.\SharpHound.exe -c All
# 低噪声 CE 起点,或指定聚焦采集方法:
# .\SharpHound.exe -c Default
# .\SharpHound.exe -c Group,LocalGroup,ACL,ObjectProps,Trusts
# 指定域
.\SharpHound.exe -c All -d target.domain.com
# 指定域控
.\SharpHound.exe -c All --domaincontroller dc01.target.com
# 隐蔽收集(减少噪音)
.\SharpHound.exe -c DCOnly --stealth
# 输出压缩包(上传到 Kali 导入)
# 注意:--zipfilename 只设置文件名;输出路径使用 --outputdirectory
.\SharpHound.exe -c All --outputdirectory C:\temp\ --zipfilename bloodhound_data.zip
```
### Python 版本(无需在 Windows 上运行)
```bash
# --- 用于传统 BloodHound 4.x ---
# 安装 bloodhound-python(传统版)
pip install bloodhound
# 使用域账号收集(从 Kali 远程收集)
bloodhound-python -u user -p password -d target.com -ns <DC-IP> -c All
# PTH 模式
bloodhound-python -u user --hashes :NTLM_HASH -d target.com -ns <DC-IP> -c All
# --- 用于 BloodHound CE ---
# pip install bloodhound-ce
# bloodhound-ce-python -u user -p password -d target.com -ns <DC-IP> -c All
```
### BloodHound 常用查询
```text
# 内置查询(Queries 面板)
- Find all Domain Admins
- Find Shortest Paths to Domain Admins
- Find Principals with DCSync Rights
- Find Computers where Domain Users are Local Admin
- Shortest Paths to Unconstrained Delegation Systems
- Find AS-REP Roastable Users
- Find Kerberoastable Users
```
## 注意事项
1. 始终以 `-c Default` 作为起点运行 SharpHound——它以最小噪声收集最有用的数据(组、ACL、信任关系)。
2. BloodHound CE 优先使用当前 SharpHound 发布版;仅在分析传统 BloodHound 部署时使用 legacy collectors。
3. 数据导入后,第一个运行的查询应是「Find Shortest Paths to Domain Admins」——它能立即揭示最具影响力的攻击路径。
4. 无法在目标上部署 SharpHound.exe 时,可使用 bloodhound-python 从 Kali 进行远程收集。
5. 获取域管控制权后,在 BloodHound 中将所有域管账户标记为「Owned」——用于跟踪进度并识别剩余攻击路径。
---
## 官方参考
- [BloodHound CE v5+(GitHub)](https://github.com/SpecterOps/BloodHound)
- [BloodHound 文档](https://bloodhound.specterops.io)
- [SharpHound 收集器 — CE 版(GitHub)](https://github.com/SpecterOps/SharpHound)
- [SharpHound 收集器 — Legacy 4.x(GitHub)](https://github.com/SpecterOps/BloodHound-Legacy/tree/master/Collectors)
- [bloodhound-python(GitHub)](https://github.com/dirkjanm/BloodHound.py)
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |