BloodHound CE Python

raw JSON →
1.9.1 verified Mon Apr 27 auth: no python

Python-based ingestor for BloodHound Community Edition. Version 1.9.1 provides a CLI tool to collect Active Directory data (users, groups, computers, ACLs, sessions, etc.) and upload it to a BloodHound CE server. Release cadence is irregular with infrequent updates.

pip install bloodhound-ce
error ModuleNotFoundError: No module named 'bloodhound'
cause Installed 'bloodhound-ce' but tried to import 'bloodhound-ce' directly.
fix
Use 'import bloodhound' (no hyphen).
error AttributeError: module 'bloodhound' has no attribute 'ad'
cause Old import pattern from legacy version.
fix
Use correct import: from bloodhound.ad.domain import BloodHound
error bloodhound-python: command not found
cause pip install did not put the script in PATH (common on Windows or virtualenv not activated).
fix
Run 'python -m bloodhound' instead, or ensure the Scripts directory is in PATH.
breaking The package name on PyPI is 'bloodhound-ce' (with hyphen), but the importable module is 'bloodhound' (without hyphen). Using pip install bloodhound-ce is correct, but 'import bloodhound-ce' is syntax error.
fix Use 'import bloodhound' (no hyphen) after installing bloodhound-ce.
gotcha The CLI command 'bloodhound-python' is the canonical entry point. Not 'bloodhound-ce' or 'bloodhound'.
fix Run 'bloodhound-python --help' to see available commands.
deprecated The old 'bloodhound' package (original BloodHound ingestor) is no longer maintained. Users should migrate to 'bloodhound-ce'.
fix Uninstall old package: pip uninstall bloodhound; then install bloodhound-ce.

Basic usage: connect to a domain controller, retrieve domain info and list computers.

from bloodhound.ad.domain import ADDomain

domain = ADDomain(
    username='DOMAIN\\user',
    password='secret',
    domain='domain.local',
    dc='dc01.domain.local'
)
print(domain.name)
print(domain.sid)
for comp in domain.computers():
    print(comp['samaccountname'])