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 listlengths 0 3 |
|---|---|---|---|---|---|---|---|---|---|
Unsupported operating systems | MATCH (H:Computer) WHERE H.operatingsystem =~ '.*(2000|2003|2008|xp|vista|7|me).*' RETURN H | https://hausec.com/2019/09/09/bloodhound-cypher-cheatsheet | ## 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... | 100 | 91 | 29 | 0 | read | [
"Computer"
] |
Users created in the last 30 days | MATCH (u:User) where u.enabled=true and u.whencreated > (datetime().epochseconds - (30 * 86400)) RETURN u | 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... | 101 | 105 | 33 | 1 | modification | [
"User"
] |
Users that belong to high value groups | match (u1:User) WHERE u1.plaintext=True MATCH p=(u1:User)-[r:MemberOf*1..]->(m:Group {highvalue:true}) RETURN u1 | 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... | 102 | 112 | 38 | 0 | read | [
"User",
"Group"
] |
Users that can RDP into something | match (u1:User) WHERE u1.plaintext=True MATCH p1=(u1)-[:CanRDP*1..]->(c:Computer) RETURN u1 | 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... | 103 | 91 | 33 | 0 | read | [
"User",
"Computer"
] |
Users that don't require Kerberos pre-authentication (AS-REP Roasting) | MATCH (u:User {dontreqpreauth: true}) RETURN u | https://hausec.com/2019/09/09/bloodhound-cypher-cheatsheet | ## 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... | 104 | 46 | 70 | 0 | read | [
"User"
] |
Users that haven't logged on in 720 days and account is still active | MATCH (n:User) WHERE n.lastlogon < (datetime().epochseconds - (720 * 86400)) AND n.enabled=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... | 105 | 104 | 68 | 1 | read | [
"User"
] |
Users that logged in within the last 90 days | MATCH (u:User) WHERE u.lastlogon > (datetime().epochseconds - (90 * 86400)) AND NOT u.lastlogon IN [-1.0, 0.0] RETURN u | https://hausec.com/2019/09/09/bloodhound-cypher-cheatsheet | ## 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... | 106 | 119 | 44 | 1 | read | [
"User"
] |
Users with blank passwords that are enabled | MATCH (u:User) WHERE NOT u.userpassword IS null AND u.enabled = true RETURN u.name,u.userpassword | 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... | 107 | 97 | 43 | 0 | read | [
"User"
] |
Users with passwords last set within the last 90 days | MATCH (u:User) WHERE u.pwdlastset > (datetime().epochseconds - (90 * 86400)) AND NOT u.pwdlastset IN [-1.0, 0.0] RETURN u | https://hausec.com/2019/09/09/bloodhound-cypher-cheatsheet | ## 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... | 108 | 121 | 53 | 1 | modification | [
"User"
] |
Users with Temp in user title and created in the last 30 days | MATCH (u:User) where u.enabled=true and u.whencreated > (datetime().epochseconds - (30 * 86400)) AND u.title CONTAINS 'Temp' RETURN u | 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... | 109 | 133 | 61 | 1 | modification | [
"User"
] |
Users' credentials in description fields | MATCH (m:User) WHERE m.description CONTAINS 'password' RETURN m.name, m.description | 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... | 110 | 83 | 40 | 0 | read | [
"User"
] |
Users/Groups with direct access to GPOs | MATCH p = (n)-[r:AddMember|AddSelf|WriteSPN|AddKeyCredentialLink|AllExtendedRights|ForceChangePassword|GenericAll|GenericWrite|WriteDacl|WriteOwner|Owns]->(g:GPO) 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... | 111 | 171 | 39 | 0 | read | [
"GPO"
] |
What groups can RDP | MATCH p=(m:Group)-[r:CanRDP]->(n:Computer) 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... | 112 | 51 | 19 | 0 | read | [
"Computer",
"Group"
] |
Windows 7 and Enabled | MATCH (H:Computer) WHERE H.operatingsystem =~ '(?i).*(7).*' AND H.enabled = true RETURN H | 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... | 113 | 89 | 21 | 0 | read | [
"Computer"
] |
Windows 7 session | MATCH (H:Computer)-[:HasSession]->(y) WHERE H.operatingsystem =~ '(?i).*(7).*' RETURN H | 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... | 114 | 87 | 17 | 0 | read | [
"Computer"
] |
Windows XP and Enabled | MATCH (H:Computer) WHERE H.operatingsystem =~ '(?i).*(xp).*' AND H.enabled = true RETURN H | 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... | 115 | 90 | 22 | 0 | read | [
"Computer"
] |
Windows XP with session | MATCH (H:Computer)-[:HasSession]->(y) WHERE H.operatingsystem =~ '(?i).*(xp).*' RETURN H | 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... | 116 | 88 | 23 | 0 | read | [
"Computer"
] |
Workstations a user can RDP into | MATCH p=(g:Group)-[:CanRDP]->(c:Computer) WHERE g.objectid ENDS WITH '-513' AND NOT c.operatingsystem CONTAINS 'Server' RETURN p | https://hausec.com/2019/09/09/bloodhound-cypher-cheatsheet | ## 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... | 117 | 128 | 32 | 1 | read | [
"Computer",
"Group"
] |
A list of all OS versions containing 'Server' | MATCH (c:Computer) WHERE c.operatingsystem CONTAINS 'Server' RETURN DISTINCT c.operatingsystem | 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... | 118 | 94 | 45 | 0 | read | [
"Computer"
] |
A list of all OS versions with a count | MATCH (c:Computer) RETURN DISTINCT c.operatingsystem, COUNT(c.operatingsystem) | 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... | 119 | 78 | 38 | 1 | read | [
"Computer"
] |
Active sessions of Domain Admins | MATCH (u:User)-[:MemberOf*1..]->(g:Group) WHERE g.objectid ENDS WITH '-512' MATCH p = (c:Computer)-[:HasSession]->(u) RETURN c.name, 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... | 120 | 139 | 32 | 1 | read | [
"User",
"Computer",
"Group"
] |
All Domain Admins | MATCH (g:Group) WHERE g.name =~ '(?i).*DOMAIN ADMINS.*' WITH g MATCH (g)<-[r:MemberOf*1..]-(a) RETURN a.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... | 121 | 108 | 17 | 1 | read | [
"Group"
] |
All Windows 2008 computers and sort by last logon timestamp descending and human-readable | MATCH (c:Computer) WHERE c.operatingsystem CONTAINS '2008' RETURN c.name, c.operatingsystem, datetime({ epochSeconds: toInteger(c.lastlogon) }) AS rdate ORDER BY rdate DESC | 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... | 122 | 172 | 89 | 0 | read | [
"Computer"
] |
The local admins to all computers | MATCH p=(u:User)-[r:AdminTo]->(c:Computer) RETURN u.name, c.name ORDER BY 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... | 123 | 80 | 33 | 0 | read | [
"User",
"Computer"
] |
Groups of High Value Targets | MATCH p=(n:User)-[r:MemberOf*1..]->(m:Group {highvalue: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... | 124 | 70 | 28 | 0 | read | [
"User",
"Group"
] |
Groups with Computer and User Objects | MATCH (c:Computer)-[r:MemberOf*1..]->(groupsWithComps:Group) WITH groupsWithComps MATCH (u:User)-[r:MemberOf*1..]->(groupsWithComps) RETURN DISTINCT groupsWithComps as groupsWithCompsAndUsers | Community contribution by @joshtmerrill | ## 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... | 125 | 191 | 37 | 1 | read | [
"User",
"Computer",
"Group"
] |
Identify principals used for AD ↔ AAD directory sync | MATCH (u) WHERE (u:User OR u:AZUser) AND (u.name =~ '(?i)^MSOL_|.*AADConnect.*' OR u.userprincipalname =~ '(?i)^sync_.*') OPTIONAL MATCH (u)-[:HasSession]->(s:Session) RETURN u, s | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/refs/heads/main/queries/aad.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... | 126 | 179 | 52 | 1 | read | [
"User"
] |
Kerberoastable Admins | MATCH (n:Group) WHERE n.objectid ENDS WITH '-512' WITH n MATCH p=(n)<-[:MemberOf*1..]-(m {hasspn: true}) RETURN p | Community contribution by @joshtmerrill | ## 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... | 127 | 113 | 21 | 1 | read | [
"Group"
] |
All Certificate Templates (Certipy data required) | MATCH (n:GPO {type:'Certificate Template', domain: $result}) RETURN n | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/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... | 128 | 69 | 49 | 0 | read | [
"GPO"
] |
All domains | MATCH (d:Domain) RETURN d | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/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... | 129 | 25 | 11 | 0 | read | [
"Domain"
] |
All enabled Azure users | MATCH (u:AZUser {enabled:true}) RETURN u | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/refs/heads/main/queries/aad.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... | 130 | 40 | 23 | 0 | read | [] |
All GPOs in a domain | MATCH (g:GPO {domain: $result}) RETURN g | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/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... | 131 | 40 | 20 | 0 | read | [
"GPO"
] |
All groups in a domain | MATCH (g:Group {domain: $result}) RETURN g | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/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... | 132 | 42 | 22 | 0 | read | [
"Group"
] |
All High Valued Targets | MATCH (m) WHERE m.highvalue=true RETURN m | 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... | 133 | 41 | 23 | 0 | read | [] |
All owned & enabled users | MATCH (u:User {owned:true, enabled:true, domain: $result}) RETURN u | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/refs/heads/main/queries/owned.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... | 134 | 67 | 25 | 0 | read | [
"User"
] |
All owned computers | MATCH (m:Computer) WHERE m.owned=true RETURN m | 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... | 135 | 46 | 19 | 0 | read | [
"Computer"
] |
All owned computers in a selected domain | MATCH (c:Computer {owned:true, domain: $result}) RETURN c ORDER BY c.name | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/refs/heads/main/queries/owned.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... | 136 | 73 | 40 | 0 | read | [
"Computer"
] |
All owned groups | MATCH (m:Group) WHERE m.owned=true RETURN m | 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... | 137 | 43 | 16 | 0 | read | [
"Group"
] |
All owned users | MATCH (m:User) WHERE m.owned=true RETURN m | 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... | 138 | 42 | 15 | 0 | read | [
"User"
] |
All owned users in a selected domain | MATCH (u:User {owned:true, domain: $result}) RETURN u | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/refs/heads/main/queries/owned.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... | 139 | 53 | 36 | 0 | read | [
"User"
] |
All principals with "SQLAdmin" permission on computers | MATCH p=(a {domain: $result})-[:MemberOf|SQLAdmin*1..]->(c:Computer) RETURN p | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/refs/heads/main/queries/domain.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... | 140 | 77 | 54 | 0 | read | [
"Computer"
] |
All principals with Local-Admin permission | MATCH p=(a {domain: $result})-[:MemberOf|AdminTo*1..]->(c:Computer) RETURN p | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/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... | 141 | 76 | 42 | 0 | read | [
"Computer"
] |
All principals with RDP permission | MATCH p=(a {domain: $result})-[:MemberOf|CanRDP*1..]->(c:Computer) RETURN p | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/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... | 142 | 75 | 34 | 0 | read | [
"Computer"
] |
All Tenancy objects (AzureHound required) | MATCH (t:AZTenant) RETURN t | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/refs/heads/main/queries/aad.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... | 143 | 27 | 41 | 0 | read | [] |
All user sessions (sessions data required) | MATCH p=(u:User {domain: $result})<-[r:HasSession]-(c:Computer) RETURN p | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/refs/heads/main/queries/domain.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... | 144 | 72 | 42 | 0 | read | [
"User",
"Computer"
] |
Certificate Authority servers (Certipy data required) | MATCH (n:GPO {type:'Enrollment Service', domain: $result}) RETURN n | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/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... | 145 | 67 | 53 | 0 | read | [
"GPO"
] |
Computers WITHOUT LAPS | MATCH (c:Computer {haslaps:false, domain: $result}) RETURN c ORDER BY c.name | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/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... | 146 | 76 | 22 | 0 | read | [
"Computer"
] |
Domain computers | MATCH (c:Computer {domain: $result}) RETURN c | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/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... | 147 | 45 | 16 | 0 | read | [
"Computer"
] |
Domain controllers | MATCH (c:Computer {domain: $result})-[:MemberOf]->(g:Group) WHERE g.samaccountname CONTAINS 'Domain Controllers' RETURN c | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/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... | 148 | 121 | 18 | 0 | read | [
"Computer",
"Group"
] |
Domain trusts | MATCH p=(n:Domain)-->(m:Domain) RETURN p | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/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... | 149 | 40 | 13 | 0 | read | [
"Domain"
] |
Enabled principals with Constrained Delegation | MATCH (a {enabled: true, domain: $result}) WHERE exists(a.`allowedtodelegate`) RETURN a | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/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... | 150 | 87 | 46 | 0 | read | [] |
Enabled principals with Unconstrained Delegation | MATCH (a {unconstraineddelegation: true, enabled: true, domain: $result}) RETURN a | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/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... | 151 | 82 | 48 | 0 | read | [] |
Enabled users in a domain | MATCH (u:User {enabled:true, domain: $result}) RETURN u | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/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... | 152 | 55 | 25 | 0 | read | [
"User"
] |
Enabled users that don't require passwords | MATCH (u:User {passwordnotreqd:true, enabled:true, domain: $result}) RETURN u | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/refs/heads/main/queries/domain.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... | 153 | 77 | 42 | 0 | read | [
"User"
] |
Enabled users that have never logged in | MATCH (u:User {enabled:true, domain: $result}) WHERE u.lastlogontimestamp=-1.0 RETURN u | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/refs/heads/main/queries/domain.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... | 154 | 87 | 39 | 0 | read | [
"User"
] |
Enabled users that logged in within the last 90 days | MATCH (u:User {enabled:true, domain: $result}) WHERE u.lastlogon > (datetime().epochseconds - (90 * 86400)) AND NOT u.lastlogon IN [-1.0, 0.0] RETURN u | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/refs/heads/main/queries/domain.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... | 155 | 151 | 52 | 1 | read | [
"User"
] |
Enabled users that set a password within the last 90 days | MATCH (u:User {enabled:true, domain: $result}) WHERE u.pwdlastset > (datetime().epochseconds - (90 * 86400)) AND NOT u.pwdlastset IN [-1.0, 0.0] RETURN u | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/refs/heads/main/queries/domain.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... | 156 | 153 | 57 | 1 | modification | [
"User"
] |
Enabled users who are members of foreign domains' groups | MATCH p=(u:User {enabled:true, domain: $result})-[:MemberOf*1..]->(g:Group) WHERE NOT u.domain = g.domain RETURN p | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/refs/heads/main/queries/domain.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... | 157 | 114 | 56 | 0 | read | [
"User",
"Group"
] |
Enabled users whose password never expires | MATCH (u:User {pwdneverexpires:true, enabled:true, domain: $result}) RETURN u | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/refs/heads/main/queries/domain.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... | 158 | 77 | 42 | 0 | read | [
"User"
] |
Enabled users whose password never expires and hasn't changed in a year | MATCH (u:User {enabled:true, domain: $result}) WHERE u.pwdneverexpires=true AND u.pwdlastset < (datetime().epochseconds - (365 * 86400)) AND NOT u.pwdlastset IN [-1.0, 0.0] RETURN u | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/refs/heads/main/queries/domain.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... | 159 | 181 | 71 | 1 | modification | [
"User"
] |
Enabled users with a non-null userPassword attribute | MATCH (u:User {enabled:true, domain: $result}) WHERE u.userpassword IS NOT null RETURN u | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/refs/heads/main/queries/domain.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... | 160 | 88 | 52 | 0 | read | [
"User"
] |
Enabled users with an e-mail address | MATCH (u:User {enabled:true, domain: $result}) WHERE exists(u.email) RETURN u | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/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... | 161 | 77 | 36 | 0 | read | [
"User"
] |
High-value targets in a domain | MATCH (a {highvalue: true, domain: $result}) RETURN a | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/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... | 162 | 53 | 30 | 0 | read | [] |
Network shares (excluding SYSVOL) | MATCH (a {domain: $result}) WHERE (any(prop IN keys(a) WHERE a[prop] CONTAINS '\\' AND NOT a[prop] CONTAINS 'SYSVOL')) RETURN a | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/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... | 163 | 127 | 33 | 0 | read | [] |
Non-managed service accounts (Kerberoastable SVC accounts) | MATCH (u:User {hasspn:true, domain: $result}) WHERE NOT u.name CONTAINS '$' AND NOT u.name CONTAINS 'KRBTGT' RETURN u | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/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... | 164 | 117 | 58 | 0 | read | [
"User"
] |
Non-privileged users with most dangerous permissions | MATCH (u:User {enabled: true, admincount: false, domain: $result})-[r]->(a) RETURN u, COUNT(DISTINCT type(r)) AS permissions ORDER BY permissions DESC LIMIT 10 | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/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... | 165 | 159 | 52 | 1 | read | [
"User"
] |
The groups of all owned users | MATCH (m:User) WHERE m.owned=true WITH m MATCH p=(m)-[:MemberOf*1..]->(n:Group) 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... | 166 | 88 | 29 | 1 | read | [
"User",
"Group"
] |
Users whose description field is populated | MATCH (u:User {domain: $result}) WHERE u.description IS NOT null RETURN u | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/refs/heads/main/queries/domain.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... | 167 | 73 | 42 | 0 | read | [
"User"
] |
Locate enabled accounts with display name of admin - put anyname in you like | MATCH p = (d:Domain)-[r:Contains*1..]->(u:User) WHERE u.displayname =~ '(?i).*admin*' AND u.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... | 168 | 115 | 76 | 0 | read | [
"User",
"Domain"
] |
Most exploitable paths from owned objects to High Value Targets (5 hops) | MATCH p=allShortestPaths((n {owned:true})-[:MemberOf|AdminTo|AllExtendedRights|AddMember|ForceChangePassword|GenericAll|GenericWrite|Owns|WriteDacl|WriteOwner|ExecuteDCOM|AllowedToDelegate|ReadLAPSPassword|Contains|GpLink|AddAllowedToAct|AllowedToAct|SQLAdmin|ReadGMSAPassword|HasSIDHistory*1..5]->(m {highvalue:true})) ... | 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... | 169 | 342 | 72 | 1 | read | [] |
Most exploitable shortest‑paths to Domain Admins | MATCH (n:User),(m:Group {name:{result}}), p = shortestPath((n)-[r:MemberOf|AdminTo|AllExtendedRights|AddMember|ForceChangePassword|GenericAll|GenericWrite|Owns|WriteDacl|WriteOwner|ExecuteDCOM|AllowedToDelegate|ReadLAPSPassword|Contains|GpLink|AddAllowedToAct|AllowedToAct|SQLAdmin*1..]->(m)) 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... | 170 | 301 | 48 | 1 | read | [
"User",
"Group"
] |
Next steps (3 hops) from owned objects | MATCH p=shortestPath((c {owned: true})-[*1..3]->(s)) WHERE NOT c = s 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... | 171 | 77 | 38 | 1 | read | [] |
Next steps (5 hops) from owned objects | MATCH p=shortestPath((c {owned: true})-[*1..5]->(s)) WHERE NOT c = s 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... | 172 | 77 | 38 | 1 | read | [] |
Non Admin Groups with High Value Privileges | MATCH p=(g:Group)-[r:Owns|WriteDacl|GenericAll|WriteOwner|ExecuteDCOM|GenericWrite|AllowedToDelegate|ForceChangePassword]->(n:Computer) WHERE NOT g.name CONTAINS 'ADMIN' 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... | 173 | 178 | 43 | 0 | read | [
"Computer",
"Group"
] |
Owned groups that grant access to network shares | MATCH p=(u:User {owned:true, domain: $result})-[:MemberOf*1..]->(g:Group) WHERE any(prop IN keys(g) WHERE g[prop] CONTAINS '\\') RETURN p | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/refs/heads/main/queries/owned.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... | 174 | 137 | 48 | 0 | read | [
"User",
"Group"
] |
Owned principals → Azure Apps → Service Principals with dangerous rights | MATCH p=(n {enabled:true, owned:true, domain: $result})-[:AZOwns]->(azapp:AZApp)-[r1]->(azsp:AZServicePrincipal)-[r:AZGlobalAdmin|AZPrivilegedRoleAdmin*1..]->(azt:AZTenant) RETURN p | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/refs/heads/main/queries/owned.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... | 175 | 181 | 72 | 0 | read | [] |
Owned users whose group memberships grant privileged Azure‑tenant access | MATCH p=(n {owned:true, enabled:true, domain: $result})-[:MemberOf*1..]->(g:Group)-[r:AZGlobalAdmin|AZPrivilegedRoleAdmin*1..]->(:AZTenant) RETURN p | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/refs/heads/main/queries/owned.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... | 176 | 148 | 72 | 0 | read | [
"Group"
] |
Owned users with direct privileged access to an Azure tenancy | MATCH p=(n {owned:true, enabled:true, domain: $result})-[r:MemberOf|AZGlobalAdmin|AZPrivilegedRoleAdmin*1..]->(:AZTenant) RETURN p | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/refs/heads/main/queries/owned.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... | 177 | 130 | 61 | 0 | read | [] |
Owned users with permissions against GPOs | MATCH p=(u:User {owned:true})-[r:AllExtendedRights|GenericAll|GenericWrite|Owns|WriteDacl|WriteOwner|GpLink*1..]->(g:GPO) 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... | 178 | 130 | 41 | 0 | read | [
"User",
"GPO"
] |
Owned + enabled users that have an e‑mail address | MATCH (u:User {owned:true, enabled:true, domain: $result}) WHERE exists(u.email) RETURN u | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/refs/heads/main/queries/owned.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... | 179 | 89 | 49 | 0 | read | [
"User"
] |
Owned + enabled users with Local‑Admin rights, active sessions and their groups | MATCH p=(u:User {owned:true, enabled:true, domain: $result})-[:MemberOf|AdminTo*1..]->(c:Computer) OPTIONAL MATCH p2=(c)-[:HasSession]->(u2:User) OPTIONAL MATCH p3=(u2:User)-[:MemberOf*1..]->(:Group) RETURN p, p2, p3 | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/refs/heads/main/queries/owned.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... | 180 | 216 | 79 | 1 | read | [
"User",
"Computer",
"Group"
] |
Owned + enabled users with RDP rights, active sessions and their groups | MATCH p=(u:User {owned:true, enabled:true, domain: $result})-[:MemberOf|CanRDP*1..]->(c:Computer) OPTIONAL MATCH p2=(c)-[:HasSession]->(u2:User) OPTIONAL MATCH p3=(u2:User)-[:MemberOf*1..]->(:Group) RETURN p, p2, p3 | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/refs/heads/main/queries/owned.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... | 181 | 215 | 71 | 1 | read | [
"User",
"Computer",
"Group"
] |
Owned + enabled users with SQLAdmin rights | MATCH p=(u:User {owned:true, enabled:true, domain: $result})-[:MemberOf|SQLAdmin*1..]->(c:Computer) RETURN p | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/refs/heads/main/queries/owned.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... | 182 | 108 | 42 | 0 | read | [
"User",
"Computer"
] |
Paths from Domain Users to Domain Admins **excluding RDP** | MATCH (n:User),(m:Group {name:{result}}), p = shortestPath((n)-[r:MemberOf|HasSession|AdminTo|AllExtendedRights|AddMember|ForceChangePassword|GenericAll|GenericWrite|Owns|WriteDacl|WriteOwner|ExecuteDCOM|AllowedToDelegate|ReadLAPSPassword|Contains|GpLink|AddAllowedToAct|AllowedToAct|SQLAdmin*1..]->(m)) 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... | 183 | 312 | 58 | 1 | read | [
"User",
"Group"
] |
Privileged users who are **not** members of the “Protected Users” group (selected domain) | MATCH (u:User {admincount:true, domain: $result}), (u)-[:MemberOf*1..]->(g) WHERE g.name CONTAINS 'Protected Users' WITH COLLECT(u) AS protectedUsers MATCH (u2:User {admincount:true, domain: $result}) WHERE NOT u2 IN protectedUsers RETURN u2 | 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... | 184 | 241 | 89 | 2 | read | [
"User"
] |
All Azure AD Groups that are synchronized with On-Premise AD | MATCH (n:Group) WHERE n.objectid CONTAINS 'S-1-5' AND n.azsyncid IS NOT NULL 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... | 185 | 85 | 60 | 0 | read | [
"Group"
] |
All Azure Admins and their owned Devices | MATCH p=(d:AZDevice)<-[r1:AZOwns]->(m:AZUser)<-[r2:AZHasRole]->(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... | 186 | 75 | 40 | 0 | read | [] |
All Azure Users and their Admin Roles | MATCH p=(n)-[:AZHasRole|AZMemberOf*1..]->(:AZRole) 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... | 187 | 59 | 37 | 0 | read | [] |
All Azure Users that are part of the 'Global Administrator' Role | MATCH p =(n)-[r:AZGlobalAdmin*1..]->(m) 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... | 188 | 48 | 64 | 0 | read | [] |
All On-Prem users with edges to Azure | MATCH p=(m:User)-[r:AZResetPassword|AZOwns|AZUserAccessAdministrator|AZContributor|AZAddMembers|AZGlobalAdmin|AZVMContributor|AZOwnsAZAvereContributor]->(n) WHERE m.objectid CONTAINS 'S-1-5-21' 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... | 189 | 202 | 37 | 0 | modification | [
"User"
] |
GUEST Azure Users and their Groups | MATCH p=(m:AZUser)-[r:AZMemberOf*1..]->(n) WHERE NOT m.objectid CONTAINS 'S-1-5' AND m.userprincipalname=~ '(?i).*#EXT#.*' 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... | 190 | 131 | 34 | 0 | read | [] |
Users with a variant of "password" in their password and a path to high value targets (limit to 25 results) | match (u1:User) WHERE u1.plaintextpassword =~ "(.*[pP][aA@][sS$][sS$][wW][oO0][rR][dD].*)" MATCH p=shortestPath((u1:User)-[*1..]->(n {highvalue:true})) WHERE u1<>n return u1 LIMIT 25 | 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... | 191 | 182 | 107 | 1 | read | [
"User"
] |
Users with a variant of "password" in their password and are high value targets | MATCH (u1:User) WHERE u1.plaintextpassword =~ "(.*[pP][aA@][sS$][sS$][wW][oO0][rR][dD].*)" MATCH p=(u1:User)-[r:MemberOf*1..]->(m:Group {highvalue:true}) RETURN u1 | 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... | 192 | 163 | 79 | 0 | read | [
"User",
"Group"
] |
Users with a variant of "password" in their password and have local admin on at least one computer | match (u1:User) WHERE u1.plaintextpassword =~ "(.*[pP][aA@][sS$][sS$][wW][oO0][rR][dD].*)" match p=(u1:User)-[r:AdminTo]->(n:Computer) 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... | 193 | 143 | 98 | 0 | read | [
"User",
"Computer"
] |
Users with seasons in their password and a path to high value targets (limit to 25 results) | match (u1:User) WHERE u1.plaintextpassword =~ "([Ww]inter.*|[sS]pring.*|[sS]ummer.*|[fF]all.*)" MATCH p=shortestPath((u1:User)-[*1..]->(n {highvalue:true})) WHERE u1<>n return u1 LIMIT 25 | 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... | 194 | 187 | 91 | 1 | read | [
"User"
] |
Users with seasons in their password and are high value targets | MATCH (u1:User) WHERE u1.plaintextpassword =~ "([Ww]inter.*|[sS]pring.*|[sS]ummer.*|[fF]all.*)" MATCH p=(u1:User)-[r:MemberOf*1..]->(m:Group {highvalue:true}) RETURN u1 | 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... | 195 | 168 | 63 | 0 | read | [
"User",
"Group"
] |
Users with seasons in their password and have local admin on at least one computer | match (u1:User) WHERE u1.plaintextpassword =~ "([Ww]inter.*|[sS]pring.*|[sS]ummer.*|[fF]all.*)" match p=(u1:User)-[r:AdminTo]->(n:Computer) 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... | 196 | 148 | 82 | 0 | read | [
"User",
"Computer"
] |
Route all group memberships of owned + enabled users | MATCH p=(u:User {owned:true, enabled:true, domain: $result})-[:MemberOf*1..]->(g:Group) RETURN p | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/refs/heads/main/queries/owned.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... | 197 | 96 | 52 | 0 | read | [
"User",
"Group"
] |
Route all sessions of owned users to computers | MATCH p=(u:User {owned:true, domain: $result})<-[r:HasSession]-(c:Computer) RETURN p ORDER BY c.name | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/refs/heads/main/queries/owned.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... | 198 | 100 | 46 | 0 | read | [
"User",
"Computer"
] |
Route owned‑user sessions to computers without LAPS | MATCH p=(u:User {owned:true, domain: $result})<-[r:HasSession]-(c:Computer {haslaps:false}) RETURN p ORDER BY c.name | https://raw.githubusercontent.com/InfamousSYN/bloodhound-queries/refs/heads/main/queries/owned.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... | 199 | 116 | 51 | 0 | read | [
"User",
"Computer"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.