Skip to main content

CLI for querying BloodHound (Neo4j) data without using the GUI.

Project description

bloodhound-cli

bloodhound-cli is a Python command-line tool designed to query and manage data from a BloodHound database running on Neo4j. It enables you to enumerate ACLs, computers, and users (including filtering by attributes like password not required or password never expires) in an Active Directory environment ingested by BloodHound.

Key Features

  1. Configuration Management

    • Save your Neo4j connection details (host, port, user, and password) to a local configuration file (~/.bloodhound_config) using the set subcommand.
    • The configuration file is stored with restricted permissions (chmod 600) to protect your sensitive credentials.
  2. ACL Queries (acl subcommand)

    • 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.
  3. Computer Queries (computer subcommand)

    • Enumerate computers within a specified domain (-d).
    • Optionally save results to a file (-o).
    • Filter by LAPS status (--laps True/False).
  4. User Queries (user subcommand)

    • 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 with passwordnotreqd enabled.
      • --password-never-expires: Show only users with pwdneverexpires enabled.
  5. Secure Credential Storage

    • The set subcommand saves your Neo4j credentials in a local file (~/.bloodhound_config) which is excluded from source control and has strict file permissions.

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

  1. Set Neo4j Configuration
    Before using any other subcommand, run:

    bloodhound-cli set --host <neo4j_host> --port <neo4j_port> --db-user <neo4j_user> --db-password <neo4j_password>
    

    This will create/update a configuration file at ~/.bloodhound_config.

  2. 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
      
  3. 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
      
  4. 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
      

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bloodhound_cli-0.1.20.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bloodhound_cli-0.1.20-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file bloodhound_cli-0.1.20.tar.gz.

File metadata

  • Download URL: bloodhound_cli-0.1.20.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.22

File hashes

Hashes for bloodhound_cli-0.1.20.tar.gz
Algorithm Hash digest
SHA256 f3b6e37a1a5a915a7ab740a7257cb1e989c2f461592beef657ca62b70b340423
MD5 d7cbc0a95e358cdcf76984370cbc1dc7
BLAKE2b-256 668260d491046769e9ed4055b12ecb802e57966f7cdca525ed961be32a35e6c8

See more details on using hashes here.

File details

Details for the file bloodhound_cli-0.1.20-py3-none-any.whl.

File metadata

File hashes

Hashes for bloodhound_cli-0.1.20-py3-none-any.whl
Algorithm Hash digest
SHA256 d3ab46f684d04ef1bbd9aa84213ff5e85349f01f0e6b55d25e744994b1a7f74c
MD5 a023b6f05dc4dcc4053848e0da9e5a0b
BLAKE2b-256 252cef32a3f753ff6377e25b4b46d6875fa05b217085425b4a3cf21aa9149211

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page