run_blooodhound_query
Execute BloodHound Cypher queries to analyze Active Directory attack paths and identify security vulnerabilities during penetration testing.
Instructions
Run a bloodhound cypher query of your choice (use this to collect information about the network and potentially identify attack vectors)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes |
Implementation Reference
- src/pentestmcp/server.py:362-362 (registration)Registration of the tool using the @mcp.tool decorator.@mcp.tool(name="run_blooodhound_query",description="Run a bloodhound cypher query of your choice (use this to collect information about the network and potentially identify attack vectors)")
- src/pentestmcp/server.py:363-364 (handler)The tool handler function, which calls into the bloodhound module to execute the query.def run_bloodhound_query(query): return bloodhound.run_cypher_query(query)
- src/pentestmcp/bloodhound.py:179-189 (helper)Core helper function that authenticates with BloodHound CE API using HMAC-signed requests and executes the Cypher query via POST to /api/v2/graphs/cypher.def run_cypher_query(query): credentials = Credentials( token_id=config.BHE_TOKEN_ID, token_key=config.BHE_TOKEN_KEY, ) client = Client(scheme=BHE_SCHEME, host=config.BHE_DOMAIN, port=config.BHE_PORT, credentials=credentials) payload={"query":query} data=json.dumps(payload).encode('utf-8') response=client._request("POST","/api/v2/graphs/cypher",body=data,content_type="application/json") return response.json()