Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
c0c9505
Update README.md
martinsohn Feb 17, 2026
7b90296
Rename and align to 'All members of Operator groups'
martinsohn Feb 17, 2026
84f65cb
Fix mapping guid for "Enrollment rights on published certificate temp…
martinsohn Feb 17, 2026
028ffaa
Add initial PurpleKnight queries
martinsohn Feb 17, 2026
f1a55a8
Add 'Domains without Group Managed Service Accounts'
martinsohn Feb 17, 2026
6040b76
Create "Objects created in the last 10 days"
martinsohn Feb 17, 2026
06a781a
Create "AdminSDHolder with ACL inheritance enabled"
martinsohn Feb 18, 2026
da11fdb
Create "Non-Tier Zero principals with ownership of Domain Controllers"
martinsohn Feb 18, 2026
5bb4f4e
Enhance "Domains affected by AdPrep privilege escalation risk", adjus…
martinsohn Feb 18, 2026
7af9e6d
Add PK mapping "AD privileged users that are synced to AAD"
martinsohn Feb 18, 2026
c1123ae
Add PK mapping "Hybrid-synced privileged role accounts"
martinsohn Feb 18, 2026
80091eb
Removed duplicate query "Non-Tier Zero principals owners of Domain Co…
martinsohn Feb 18, 2026
cec1f6f
Create "Tier Zero Entra ID principals synchronized with AD"
martinsohn Feb 18, 2026
cb7180f
Add PK mapping for "AAD privileged users that are also privileged in AD"
martinsohn Feb 18, 2026
0ce4187
Create Non-Tier Zero Principals with ExecuteDCOM privileges on Domain…
martinsohn Feb 18, 2026
f6b44cd
Add PK mapping "Distributed COM Users group or Performance Log Users …
martinsohn Feb 18, 2026
a55ec75
Enhance mapping_scope_detail for non-tier zero queries
martinsohn Feb 18, 2026
1a30aac
Create PK map for "Dangerous control paths expose certificate contain…
martinsohn Feb 18, 2026
6a7c5e9
Add PK map "Forest contains more than 50 privileged accounts"
martinsohn Feb 18, 2026
2c67ae4
Add PK map "Dangerous control paths expose certificate templates"
martinsohn Feb 18, 2026
feb757f
Update Compromising permissions on ADCS nodes (ESC5).yml
martinsohn Feb 18, 2026
e5f5ae6
Create Principals with control of Entra ID SSO accounts.yml
martinsohn Feb 18, 2026
a0073f3
Added PK map "Accounts with Kerberos constrained delegation configure…
martinsohn Feb 18, 2026
cd8cef3
Update Principals with control of Entra ID SSO accounts.yml
martinsohn Feb 18, 2026
7c2e97e
Add "Principals with control of KRBTGT accounts" and PK mapping to "A…
martinsohn Feb 18, 2026
8ce2caf
fix json structure
martinsohn Feb 18, 2026
688b866
Create "Tier Zero objects created in the past 10 days" and PK mapping
martinsohn Feb 18, 2026
f3420cb
PK mapping "Protected Users group not in use"
martinsohn Feb 18, 2026
511639d
PK mapping "Privileged users that are disabled"
martinsohn Feb 18, 2026
57a9087
Create Principals with control of Domain Controllers.yml
martinsohn Feb 18, 2026
aec02c5
Added PK mappings
martinsohn Feb 18, 2026
08d4f46
Add PK mapping "Objects in privileged groups without adminCount=1 (SD…
martinsohn Feb 18, 2026
edb8023
PK map "Operator groups no longer protected by AdminSDHolder and SDProp"
martinsohn Feb 18, 2026
35095b2
PK map "Operator Groups that are not empty"
martinsohn Feb 18, 2026
555a187
Create Principals with write Shadow Credentials on Tier Zero principa…
martinsohn Feb 18, 2026
0bd4fd7
PK mappings
martinsohn Feb 18, 2026
5fff69b
PK map "SMB Signing is not required on Domain Controllers"
martinsohn Feb 18, 2026
7b6cd7e
PK map "Unprivileged principals as DNS Admins"
martinsohn Feb 18, 2026
09b50a4
Standardize scope detail
martinsohn Feb 18, 2026
7e1b317
Ensure all mapping_scope values align
martinsohn Feb 18, 2026
3ac10f4
Add PK map "Unprivileged users can add computer accounts to domain"
martinsohn Feb 18, 2026
94675b5
Map PK "Privileged objects with unprivileged owners".
martinsohn Feb 18, 2026
4838f83
Map PK "Well-known privileged SIDs in sIDHistory"
martinsohn Feb 18, 2026
876b709
Rename query
martinsohn Feb 18, 2026
9a9ddfa
Update Tier Zero principals not owned by Tier Zero.yml
martinsohn Feb 18, 2026
4d69082
fix some PK mapping scopes
martinsohn Feb 20, 2026
9868bca
Add query for computers with local administrator permissions over oth…
5tuk0v Mar 12, 2026
64536e8
align mapping type descriptions with those in json file
martinsohn Mar 16, 2026
980f15b
Map PK "gMSA objects with old passwords"
martinsohn Mar 16, 2026
b97019d
Map PK "Privileged accounts with a password that never expires"
martinsohn Mar 16, 2026
309a1ca
Map PK "Kerberoastable members of Tier Zero / High Value groups"
martinsohn Mar 16, 2026
face189
Map PK "Users with ServicePrincipalName defined"
martinsohn Mar 16, 2026
12351aa
correct PK names and IDs
martinsohn Mar 16, 2026
4b26a89
PK map "Computer Accounts in Privileged Groups"
martinsohn Mar 16, 2026
995ee3f
Map PK "RC4 or DES encryption type are supported by Domain Controllers"
martinsohn Mar 16, 2026
16398e1
Fix: Map "RC4 or DES encryption type are supported by Domain Controll…
martinsohn Mar 16, 2026
338dde9
Map "SSO computer account with password last set over 90 days ago"
martinsohn Mar 16, 2026
c4a3137
Map "Shadow Credentials on privileged objects"
martinsohn Mar 16, 2026
bbe2f6a
PK map "Non-privileged users with access to gMSA passwords"
martinsohn Mar 16, 2026
9b585ff
PK map "Primary users with SPN not supporting AES encryption on Kerbe…
martinsohn Mar 16, 2026
4f66642
fix: PK map "Privileged users with SPN defined"
martinsohn Mar 16, 2026
6072905
PK map "User accounts that use DES encryption"
martinsohn Mar 16, 2026
0e7d11f
Map PK "Users with Kerberos pre-authentication disabled"
martinsohn Mar 16, 2026
8378189
fix: PK map "Users with SPN defined"
martinsohn Mar 16, 2026
e11ba6f
Fix: PK map "krbtgt account with Resource-Based Constrained Delegatio…
martinsohn Mar 16, 2026
b4dfb66
Map PK "Global Administrators that signed in during the last 14 days"
martinsohn Mar 16, 2026
25090cf
Map PK "Guest accounts that were inactive for more than 30 days"
martinsohn Mar 16, 2026
36c39d8
Map PK "Less than 2 Global Administrators exist"
martinsohn Mar 16, 2026
4e137fe
Map PK "More than 5 Global Administrators exist"
martinsohn Mar 16, 2026
a8ef49a
Map PK "More than 10 Privileged Administrators exist"
martinsohn Mar 16, 2026
a854136
Map PK "Privileged accounts with mailbox"
martinsohn Mar 16, 2026
d875807
Map PK "Privileged group contains guest account"
martinsohn Mar 16, 2026
a0ab54d
Map PK "Suspicious Directory Synchronization Accounts role member"
martinsohn Mar 16, 2026
c5fb989
Map PK "Unprivileged owner of a privileged group"
martinsohn Mar 18, 2026
7ed423d
fix: PK "Suspicious Directory Synchronization Accounts role member"
martinsohn Mar 18, 2026
bd6f7ad
Update Enabled Entra ID guest users inactive for 30 days.yml
martinsohn Mar 18, 2026
3e4e678
PK map "Users or devices inactive for at least 90 days"
martinsohn Mar 18, 2026
c7c7353
Update security-assessment-mapping.json
martinsohn Mar 18, 2026
332958a
Update Tier Zero accounts that can be delegated.yml
martinsohn Mar 18, 2026
f49281e
Map PK
martinsohn Mar 18, 2026
1866455
added resource links
martinsohn Mar 18, 2026
8768c47
Create Enabled Entra Tier Zero principals inactive for 60 days.yml
martinsohn Mar 18, 2026
ca6533b
Add Nessus IDs
martinsohn Mar 18, 2026
242793e
Add PurpleKnight to assessment tool .md
martinsohn Mar 18, 2026
b2024a2
Map PK "GPO linking delegation at the domain level"
martinsohn Mar 18, 2026
a3f0252
Map PK "Changes to MS LAPS read permissions"
martinsohn Mar 18, 2026
33f007b
Update security-assessment-mapping.md
martinsohn Mar 18, 2026
843e558
Update Non-Tier Zero users that can read LAPS passwords.yml
martinsohn Mar 20, 2026
7f0ab0a
Update security-assessment-mapping.json
martinsohn Mar 20, 2026
50a9ce7
Update security-assessment-mapping.md
martinsohn Mar 20, 2026
c45d8e1
Add non-tier-zero shortest path queries to tier zero
chryzsh Mar 13, 2026
2c4c18d
Merge remote-tracking branch 'github-desktop-chryzsh/add-non-t0-short…
martinsohn Apr 4, 2026
9bf9ad8
add acknowledgement: crusher, @chryzsh
martinsohn Apr 4, 2026
b8e9eac
Merge branch 'pr-50' into so-con-updates
martinsohn Apr 4, 2026
5b07e85
Change match logic for "Finds computers with AdminTo edges over other…
martinsohn Apr 4, 2026
8255f78
Acknowlegements: Non-Tier Zero account with unconstrained delegation
martinsohn Apr 4, 2026
d53fca9
Add gMSA queries
martinsohn Apr 4, 2026
0923a89
Update Computers with local administrator permissions over other comp…
martinsohn Apr 10, 2026
9ebff06
REAME: Deprecation Notice: `system_tags` Queries
martinsohn Apr 12, 2026
9ee1cb0
Update Computers with non-default Primary Group membership.yml
martinsohn Apr 12, 2026
bc1d526
bump missing revisions
martinsohn Apr 12, 2026
0da2cea
rename file to match internal name
martinsohn Apr 12, 2026
8828ec7
Create Tier Zero OU containing Non-Tier Zero principals.yml
martinsohn Apr 13, 2026
d0e3021
Create Azure groups nested more than 3 levels.yml
martinsohn Apr 13, 2026
225747e
Create AD Groups nested more than 3 levels.yml
martinsohn Apr 13, 2026
6a3dcda
Create No break-glass test using built-in domain Administrator accoun…
martinsohn Apr 13, 2026
f08f86c
Update Domains where any user can join a computer to the domain.yml
martinsohn Apr 14, 2026
cf9ff22
Rename to: Non-Tier Zero principals with access to enabled gMSA passw…
martinsohn Apr 14, 2026
b45be62
Sync filenames with name fields
martinsohn Apr 14, 2026
48a92ff
Update Non-Tier Zero principals with access to enabled gMSA passwords…
martinsohn Apr 15, 2026
47c9763
Fix syntax checks
martinsohn Apr 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
.env
.vscode
test-report.md
/resources
/.claude

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
39 changes: 31 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</p>


# BloodHound Query Library
# BloodHound Query Library

The BloodHound Query Library is a community-driven collection of [Cypher queries](https://support.bloodhoundenterprise.io/hc/en-us/articles/16721164740251) designed to help [BloodHound Community Edition](https://github.com/SpecterOps/BloodHound) and [BloodHound Enterprise](https://specterops.io/bloodhound-overview/) users to unlock the full potential of the flexible BloodHound platform by creating an open query ecosystem.

Expand All @@ -33,7 +33,25 @@ For an introduction to the project, please read our blog post:

- [Introducing the BloodHound Query Library](https://specterops.io/blog/2025/06/17/introducing-the-bloodhound-query-library/)

# Overview
## Deprecation Notice: `system_tags` Queries

Queries in the library currently use two methods to scope nodes to Tier Zero and Owned, supporting both old and new versions of BloodHound. At the end of July 2026, all queries will be updated to use the newer simpler method.

Old versions require scoping with a node property and null handling:

```cypher
WHERE COALESCE(n.system_tags, '') CONTAINS 'admin_tier_0'
```

New versions can use node labels directly:

```cypher
WHERE (n:Tag_Tier_Zero)
```

The simpler label-based approach was introduced with [Privilege Zones](https://specterops.io/privilege-zones/), which became generally available in [v2026.03.23](https://bloodhound.specterops.io/resources/release-notes/2026-03-23). Upgrade your BloodHound version to ensure queries from the library continue to work.

## Overview

The library contains queries that demonstrate BloodHound's versatility beyond traditional attack path analysis. This includes:
- All existing pre-built queries from BloodHound
Expand All @@ -42,7 +60,7 @@ The library contains queries that demonstrate BloodHound's versatility beyond tr
- Community contributed queries (see [Contributing](#contributing))
- Novel queries to further showcase BloodHound's security assessment capabilities (see [security-assessment-mapping.md](/docs/security-assessment-mapping.md))

Individual query files are stored in stored [/queries](/queries/) as `.yml` and are automatically combined into a single Queries.json/Queries.zip as part of our [releases](https://github.com/SpecterOps/BloodHoundQueryLibrary/releases).
Individual query files are stored in [/queries](/queries/) as `.yml` and are automatically combined into a single Queries.json/Queries.zip as part of our [releases](https://github.com/SpecterOps/BloodHoundQueryLibrary/releases).

The query files use the YAML structure found in [query-structure.yml](/docs/query-structure.yml), for example:

Expand All @@ -67,6 +85,12 @@ acknowledgements: Martin Sohn Christensen, @martinsohndk

Whenever new queries are added, the syntax is automatically validated, ensuring that only syntactically compatible queries are added.

## Security Assessment Mapping

BloodHound queries in this library have been mapped to controls from common security assessment tools, demonstrating how BloodHound can validate findings typically associated with dedicated tools like PingCastle, Microsoft Defender for Identity, and Tenable Nessus.

For full coverage details and mapping structure, see [security-assessment-mapping.md](/docs/security-assessment-mapping.md).

## Learning Cypher Queries

One of BloodHound’s key features is its flexibility through Cypher queries – a query language to search the BloodHound graph database.
Expand All @@ -78,7 +102,7 @@ The library gives you practical examples for learning Cypher and can be combined
- [openCypher resources](https://opencypher.org/resources/)
- [Neo4j Cypher Cheat Sheet](https://neo4j.com/docs/cypher-cheat-sheet/current/lists/)

You can also learn with the communty by joining the #cypher_queries channel in the [BloodHound community Slack](https://support.bloodhoundenterprise.io/hc/en-us/articles/16730536907547).
You can also learn with the community by joining the #cypher_queries channel in the [BloodHound community Slack](https://support.bloodhoundenterprise.io/hc/en-us/articles/16730536907547).

## BloodHound Operator usage example

Expand All @@ -95,9 +119,8 @@ Example: Run a query in BloodHound:
```powershell
$queries[0] | BHInvoke
```
```


```powershell
Name : Tier Zero / High Value external Entra ID users
Query : MATCH (n:AZUser)
WHERE ((n:Tag_Tier_Zero) OR COALESCE(n.system_tags, '') CONTAINS 'admin_tier_0')
Expand Down Expand Up @@ -145,7 +168,7 @@ $queries | % {

The BloodHound Query Library's success depends on community participation. BloodHound users who have developed useful queries are encouraged to contribute them to the library.

Before comitting, please ensure that:
Before committing, please ensure that:
- The query follows the [YAML query structure](docs/query-structure.yml).
- The query is compatible with the [latest BloodHound CE version](https://github.com/SpecterOps/BloodHound)
- The query passess all automated CI/CD tests
- The query passes all automated CI/CD tests
Loading
Loading