Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
RustHound — 用于 BloodHound Legacy 的 Active Directory 数据摄取器,使用 Rust 编写。🦀 | Kitploit
工具/GitHubGitHub/nh-red-team/rusthound
侦察信息收集渗透测试红队
GitHubnh-red-team/rusthound

RustHound

用于 BloodHound Legacy 的 Active Directory 数据摄取器,使用 Rust 编写。🦀

查看仓库
1.2k1071年前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

此版本仅与 BloodHound Legacy 4.x 兼容

与 BloodHound Community Edition (CE) 兼容的版本可在此处找到 RustHound-CE。


Crates.io GitHub Twitter Follow Twitter Follow
Linux supported Windows supported macOS supported

摘要

  • 限制

  • 描述

  • 如何编译

    • 使用 Makefile
    • 使用 Dockerfile
    • 使用 Cargo
    • Linux x86_64 静态版本
    • 从 Linux 编译 Windows 静态版本
    • 从 Linux 编译 macOS 静态版本
    • 优化二进制文件大小
  • 如何构建文档

  • 用法

  • 演示

    • 简单用法
    • FQDN 解析模块
    • ADCS 收集模块
  • 统计

  • 路线图

  • 链接

限制

并非所有 SharpHound 的功能都已实现。RustHound 中存在一些 SharpHound 或 BloodHound-Python 中没有的功能。请参考路线图了解更多信息。

描述

RustHound 是一个跨平台的 BloodHound 收集工具,使用 Rust 编写,兼容 Linux、Windows 和 macOS。

无 AV 检测且交叉编译。

RustHound 生成用户、组、计算机、OU、GPO、容器和域 JSON 文件,可使用 BloodHound 进行分析。

💡 如果你能使用 SharpHound,请使用它。 如果 SharpHound 被 AV 检测到或不兼容你的操作系统,请将 RustHound 作为备用解决方案。

如何编译?

使用 Makefile

你可以使用 make 命令安装 RustHound 或为 Linux 或 Windows 编译它。

root@kitploit:~
make install
rusthound -h

Makefile 中的更多命令:

root@kitploit:~
Default:
usage: make install
usage: make uninstall
usage: make debug
usage: make release

Static:
usage: make windows
usage: make windows_x64
usage: make windows_x86
usage: make linux_aarch64
usage: make linux_x86_64
usage: make linux_musl
usage: make macos
usage: make arm_musl
usage: make armv7

Without cli argument:
usage: make windows_noargs

Dependencies:
usage: make install_windows_deps
usage: make install_linux_musl_deps
usage: make install_macos_deps

使用 Dockerfile

使用 Docker 运行 RustHound 以确保拥有所有依赖项。

root@kitploit:~
docker build --rm -t rusthound .

# 然后
docker run --rm -v ./:/usr/src/rusthound rusthound windows
docker run --rm -v ./:/usr/src/rusthound rusthound linux_musl
docker run --rm -v ./:/usr/src/rusthound rusthound macos

使用 Cargo

你需要在系统上安装 Rust。

https://www.rust-lang.org/fr/tools/install

RustHound 支持 Kerberos 和 GSSAPI。因此,它需要 Clang 及其开发库,以及 Kerberos 开发库。在 Debian 和 Ubuntu 上,这意味着需要 clang-N、libclang-N-dev 和 libkrb5-dev。

例如:

root@kitploit:~
# Debian/Ubuntu
sudo apt-get -y update && sudo apt-get -y install gcc clang libclang-dev libgssapi-krb5-2 libkrb5-dev libsasl2-modules-gssapi-mit musl-tools gcc-mingw-w64-x86-64

以下是如何使用 cargo 命令编译 "release" 和 "debug" 版本。

root@kitploit:~
git clone https://github.com/OPENCYBER-FR/RustHound
cd RustHound
cargo build --release
# 或 debug 版本
cargo b

结果可以在 target/release 或 target/debug 文件夹中找到。

以下是从 Linux 编译每个操作系统的方法。 如果你需要另一种编译系统,请查阅此链接中的列表:https://doc.rust-lang.org/nightly/rustc/platform-support.html

手动为 Linux x86_64 编译静态版本

root@kitploit:~
# 为 Linux 安装 rustup 和 Cargo
curl https://sh.rustup.rs -sSf | sh

# 添加 Linux 依赖
rustup install stable-x86_64-unknown-linux-gnu
rustup target add x86_64-unknown-linux-gnu

# 为 Linux 静态编译
git clone https://github.com/OPENCYBER-FR/RustHound
cd RustHound
CFLAGS="-lrt";LDFLAGS="-lrt";RUSTFLAGS='-C target-feature=+crt-static';cargo build --release --target x86_64-unknown-linux-gnu

结果可以在 target/x86_64-unknown-linux-gnu/release 文件夹中找到。

从 Linux 手动为 Windows 编译静态版本

root@kitploit:~
# 在 Linux 上安装 rustup 和 Cargo
curl https://sh.rustup.rs -sSf | sh

# 添加 Windows 依赖
rustup install stable-x86_64-pc-windows-gnu
rustup target add x86_64-pc-windows-gnu

# 为 Windows 静态编译
git clone https://github.com/OPENCYBER-FR/RustHound
cd RustHound
RUSTFLAGS="-C target-feature=+crt-static" cargo build --release --target x86_64-pc-windows-gnu

结果可以在 target/x86_64-pc-windows-gnu/release 文件夹中找到。

从 Linux 手动为 macOS 编译静态版本

出色的文档:https://wapl.es/rust/2019/02/17/rust-cross-compile-linux-to-macos.html

root@kitploit:~
# 在 Linux 上安装 rustup 和 Cargo
curl https://sh.rustup.rs -sSf | sh

# 添加 macOS 工具链
sudo git clone https://github.com/tpoechtrager/osxcross /usr/local/bin/osxcross
sudo wget -P /usr/local/bin/osxcross/ -nc https://s3.dockerproject.org/darwin/v2/MacOSX10.10.sdk.tar.xz && sudo mv /usr/local/bin/osxcross/MacOSX10.10.sdk.tar.xz /usr/local/bin/osxcross/tarballs/
sudo UNATTENDED=yes OSX_VERSION_MIN=10.7 /usr/local/bin/osxcross/build.sh
sudo chmod 775 /usr/local/bin/osxcross/ -R
export PATH="/usr/local/bin/osxcross/target/bin:$PATH"

# 需要告诉 Cargo 为 x86_64-apple-darwin 目标使用正确的链接器,因此将以下内容添加到项目的 .cargo/config 文件中:
grep 'target.x86_64-apple-darwin' ~/.cargo/config || echo "[target.x86_64-apple-darwin]" >> ~/.cargo/config
grep 'linker = "x86_64-apple-darwin14-clang"' ~/.cargo/config || echo 'linker = "x86_64-apple-darwin14-clang"' >> ~/.cargo/config
grep 'ar = "x86_64-apple-darwin14-clang"' ~/.cargo/config || echo 'ar = "x86_64-apple-darwin14-clang"' >> ~/.cargo/config

# 为 macOS 静态编译
git clone https://github.com/OPENCYBER-FR/RustHound
cd RustHound
RUSTFLAGS="-C target-feature=+crt-static" cargo build --release --target x86_64-apple-darwin --features nogssapi

结果可以在 target/x86_64-apple-darwin/release 文件夹中找到。

优化二进制文件大小

💡 要获得 RustHound 的优化编译,请在 Cargo.toml 文件末尾添加以下编译参数。

root@kitploit:~
[profile.release]
opt-level = "z"
lto = true
strip = true
codegen-units = 1
panic = "abort"

二进制文件的大小将大幅减小。 可以使用基本的 cargo 编译器命令。

root@kitploit:~
make windows

更多信息请点击此处

如何构建文档?

root@kitploit:~
git clone https://github.com/OPENCYBER-FR/RustHound
cd RustHound
cargo doc --open --no-deps

用法

root@kitploit:~
Usage: rusthound [OPTIONS] --domain <domain>

Options:
  -v...          Set the level of verbosity
  -h, --help     Print help information
  -V, --version  Print version information

REQUIRED VALUES:
  -d, --domain <domain>  Domain name like: DOMAIN.LOCAL

OPTIONAL VALUES:
  -u, --ldapusername <ldapusername>  LDAP username, like: [email protected]
  -p, --ldappassword <ldappassword>  LDAP password
  -f, --ldapfqdn <ldapfqdn>          Domain Controler FQDN like: DC01.DOMAIN.LOCAL or just DC01
  -i, --ldapip <ldapip>              Domain Controller IP address like: 192.168.1.10
  -P, --ldapport <ldapport>          LDAP port [default: 389]
  -n, --name-server <name-server>    Alternative IP address name server to use for DNS queries
  -o, --output <output>              Output directory where you would like to save JSON files [default: ./]

OPTIONAL FLAGS:
      --ldaps           Force LDAPS using for request like: ldaps://DOMAIN.LOCAL/
      --dns-tcp         Use TCP instead of UDP for DNS queries
      --dc-only         Collects data only from the domain controller. Will not try to retrieve CA security/configuration or check for Web Enrollment
      --old-bloodhound  For ADCS only. Output result as BloodHound data for the original BloodHound version from @BloodHoundAD without PKI support
  -z, --zip             Compress the JSON files into a zip archive

OPTIONAL MODULES:
      --fqdn-resolver  Use fqdn-resolver module to get computers IP address
      --adcs           Use ADCS module to enumerate Certificate Templates, Certificate Authorities and other configurations.
                       (For the custom-built BloodHound version from @ly4k with PKI support)

演示

演示基于 GOADv2,由 mayfly 实现:

简单用法

root@kitploit:~
# Linux 使用 username:password
rusthound -d north.sevenkingdoms.local -u '[email protected]' -p '_L0ngCl@w_' -o /tmp/demo -z

# Linux 使用 username:password 和 ldapip
rusthound -d north.sevenkingdoms.local -i 192.168.56.11 -u '[email protected]' -p '_L0ngCl@w_' -o /tmp/demo -z

# Linux 使用 username:password 和 ldaps
rusthound -d north.sevenkingdoms.local --ldaps -u '[email protected]' -p '_L0ngCl@w_' -o /tmp/demo -z 
# Linux 使用 username:password 和 ldaps 以及自定义端口
rusthound -d north.sevenkingdoms.local --ldaps -P 3636 -u '[email protected]' -p '_L0ngCl@w_' -o /tmp/demo -z 

# 提示:将标准输出和标准错误重定向并追加到文件中 > /tmp/rh_output 2>&1
rusthound -d north.sevenkingdoms.local --ldaps -u '[email protected]' -p '_L0ngCl@w_' -o /tmp/demo --fqdn-resolver > /tmp/rh_output 2>&1

# Windows 使用 GSSAPI 会话
rusthound.exe -d sevenkingdoms.local --ldapfqdn kingslanding
# Windows 简单绑定连接 username:password(不要使用 cmd.exe 的单引号或双引号)
rusthound.exe -d sevenkingdoms.local -u [email protected] -p _L0ngCl@w_ -o output -z

# Kerberos 认证(Linux)
export KRB5CCNAME="/tmp/jeor.mormont.ccache"
rusthound -d sevenkingdoms.local -f kingslanding -k -z
# Kerberos 认证(Windows)
rusthound.exe -d sevenkingdoms.local -f kingslanding -k -z

FQDN 解析模块

root@kitploit:~
# Linux 使用 username:password 和 FQDN 解析模块
rusthound -d essos.local -u '[email protected]' -p 'BurnThemAll!' -o /tmp/demo --fqdn-resolver -z
# Linux 使用 username:password 和 ldaps 以及 FQDN 解析模块和 TCP DNS 请求及自定义名称服务器
rusthound -d essos.local --ldaps -u '[email protected]' -p 'BurnThemAll!' -o /tmp/demo --fqdn-resolver --tcp-dns --name-server 192.168.56.12 -z

# Windows 使用 GSSAPI 会话和 FQDN 解析模块
rusthound.exe -d essos.local -f meereen -o output --fqdn-resolver -z
# Windows 简单绑定连接 username:password 和 FQDN 解析模块及 TCP DNS 请求和自定义名称服务器(不要使用 cmd.exe 的单引号或双引号)
rusthound.exe -d essos.local -u [email protected] -p BurnThemAll! -o output -z --fqdn-resolver --tcp-dns --name-server 192.168.56.12 

ADCS 收集模块

示例使用 @ly4k BloodHound 版本。

root@kitploit:~
# Linux 使用 username:password 和 ADCS 模块(用于 @ly4k BloodHound 版本)
rusthound -d essos.local -u '[email protected]' -p 'BurnThemAll!' -o /tmp/adcs --adcs -z
# Linux 使用 username:password 和 ADCS 模块以及 dconly 标志(将不检查 Web Enrollment)
rusthound -d essos.local -u '[email protected]' -p 'BurnThemAll!' -o /tmp/adcs --adcs --dc-only -z

# Linux 使用 username:password 和 ADCS 模块,使用 "--old-bloodhound" 参数(用于官方 @BloodHoundAd 版本)
rusthound -d essos.local -u '[email protected]' -p 'BurnThemAll!' -o /tmp/adcs --adcs --old-bloodhound -z

# Windows 使用 GSSAPI 会话和 ADCS 模块
rusthound.exe -d essos.local -f meereen -o output -z --adcs
# Windows 使用 GSSAPI 会话和 ADCS 模块及 TCP DNS 请求和自定义名称服务器
rusthound.exe -d essos.local --ldapfqdn meereen -o output -z --adcs --tcp-dns --name-server 192.168.56.12
# Windows 简单绑定连接 username:password(不要使用 cmd.exe 的单引号或双引号)
rusthound.exe -d essos.local -u [email protected] -p BurnThemAll! -o output -z --adcs --dc-only

你可以在资源文件夹中找到演示中使用的自定义查询。

使用以下命令安装:

root@kitploit:~
cp resources/customqueries.json ~/.config/bloodhound/customqueries.json

🚀 统计

为了在包含更多 LDAP 对象的 DC 上进行统计,请在来自 GOAD 的域控制器 ESSOS.local 上运行 BadBlood。DC 现在应有大约 3500 个对象。以下是运行以下工具的平均时间:

🚥 路线图

认证

  • LDAP (389)
  • LDAPS (636)
  • BIND
  • NTLM
  • Kerberos
  • 交互式密码输入

输出

  • users.json
  • groups.json
  • computers.json
  • ous.json
  • gpos.json
  • containers.json
  • domains.json
  • cas.json
  • templates.json
  • 参数和功能,用于压缩 JSON 文件 --zip

模块

  • 如果用户有权限,自动检索 LAPS 密码 自动
  • 将找到的 FQDN 计算机解析为 IP 地址 --fqdn-resolver
  • 使用 Certipy 检索用于 ESC 利用的证书 --adcs
  • Kerberos 攻击模块(ASREPROASTING 和 KERBEROASTING) --attack-kerberos
  • 从受信任域检索数据 --follow-trust(目前正在开发中,已有该模块的 beta 版本)

BloodHound v4.2

  • 解析功能

    • 用户和计算机
      • HasSIDHistory
    • 用户
      • 属性 : sfupassword
  • DCERPC(依赖项)

    • 计算机
      • 会话
    • OU 和域
      • 本地管理员
      • 远程桌面用户
      • Dcom 用户
      • PS 远程用户

🔗 链接

  • 博客文章:https://www.opencyber.com/rusthound-data-collector-for-bloodhound-written-in-rust/
  • BloodHound.py:https://github.com/fox-it/BloodHound.py
  • SharpHound:https://github.com/BloodHoundAD/SharpHound
  • BloodHound:https://github.com/BloodHoundAD/BloodHound
  • BloodHound 文档:https://bloodhound.readthedocs.io/en/latest/index.html
  • GOAD:https://github.com/Orange-Cyberdefense/GOAD
  • ly4k BloodHound 版本:https://github.com/ly4k/BloodHound
  • Certipy:https://github.com/ly4k/Certipy
下载工具
工具环境对象数时间命令
SharpHound.exeWindows ~3500~51.605sMeasure-Command { sharphound.exe -d essos.local --ldapusername 'khal.drogo' --ldappassword 'horse' --domaincontroller '192.168.56.12' -c All }
BloodHound.pyLinux ~3500~9.657stime python3 bloodhound.py -u khal.drogo -p horse -d essos.local -ns 192.168.56.12 --zip -c all
RustHound.exeWindows ~3500~5.315sMeasure-Command { rusthound.exe -d essos.local -u [email protected] -p horse -z }
RustHoundLinux ~3500~3.166stime rusthound -d essos.local -u [email protected] -p horse -z
  • CA
    • 用户指定的 SAN
    • 请求处理