description stringlengths 11 117 | query stringlengths 18 577 | source stringclasses 22
values | schema stringclasses 1
value | id int64 0 300 | query_length int64 18 577 | description_length int64 11 117 | complexity_score int64 0 5 | query_type stringclasses 2
values | entities sequencelengths 0 3 |
|---|---|---|---|---|---|---|---|---|---|
The name of every computer in the database where at least one SPN for the computer contains the string 'MSSQL' | MATCH (c:Computer) WHERE ANY (x IN c.serviceprincipalnames WHERE toUpper(x) CONTAINS 'MSSQL') RETURN c | https://raw.githubusercontent.com/ZephrFish/Bloodhound-CustomQueries/refs/heads/main/customqueries.json | ## Node Labels and Properties:
- ADLocalGroup: admincount, description, distinguishedname, domain, domainsid, isaclprotected, lastcollected, lastseen, name, objectid, ownersid, samaccountname, system_tags, whencreated
- ADLocalUser
- AIACA: basicconstraintpathlength, certchain, certname, certthumbprint, crosscertificat... | 0 | 102 | 110 | 0 | read | [
"Computer"
] |
All (shortest) paths from Domain Users to High‑Value targets | MATCH (g:Group) WHERE g.name STARTS WITH 'DOMAIN USERS' MATCH (n {highvalue:true}), p = shortestPath((g)-[r*1..]->(n)) RETURN p | https://gist.github.com/seajaysec/a4d4a545047a51053d52cba567f78a9b | ## Node Labels and Properties:
- ADLocalGroup: admincount, description, distinguishedname, domain, domainsid, isaclprotected, lastcollected, lastseen, name, objectid, ownersid, samaccountname, system_tags, whencreated
- ADLocalUser
- AIACA: basicconstraintpathlength, certchain, certname, certthumbprint, crosscertificat... | 1 | 127 | 60 | 2 | read | [
"Group"
] |
All Computers without LAPS - with session | MATCH p = (d:Domain)-[r:Contains*1..]->(c:Computer)-[:HasSession]->(y) WHERE c.haslaps = false RETURN p | https://raw.githubusercontent.com/ZephrFish/Bloodhound-CustomQueries/refs/heads/main/customqueries.json | ## Node Labels and Properties:
- ADLocalGroup: admincount, description, distinguishedname, domain, domainsid, isaclprotected, lastcollected, lastseen, name, objectid, ownersid, samaccountname, system_tags, whencreated
- ADLocalUser
- AIACA: basicconstraintpathlength, certchain, certname, certthumbprint, crosscertificat... | 2 | 103 | 41 | 0 | read | [
"Computer",
"Domain"
] |
All computers without LAPS and the computer is enabled | MATCH p = (d:Domain)-[r:Contains*1..]->(c:Computer) WHERE c.haslaps = false AND c.enabled = true RETURN p | https://raw.githubusercontent.com/ZephrFish/Bloodhound-CustomQueries/refs/heads/main/customqueries.json | ## Node Labels and Properties:
- ADLocalGroup: admincount, description, distinguishedname, domain, domainsid, isaclprotected, lastcollected, lastseen, name, objectid, ownersid, samaccountname, system_tags, whencreated
- ADLocalUser
- AIACA: basicconstraintpathlength, certchain, certname, certthumbprint, crosscertificat... | 3 | 105 | 54 | 0 | read | [
"Computer",
"Domain"
] |
All enabled computers with a description | MATCH p = (d:Domain)-[r:Contains*1..]->(c:Computer) WHERE c.description =~ '(?i).*.*' RETURN p | https://raw.githubusercontent.com/ZephrFish/Bloodhound-CustomQueries/refs/heads/main/customqueries.json | ## Node Labels and Properties:
- ADLocalGroup: admincount, description, distinguishedname, domain, domainsid, isaclprotected, lastcollected, lastseen, name, objectid, ownersid, samaccountname, system_tags, whencreated
- ADLocalUser
- AIACA: basicconstraintpathlength, certchain, certname, certthumbprint, crosscertificat... | 4 | 94 | 40 | 0 | read | [
"Computer",
"Domain"
] |
All enabled computers with a description containing the word file | MATCH p = (d:Domain)-[r:Contains*1..]->(c:Computer) WHERE c.description =~ '(?i).*file.*' RETURN p | https://raw.githubusercontent.com/ZephrFish/Bloodhound-CustomQueries/refs/heads/main/customqueries.json | ## Node Labels and Properties:
- ADLocalGroup: admincount, description, distinguishedname, domain, domainsid, isaclprotected, lastcollected, lastseen, name, objectid, ownersid, samaccountname, system_tags, whencreated
- ADLocalUser
- AIACA: basicconstraintpathlength, certchain, certname, certthumbprint, crosscertificat... | 5 | 98 | 65 | 0 | read | [
"Computer",
"Domain"
] |
All Kerberoastable Users | MATCH (n {hasspn: true}) RETURN n | https://raw.githubusercontent.com/ZephrFish/Bloodhound-CustomQueries/refs/heads/main/customqueries.json | ## Node Labels and Properties:
- ADLocalGroup: admincount, description, distinguishedname, domain, domainsid, isaclprotected, lastcollected, lastseen, name, objectid, ownersid, samaccountname, system_tags, whencreated
- ADLocalUser
- AIACA: basicconstraintpathlength, certchain, certname, certthumbprint, crosscertificat... | 6 | 33 | 24 | 0 | read | [] |
All Owned Nodes | MATCH (n {owned: true}) RETURN n | https://raw.githubusercontent.com/ZephrFish/Bloodhound-CustomQueries/refs/heads/main/customqueries.json | ## Node Labels and Properties:
- ADLocalGroup: admincount, description, distinguishedname, domain, domainsid, isaclprotected, lastcollected, lastseen, name, objectid, ownersid, samaccountname, system_tags, whencreated
- ADLocalUser
- AIACA: basicconstraintpathlength, certchain, certname, certthumbprint, crosscertificat... | 7 | 32 | 15 | 0 | read | [] |
All Users with a homedirectory | MATCH p = (d:Domain)-[r:Contains*1..]->(u:User) WHERE u.homedirectory =~ '(?i).*.*' RETURN p | https://raw.githubusercontent.com/ZephrFish/Bloodhound-CustomQueries/refs/heads/main/customqueries.json | ## Node Labels and Properties:
- ADLocalGroup: admincount, description, distinguishedname, domain, domainsid, isaclprotected, lastcollected, lastseen, name, objectid, ownersid, samaccountname, system_tags, whencreated
- ADLocalUser
- AIACA: basicconstraintpathlength, certchain, certname, certthumbprint, crosscertificat... | 8 | 92 | 30 | 0 | read | [
"User",
"Domain"
] |
Can a user from one domain affect *any* computer in another domain (VERY heavy) | MATCH (n:User {domain: {result}}) MATCH (m:Computer {domain: {}}) MATCH p=allShortestPaths((n)-[r:MemberOf|HasSession|AdminTo|AllExtendedRights|AddMember|ForceChangePassword|GenericAll|GenericWrite|Owns|WriteDacl|WriteOwner|CanRDP|ExecuteDCOM|AllowedToDelegate|ReadLAPSPassword|Contains|GpLink|AddAllowedToAct|AllowedToA... | https://gist.github.com/seajaysec/a4d4a545047a51053d52cba567f78a9b | ## Node Labels and Properties:
- ADLocalGroup: admincount, description, distinguishedname, domain, domainsid, isaclprotected, lastcollected, lastseen, name, objectid, ownersid, samaccountname, system_tags, whencreated
- ADLocalUser
- AIACA: basicconstraintpathlength, certchain, certname, certthumbprint, crosscertificat... | 9 | 351 | 79 | 1 | read | [
"User",
"Computer"
] |
Computers with administrative Domain Users | MATCH p=(m:Group)-[r:AddMember|AdminTo|AllExtendedRights|AllowedToDelegate|CanRDP|Contains|ExecuteDCOM|ForceChangePassword|GenericAll|GenericWrite|GetChanges|GetChangesAll|HasSession|Owns|ReadLAPSPassword|SQLAdmin|TrustedBy|WriteDacl|WriteOwner|AddAllowedToAct|AllowedToAct]->(t) WHERE m.objectid ENDS WITH '-513' OR m.o... | https://raw.githubusercontent.com/ZephrFish/Bloodhound-CustomQueries/refs/heads/main/customqueries.json | ## Node Labels and Properties:
- ADLocalGroup: admincount, description, distinguishedname, domain, domainsid, isaclprotected, lastcollected, lastseen, name, objectid, ownersid, samaccountname, system_tags, whencreated
- ADLocalUser
- AIACA: basicconstraintpathlength, certchain, certname, certthumbprint, crosscertificat... | 10 | 422 | 42 | 1 | read | [
"Group"
] |
Constrained Delegation systems | MATCH p=(u)-[:AllowedToDelegate]->(c) RETURN p | https://raw.githubusercontent.com/ZephrFish/Bloodhound-CustomQueries/refs/heads/main/customqueries.json | ## Node Labels and Properties:
- ADLocalGroup: admincount, description, distinguishedname, domain, domainsid, isaclprotected, lastcollected, lastseen, name, objectid, ownersid, samaccountname, system_tags, whencreated
- ADLocalUser
- AIACA: basicconstraintpathlength, certchain, certname, certthumbprint, crosscertificat... | 11 | 46 | 30 | 0 | read | [] |
Count the LAPS status of all computers | MATCH (c:Computer) RETURN c.haslaps, COUNT(*) | https://redfoxsec.com/blog/bloodhound-cheat-sheet | ## Node Labels and Properties:
- ADLocalGroup: admincount, description, distinguishedname, domain, domainsid, isaclprotected, lastcollected, lastseen, name, objectid, ownersid, samaccountname, system_tags, whencreated
- ADLocalUser
- AIACA: basicconstraintpathlength, certchain, certname, certthumbprint, crosscertificat... | 12 | 45 | 38 | 1 | read | [
"Computer"
] |
Custom privileged groups that are **not** built‑in and not marked high‑value | MATCH (g:Group {admincount:true, highvalue:false, domain: $result}) WHERE NOT (g.objectid =~ $domain_admins OR g.objectid =~ $enterprise_admins OR g.objectid =~ $administrators OR g.objectid =~ $account_operators OR g.objectid CONTAINS $replicators OR g.objectid =~ $key_admins OR g.objectid =~ $read_only_domain_control... | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/refs/heads/main/queries/privileged.json | ## Node Labels and Properties:
- ADLocalGroup: admincount, description, distinguishedname, domain, domainsid, isaclprotected, lastcollected, lastseen, name, objectid, ownersid, samaccountname, system_tags, whencreated
- ADLocalUser
- AIACA: basicconstraintpathlength, certchain, certname, certthumbprint, crosscertificat... | 13 | 406 | 76 | 0 | read | [
"Group"
] |
All active Domain Admin sessions | MATCH (n:User)-[:MemberOf]->(g:Group) WHERE g.objectid ENDS WITH '-512' MATCH p = (c:Computer)-[:HasSession]->(n) return p | https://raw.githubusercontent.com/ZephrFish/Bloodhound-CustomQueries/refs/heads/main/customqueries.json | ## Node Labels and Properties:
- ADLocalGroup: admincount, description, distinguishedname, domain, domainsid, isaclprotected, lastcollected, lastseen, name, objectid, ownersid, samaccountname, system_tags, whencreated
- ADLocalUser
- AIACA: basicconstraintpathlength, certchain, certname, certthumbprint, crosscertificat... | 14 | 122 | 32 | 1 | read | [
"User",
"Computer",
"Group"
] |
All AS-REP-roastable users | MATCH (u:User {dontreqpreauth: true}) RETURN u.name | https://redfoxsec.com/blog/bloodhound-cheat-sheet | ## Node Labels and Properties:
- ADLocalGroup: admincount, description, distinguishedname, domain, domainsid, isaclprotected, lastcollected, lastseen, name, objectid, ownersid, samaccountname, system_tags, whencreated
- ADLocalUser
- AIACA: basicconstraintpathlength, certchain, certname, certthumbprint, crosscertificat... | 15 | 51 | 26 | 0 | read | [
"User"
] |
HoundBench Cypher Queries Dataset
Dataset Description
This dataset contains 180 curated Cypher queries specifically designed for BloodHound, the popular Active Directory reconnaissance tool. Each entry pairs a natural language description with its corresponding Cypher query, train and eval your agents for BloodHound query generation :D.
Dataset Summary
- Total Examples: 180 query-description pairs
- Language: English (descriptions), Cypher (queries)
- Domain: Cybersecurity, Active Directory analysis, Graph databases
- Use Cases: Query generation, cybersecurity education, BloodHound automation
Supported Tasks
- Text-to-Code Generation: Generate Cypher queries from natural language descriptions
- Query Understanding: Understand the intent behind cybersecurity queries
- Educational Resource: Learn BloodHound query patterns and techniques
Dataset Structure
Data Instances
Each example contains:
{
"description": "Find all users with an SPN (Kerberoastable users)",
"query": "MATCH (n:User) WHERE n.hasspn=true RETURN n",
"source": "https://hausec.com/2019/09/09/bloodhound-cypher-cheatsheet/"
}
Data Fields
description(string): Natural language description of what the query accomplishesquery(string): The corresponding Cypher query for BloodHound/Neo4jsource(string): Attribution to the original source (URL, author, or publication)
Data Splits
The dataset is provided as a single collection. Users can create custom splits using the provided utilities:
from datasets import load_dataset
from utils.dataset_utils import split_dataset
dataset = load_dataset("joshtmerrill/HoundBench")
train_set, test_set = split_dataset(dataset, train_ratio=0.8)
Additional Information
Dataset Curators
This dataset was curated as part of the HoundBench project, a comprehensive toolkit for evaluating and validating Cypher queries against BloodHound instances.
Queries were curated from open and closed sources.
Licensing Information
This dataset is released under the MIT License. While the dataset itself is freely available, users should respect the original sources and their respective licenses.
Citation Information
If you use this dataset in your research, please cite:
@dataset{houndbench,
title={HoundBench: Benchmarking offensive agents},
author={Josh Merrill},
year={2025},
url={https://huggingface.co/datasets/joshtmerrill/HoundBench},
}
Contributions
We welcome contributions to improve and expand this dataset. Please see our contribution guidelines for more information.
Usage Examples
Loading the Dataset
from datasets import load_dataset
# Load the full dataset
dataset = load_dataset("joshtmerrill/bloodhound-cypher-queries")
# Load with custom split
train_dataset = load_dataset("joshtmerrill/bloodhound-cypher-queries", split="train[:80%]")
test_dataset = load_dataset("joshtmerrill/bloodhound-cypher-queries", split="train[80%:]")
Basic Usage
# Iterate through examples
for example in dataset:
print(f"Description: {example['description']}")
print(f"Query: {example['query']}")
print(f"Source: {example['source']}")
print("---")
Integration with HoundBench
from utils.dataset_utils import load_queries_dataset, split_dataset
# Load using HoundBench utilities
dataset = load_queries_dataset("joshtmerrill/bloodhound-cypher-queries")
# Create train/test split
train_set, test_set = split_dataset(dataset, train_ratio=0.8, random_seed=42)
# Filter by source
hausec_queries = filter_dataset_by_source(dataset, ["hausec.com"])
Query Generation Example
from transformers import pipeline
# Load a text generation model
generator = pipeline("text-generation", model="your-model")
# Generate query from description
description = "Find all Domain Admins with active sessions"
prompt = f"Description: {description}\nQuery:"
result = generator(prompt, max_length=100)
print(result[0]['generated_text'])
- Downloads last month
- 3