CLI for querying BloodHound data (Legacy Neo4j + CE skeleton).
Project description
bloodhound-cli
bloodhound-cli is a Python command-line tool designed to query and manage data from BloodHound.
- Legacy (Neo4j-backed) is fully supported.
- Community Edition (CE) is introduced with a pluggable client skeleton so behavior can be incrementally implemented without breaking legacy users.
CE support note: This CLI now includes an early CE client. Many CE features are placeholders. If you need the official SpecterOps CE installer CLI, see their project at
https://github.com/specterOps/bloodHound-cli.
Key Features
-
Configuration Management
- Save your Neo4j connection details (host, port, user, and password) to a local configuration file (
~/.bloodhound_config) using thesetsubcommand. - The configuration file is stored with restricted permissions (
chmod 600) to protect your sensitive credentials.
- Save your Neo4j connection details (host, port, user, and password) to a local configuration file (
-
ACL Queries (
aclsubcommand)- Enumerate ACLs related to a single user by specifying
-u/--user. - Enumerate cross-domain ACLs for a domain by specifying
-d/--domain. - Optionally exclude multiple domains with
-bd/--blacklist-domains.
- Enumerate ACLs related to a single user by specifying
-
Computer Queries (
computersubcommand)- Enumerate computers within a specified domain (
-d). - Optionally save results to a file (
-o). - Filter by LAPS status (
--laps True/False).
- Enumerate computers within a specified domain (
-
User Queries (
usersubcommand)- Enumerate users within a specified domain (
-d). - Optionally save results to a file (
-o). - Use mutually exclusive filters to target specific user attributes:
--admin-count: Show only privileged (admin) users.--high-value: Show only high-value users.--password-not-required: Show only users withpasswordnotreqdenabled.--password-never-expires: Show only users withpwdneverexpiresenabled.
- Enumerate users within a specified domain (
-
Session and Access Queries
- Query sessions and access path relations in a domain (legacy).
-
Debug and Verbose Output
- Global flags
--debugand--verboseenhance output. When available, output is formatted withrich.
- Global flags
-
Secure Credential Storage
- The
setsubcommand saves your Neo4j credentials in a local file (~/.bloodhound_config) which is excluded from source control and has strict file permissions.
- The
Installation
It is recommended to install bloodhound-cli using pipx to ensure it runs in an isolated environment. You can install it from PyPI:
pipx install bloodhound-cli
Alternatively, you can use pip:
pip install bloodhound-cli
Usage
-
Set Neo4j (Legacy) Configuration
bloodhound-cli set --host <neo4j_host> --port <neo4j_port> --db-user <neo4j_user> --db-password <neo4j_password>
-
Set CE Configuration (optional, early support)
(Removed) Use the auth subcommand passing --base-url and credentials instead.
-
Authenticate to CE (generate and store token)
bloodhound-cli --edition ce auth --url http://localhost:7474 --username <user> # It will prompt for the password securely # Optional flags: # --password <pass> # --login-path /api/v2/login # --insecure
-
Run in a chosen edition
-
The default edition can be persisted in
~/.bloodhound_configunder[GENERAL] edition. Runningsetwill storelegacy; runningauthwill storece. -
To target CE explicitly:
bloodhound-cli --edition ce user --domain mydomain.local
- Or via env var:
BLOODHOUND_EDITION=ce bloodhound-cli user --domain mydomain.local
-
-
Upload collector artifacts to CE (v2 file-upload flow)
bloodhound-cli --edition ce upload \ -f data1.zip data2.json \ --start-path /api/v2/file-upload/start \ --upload-path /api/v2/file-upload/{job_id} \ --end-path /api/v2/file-upload/{job_id}/end # Optional flags: # --content-type application/zip|application/json (auto-detected if omitted) # --insecure
-
Enumerate ACLs
-
For a single user:
bloodhound-cli acl --user myuser
-
For cross-domain:
bloodhound-cli acl --domain mydomain.local
-
Exclude multiple domains:
bloodhound-cli acl --domain mydomain.local -bd EXCLUDED1 EXCLUDED2
-
-
Enumerate Computers
-
All computers in a domain:
bloodhound-cli computer --domain mydomain.local
-
Filter by LAPS and save results:
bloodhound-cli computer --domain mydomain.local --laps True -o computers_with_laps.txt
-
-
Enumerate Users
-
List all users in a domain:
bloodhound-cli user --domain mydomain.local
-
List privileged (admin) users:
bloodhound-cli user --domain mydomain.local --admin-count
-
List high-value users:
bloodhound-cli user --domain mydomain.local --high-value
-
List users with password not required:
bloodhound-cli user --domain mydomain.local --password-not-required
-
List users with password never expires:
bloodhound-cli user --domain mydomain.local --password-never-expires
-
Save user query results:
bloodhound-cli user --domain mydomain.local --admin-count -o admin_users.txt
-
Edition Support Details
--edition legacy(default): full feature set (Neo4j backend).--edition ce: CE client with support forauth(/api/v2/login) yupload(flow de file-upload v2). El resto de comandos imprimirán un mensaje hasta estar conectados a CE.
Changelog
-
1.0.0
- Major release with stable API
- Remove automatic version bumping workflow
- Manual version control for better release management
- Enhanced CE support and authentication flow
- Improved CLI structure and user experience
-
0.2.0
- Add
--editionand--verboseglobal flags - Add CE configuration
set-ceand CE client skeleton - Add CE
auth(JWT via/api/v2/login) andupload(file-upload/start,/{job_id},/{job_id}/end) - Integrate
richfor debug/verbose output - Dependencies: add
requests,rich
- Add
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bloodhound_cli-1.0.0.tar.gz.
File metadata
- Download URL: bloodhound_cli-1.0.0.tar.gz
- Upload date:
- Size: 20.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b0a10689b5df68ffb2a231ea784e90f6377e3dad5f6ccc656175b2282ec980d
|
|
| MD5 |
137cba1f00fdef0dfd55d1317cdb1ce3
|
|
| BLAKE2b-256 |
eb9ccb2167fcbab952edf0605550fd7cfe0fdd4b9b03be0d77cb60ca5c3d09fe
|
File details
Details for the file bloodhound_cli-1.0.0-py3-none-any.whl.
File metadata
- Download URL: bloodhound_cli-1.0.0-py3-none-any.whl
- Upload date:
- Size: 18.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0dc63601dae950fa1fd78b96294579033cf0a35a0d8ef155376ded9180aa758c
|
|
| MD5 |
43e216f34ce80e20c192187a4b618be2
|
|
| BLAKE2b-256 |
56abe90a1d2280ec5ef702a5fbb0e9c32d20eade06ff9f92799f6e75633dc634
|