Loading repository data…
Loading repository data…
2spentest / repository
A Python script for importing custom Cypher queries into BloodHound Community Edition (CE)
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
A Python script for importing custom Cypher queries into BloodHound Community Edition (CE). This tool allows you to easily import queries from various sources including GitHub repositories, local files, and direct JSON URLs.
git clone https://github.com/yourusername/bloodhound-query-importer.git
cd bloodhound-query-importer
pip install -r requirements.txt
python bloodhound_client.py --token-id "YOUR_TOKEN_ID" --token-key "YOUR_TOKEN_KEY" --url "YOUR_BLOODHOUND_URL"
python bloodhound_client.py --token-id "YOUR_TOKEN_ID" --token-key "YOUR_TOKEN_KEY" --url "YOUR_BLOODHOUND_URL" --json-url "https://raw.githubusercontent.com/CompassSecurity/bloodhoundce-resources/main/customqueries.json"
python bloodhound_client.py --token-id "YOUR_TOKEN_ID" --token-key "YOUR_TOKEN_KEY" --url "YOUR_BLOODHOUND_URL" --github "https://github.com/CompassSecurity/bloodhoundce-resources" --branch "main" --path "customqueries"
python bloodhound_client.py --token-id "YOUR_TOKEN_ID" --token-key "YOUR_TOKEN_KEY" --url "YOUR_BLOODHOUND_URL" --file "path/to/your/queries.json"
To adjust the delay between requests (default: 0.5 seconds):
python bloodhound_client.py --token-id "YOUR_TOKEN_ID" --token-key "YOUR_TOKEN_KEY" --url "YOUR_BLOODHOUND_URL" --rate-limit 1.0
| Argument | Description | Default |
|---|---|---|
--url | BloodHound instance URL | http://localhost:8080 |
--token-id | BloodHound API token ID | (required) |
--token-key | BloodHound API token key | (required) |
--json-url | URL to JSON file containing queries | |
--github | GitHub repository URL | |
--file | Local file path | |
--branch | GitHub branch name | main |
--path | Path within repository or directory | |
--rate-limit | Delay between requests in seconds | 0.5 |
{
"queries": [
{
"name": "Query Group Name",
"category": "Category Name",
"queryList": [
{
"final": true,
"query": "MATCH (n) RETURN n"
}
]
}
]
}
[
{
"name": "Query Name",
"query": "MATCH (n) RETURN n",
"description": "Query Description"
}
]
The script includes comprehensive error handling:
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.