Active Directory data ingestor for BloodHound Legacy written in Rust.
Active Directory data ingestor for BloodHound Legacy written in Rust.
This version is only compatible with BloodHound Legacy 4.x
Version compatible with BloodHound Community Edition (CE) can be found here RustHound-CE.
Not all SharpHound features have been implemented. Some exist in RustHound and not in SharpHound or BloodHound-Python. Please refer to the roadmap for more information.
RustHound is a cross-platform BloodHound collector tool written in Rust, making it compatible with Linux, Windows, and macOS.
No AV detection and cross-compiled.
RustHound generates users, groups, computers, OUs, GPOs, containers, and domain JSON files that can be analyzed with BloodHound.
If you can use SharpHound, use it. Use RustHound as a backup solution if SharpHound is detected by AV or if it not compatible with your OS.
You can use the make command to install RustHound or to compile it for Linux or Windows.
make install
rusthound -hMore command in the Makefile:
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_depsUse RustHound with Docker to make sure to have all dependencies.
docker build --rm -t rusthound .
# Then
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 macosYou will need to install Rust on your system.
https://www.rust-lang.org/fr/tools/install
RustHound supports Kerberos and GSSAPI. Therefore, it requires Clang and its development libraries, as well as the Kerberos development libraries. On Debian and Ubuntu, this means clang-N, libclang-N-dev, and libkrb5-dev.
For example:
# 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-64Here is how to compile the "release" and "debug" versions using the cargo command.
git clone https://github.com/OPENCYBER-FR/RustHound
cd RustHound
cargo build --release
# or debug version
cargo bThe result can be found in the target/release or target/debug folder.
Below you can find the compilation methodology for each of the OS from Linux. If you need another compilation system, please consult the list in this link: https://doc.rust-lang.org/nightly/rustc/platform-support.html
# Install rustup and Cargo for Linux
curl https://sh.rustup.rs -sSf | sh
# Add Linux deps
rustup install stable-x86_64-unknown-linux-gnu
rustup target add x86_64-unknown-linux-gnu
# Static compilation for 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-gnuThe result can be found in the target/x86_64-unknown-linux-gnu/release folder.
# Install rustup and Cargo in Linux
curl https://sh.rustup.rs -sSf | sh
# Add Windows deps
rustup install stable-x86_64-pc-windows-gnu
rustup target add x86_64-pc-windows-gnu
# Static compilation for 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-gnuThe result can be found in the target/x86_64-pc-windows-gnu/release folder.
Amazing documentation: https://wapl.es/rust/2019/02/17/rust-cross-compile-linux-to-macos.html
…The result can be found in the target/x86_64-apple-darwin/release folder.
To obtain an optimized compilation of RustHound add the following compilation parameters at the end of the
Cargo.tomlfile.
[profile.release]
opt-level = "z"
lto = true
strip = true
codegen-units = 1
panic = "abort"The size of the binary will be considerably minimized. Basic cargo compiler commands can be used.
make windowsMore information here
git clone https://github.com/OPENCYBER-FR/RustHound
cd RustHound
cargo doc --open --no-deps…Examples are done on the GOADv2 implemented by mayfly:
……Example using @ly4k BloodHound version.
…You can find the custom queries used in the demo in the resource folder.
Use the following command to install it:
cp resources/customqueries.json ~/.config/bloodhound/customqueries.jsonIn order to make statistics on a DC with more LDAP objects, run the BadBlood on the domain controller ESSOS.local from GOAD. The DC should now have around 3500 objects. Below is the average time it takes to run the following tools:
| Tool | Environment | Objects | Time | Command |
|---|---|---|---|---|
| SharpHound.exe | Windows | ~3500 | ~51.605s | Measure-Command { sharphound.exe -d essos.local --ldapusername 'khal.drogo' --ldappassword 'horse' --domaincontroller '192.168.56.12' -c All } |
| BloodHound.py | Linux | ~3500 | ~9.657s | time python3 bloodhound.py -u khal.drogo -p horse -d essos.local -ns 192.168.56.12 --zip -c all |
| RustHound.exe | Windows | ~3500 | ~5.315s | Measure-Command { rusthound.exe -d essos.local -u [email protected] -p horse -z } |
| RustHound | Linux | ~3500 | ~3.166s | time rusthound -d essos.local -u [email protected] -p horse -z |
BINDNTLMKerberosParsing Features
HasSIDHistoryProperties : sfupasswordDCERPC (dependencies)
SessionsLocalAdminsRemoteDesktopUsersDcomUsersPSRemoteUsersUser Specified SANRequest DispositionNo open issues yet, or sync has not completed.