RustHound
Summary
Limitations
Not all SharpHound features are implemented yet. Please refer to the roadmap for more information.
Description
RustHound is a cross-platform BloodHound collector tool, written in Rust. (Linux,Windows,MacOS)
No anti-virus detection and cross-compiled.
RustHound generate users,groups,computers,ous,gpos,containers,domains json files to analyze it with BloodHound application.
💡 If you can use SharpHound.exe, use it. Rusthound is a backup solution if SharpHound.exe is detected by AV or if SharpHound.exe isn't executable from the system where you have access to.
Usage
How to compile it?
You need to install rust in your system (Windows/Linux/MacOS).
https://www.rust-lang.org/fr/tools/install
RustHound support Kerberos/GSSAPI but this means that it needs Clang and its development libraries, as well as the Kerberos development libraries. On Debian/Ubuntu, that means clang-N, libclang-N-dev and libkrb5-dev.
For example:
#Debian/Ubuntu
Here is how to compile the "release" and "debug" versions from "cargo" command.
#or debug version
The result can be found in "target/release" or in "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
Linux x86_64 static version
#Install rustup and cargo in Linux
|
#Add Linux deps
#Static compilation for Linux
CFLAGS="-lrt";LDFLAGS="-lrt";RUSTFLAGS='-C target-feature=+crt-static';
The result can be found in "target/x86_64-unknown-linux-gnu/release" folder.
Windows static version from Linux
#Install rustup and cargo in Linux
|
#Add Windows deps
#Static compilation for Windows
RUSTFLAGS="-C target-feature=+crt-static"
The result can be found in "target/x86_64-pc-windows-gnu/release" folder.
How to build documentation?
Demo
Example are done on the GOADv2 implemented by mayfly:
# Linux with username:password
# Linux with username:password and ldaps
# Linux with username:password and ldaps and custom port
# Linux with username:password and ldaps and fqdn resolver module
# Linux with username:password and ldaps and fqdn resolver module and tcp dns request and custom name server
# Tips to redirect and append both standard output and standard error to a file > /tmp/rh_output 2>&1
# Windows with GSSAPI session
You can find the custom queries used in the demo, in the resource folder.
Use the following command to install it:
🚥 Roadmap
Authentification
- ldap (389)
- ldaps (636)
-
BIND
-
NTLM
-
GSSAPI
for Windows ok but not tested for Linux
Outputs
- users.json
- groups.json
- computers.json
- ous.json
- gpos.json
- containers.json
- domains.json
- args and function to zip json files --zip
Modules
- Retreive LAPS password if your user can read them automatic
- Resolve FQDN computers found to IP address --fqdn-resolver
- Retrieve certificates for ESC exploitation with Certipy --enum-certificates
- Kerberos attack module (ASREPROASTING,KERBEROASTING) --attack-kerberos
- Retrieve datas from trusted domains --follow-trust (Currently working on it, got beta version of this module)
Bloodhound v4.2
-
Parsing Features
-
Properties:sidhistory
not tested!-
HasSIDHistory
-
-
ChildOus
-
Direct_Members
-
GPlink
-
haslaps
-
AllowedToDelegate
-
AllowedToAct
-
Sessions
- List users with RPC
-
DcomUsers
-
RemoteDesktopUsers
-
LocalAdmins
-
PSRemoteUsers
-
-
ACL
- Add
ReadGMSAPassword
support
- Add
-
All
- Change json header like "users" to "data"
-
Properties
:domainsid
-
Properties
:whencreated
-
IsACLProtected
-
IsDeleted
-
Users
- Add default
NT AUTHORITY
:DOMAIN.LOCAL-S-1-5-20
user -
Properties
:unixpassword
-
Properties
:unicodepassword
-
Properties
:sfupassword
-
Properties
:trustedtoauth
-
Properties:sidhistory
not tested!-
HasSIDHistory
-
-
Properties
:samaccountname
-
Properties
:logonscript
- Add default
-
Domains
- Change
ChildOus
toChildObjects
- Add the
ObjectIdentifier
andObjectType
for allChildObjects
- Add the
-
Properties
:highvalue
-
GPOChanges
-
LocalAdmins
-
RemoteDesktopUsers
-
DcomUsers
-
PSRemoteUsers
-
AffectedComputers
-
-
Trusts
-
TargetDomainSid
-
TargetDomainName
-
IsTransitive
-
SidFilteringEnabled
-
TrustDirection
-
TrustType
-
- Change
-
OUs
-
ChildObjects
-
GPOChanges
-
LocalAdmins
-
RemoteDesktopUsers
-
DcomUsers
-
PSRemoteUsers
-
AffectedComputers
-
-
-
Containers
- Make function to create containers.json
- Values
-
ChildObjects
- Add the
ObjectIdentifier
andObjectType
for allChildObjects
- Add the
-
ObjectIdentifier
-
IsDeleted
-
IsACLProtected
-
Aces
-
Properties
:domain
-
Properties
:domainsid
-
Properties
:name
-
Properties
:distinguishedname
-
-
Computers
-
Properties
:samaccountname
-
Optimization
- Log level (info,debug,trace)
- Error management (working on it)
- add_childobjects_members() ChildObject function in checker/bh_41.rs:217
- replace_guid_gplink() gplinks function in checker/bh_41.rs:302
:link: Links
- Blog post: 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 docs: https://bloodhound.readthedocs.io/en/latest/index.html
- GOADv2: https://github.com/Orange-Cyberdefense/GOAD