
Conducting Internal Reconnaissance With Bloodhound Ce
- 136 installs
- 27.3k repo stars
- Updated August 2, 2026
- mukul975/anthropic-cybersecurity-skills
Helps with ai & agent building tasks.
About
conducting-internal-reconnaissance-with-bloodhound-ce is a Claude Code skill in the AI & Agent Building category.
- conducting-internal-reconnaissance-with-bloodhound-ce
- AI & Agent Building
- AI-coding skill
Conducting Internal Reconnaissance With Bloodhound Ce by the numbers
- 136 all-time installs (skills.sh)
- +7 installs in the week ending Aug 4, 2026 (Skillselion tracking)
- Ranked #3,546 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/mukul975/anthropic-cybersecurity-skills --skill conducting-internal-reconnaissance-with-bloodhound-ceAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 136 |
|---|---|
| repo stars | ★ 27.3k |
| Last updated | August 2, 2026 |
| Repository | mukul975/anthropic-cybersecurity-skills ↗ |
What it does
Helps with ai & agent building tasks.
Files
Conducting Internal Reconnaissance with BloodHound CE
Legal Notice: This skill is for authorized security testing and educational purposes only. Unauthorized use against systems you do not own or have written permission to test is illegal and may violate computer fraud laws.
Overview
BloodHound Community Edition (CE) is a modern, web-based Active Directory reconnaissance platform developed by SpecterOps that uses graph theory to reveal hidden relationships and attack paths within AD environments. Unlike the legacy BloodHound application, BloodHound CE uses a PostgreSQL backend with a dedicated graph database, providing improved performance, a modern web UI, and enhanced API capabilities. Red teams use BloodHound CE to collect AD objects, ACLs, sessions, group memberships, and trust relationships, then visualize attack paths from compromised low-privileged accounts to high-value targets like Domain Admins. The SharpHound collector (v2 for CE) gathers data from Active Directory, while AzureHound collects from Azure AD / Entra ID environments.
When to Use
- When conducting security assessments that involve conducting internal reconnaissance with bloodhound ce
- When following incident response procedures for related security events
- When performing scheduled security testing or auditing activities
- When validating security controls through hands-on testing
Prerequisites
- Familiarity with red teaming concepts and tools
- Access to a test or lab environment for safe execution
- Python 3.8+ with required dependencies installed
- Appropriate authorization for any testing activities
Objectives
- Deploy BloodHound CE server using Docker Compose
- Collect AD data using SharpHound v2 or BloodHound.py
- Import collected data into BloodHound CE for graph analysis
- Identify shortest attack paths from owned principals to Domain Admins
- Discover ACL-based attack paths, Kerberoastable accounts, and delegation abuse
- Execute custom Cypher queries for advanced attack path analysis
- Generate attack path reports for engagement documentation
MITRE ATT&CK Mapping
- T1087.002 - Account Discovery: Domain Account
- T1069.002 - Permission Groups Discovery: Domain Groups
- T1482 - Domain Trust Discovery
- T1615 - Group Policy Discovery
- T1018 - Remote System Discovery
- T1033 - System Owner/User Discovery
- T1016 - System Network Configuration Discovery
Workflow
Phase 1: BloodHound CE Deployment
1. Deploy BloodHound CE using Docker Compose:
curl -L https://ghst.ly/getbhce -o docker-compose.yml
docker compose pull
docker compose up -d2. Access the web interface at https://localhost:8080 3. Log in with the default admin credentials (displayed in Docker logs):
docker compose logs | grep "Initial Password"4. Change the default admin password immediately
Phase 2: Data Collection with SharpHound v2
1. Transfer SharpHound v2 to the compromised Windows host:
# Execute full collection
.\SharpHound.exe -c All --outputdirectory C:\Temp
# DCOnly collection (LDAP only, stealthier)
.\SharpHound.exe -c DCOnly
# Session collection for logged-on user mapping
.\SharpHound.exe -c Session --loop --loopduration 02:00:00
# Collect from specific domain
.\SharpHound.exe -c All -d child.domain.local2. Alternative: Use BloodHound.py from Linux:
bloodhound-python -u user -p 'Password123' -d domain.local -ns 10.10.10.1 -c All3. Exfiltrate the generated ZIP file to the analysis workstation
Phase 3: Data Import and Initial Analysis
1. Upload collected data via the BloodHound CE web interface (File Ingest) 2. Mark compromised accounts as "Owned" in the interface 3. Run built-in analysis queries:
- Shortest Path to Domain Admin
- Kerberoastable Users with Path to DA
- AS-REP Roastable Users
- Users with DCSync Rights
- Computers with Unconstrained Delegation
Phase 4: Custom Cypher Queries
1. Execute custom Cypher queries in the BloodHound CE search bar:
// Find shortest path from owned principals to Domain Admins
MATCH p=shortestPath((n {owned:true})-[*1..]->(m:Group {name:"DOMAIN ADMINS@DOMAIN.LOCAL"}))
RETURN p
// Find Kerberoastable users with path to DA
MATCH (u:User {hasspn:true})
MATCH p=shortestPath((u)-[*1..]->(g:Group {name:"DOMAIN ADMINS@DOMAIN.LOCAL"}))
RETURN p
// Find computers with sessions of DA members
MATCH (c:Computer)-[:HasSession]->(u:User)-[:MemberOf*1..]->(g:Group {name:"DOMAIN ADMINS@DOMAIN.LOCAL"})
RETURN c.name, u.name
// Find ACL-based attack paths (GenericAll, WriteDACL, GenericWrite)
MATCH p=(u:User)-[:GenericAll|GenericWrite|WriteDacl|WriteOwner|ForceChangePassword*1..]->(t)
WHERE u.owned = true
RETURN p
// Find users who can DCSync
MATCH (u)-[:MemberOf*0..]->()-[:DCSync|GetChanges|GetChangesAll*1..]->(d:Domain)
RETURN u.name, d.name
// Find computers with LAPS but readable by non-admins
MATCH (c:Computer {haslaps:true})
MATCH p=(u:User)-[:ReadLAPSPassword]->(c)
RETURN pPhase 5: Attack Path Prioritization
1. Score identified attack paths by:
- Number of hops (shorter = higher priority)
- Stealth requirements (avoid noisy techniques)
- Tool availability for each hop
- Likelihood of detection at each step
2. Create an execution plan for the highest-priority paths 3. Identify required tools for each step in the chain 4. Plan OPSEC considerations for each technique
Tools and Resources
| Tool | Purpose | Platform |
|---|---|---|
| BloodHound CE | Web-based graph analysis platform | Docker |
| SharpHound v2 | AD data collection (.NET, for CE) | Windows |
| BloodHound.py | AD data collection (Python) | Linux |
| AzureHound | Azure AD / Entra ID data collection | Cross-platform |
| PlumHound | Automated BloodHound reporting | Python |
| BloodHound Query Library | Community Cypher query repository | Web |
Key Attack Path Types
| Path Type | Description | Example |
|---|---|---|
| ACL Abuse | Exploit misconfigured ACLs | GenericAll on DA group |
| Kerberoasting | Crack service account passwords | SPN account → DA |
| AS-REP Roasting | Attack accounts without pre-auth | No-preauth user → password crack |
| Delegation Abuse | Exploit unconstrained/constrained delegation | Computer → impersonate DA |
| GPO Abuse | Modify GPOs applied to privileged OUs | GPO write → code execution on DA |
| Session Hijack | Leverage DA sessions on compromised hosts | Admin session → token theft |
Validation Criteria
- [ ] BloodHound CE deployed and accessible
- [ ] SharpHound v2 data collected from all domains in scope
- [ ] Data successfully imported into BloodHound CE
- [ ] Owned principals marked in the interface
- [ ] Shortest paths to Domain Admin identified
- [ ] ACL-based attack paths documented
- [ ] Kerberoastable and AS-REP roastable accounts listed
- [ ] Custom Cypher queries executed for advanced analysis
- [ ] Attack paths prioritized by feasibility and stealth
- [ ] Report generated with all identified paths and evidence
BloodHound CE Reconnaissance Report Template
Engagement Details
| Field | Value |
|---|---|
| Engagement Name | |
| Target Domain(s) | |
| Collection Date | |
| BloodHound CE Version | |
| SharpHound Version |
Collection Summary
| Metric | Count |
|---|---|
| Users | |
| Computers | |
| Groups | |
| GPOs | |
| OUs | |
| Domains | |
| Trusts | |
| Sessions |
Attack Paths Identified
| # | Path Description | Hops | Start Node | End Node | Risk |
|---|---|---|---|---|---|
| 1 | Domain Admins | ||||
| 2 | Domain Admins |
High-Value Findings
| Finding | Count | Details |
|---|---|---|
| Kerberoastable Users | ||
| AS-REP Roastable Users | ||
| Unconstrained Delegation | ||
| Users with DCSync Rights | ||
| Unsupported OS |
Remediation Priority
| # | Finding | Remediation | Priority |
|---|---|---|---|
| 1 | Critical | ||
| 2 | High | ||
| 3 | Medium |
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to the Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by the Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding any notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. Please do not remove or change
the license header comment from a contributed file except when
necessary.
Copyright 2026 mukul975
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
BloodHound CE Reconnaissance — API Reference
Libraries
| Library | Install | Purpose |
|---|---|---|
| neo4j | pip install neo4j | Neo4j graph database driver for Cypher queries |
| bloodhound | pip install bloodhound | Python ingestor for AD data collection |
| requests | pip install requests | BloodHound CE REST API client |
Key neo4j Driver Methods
| Method | Description |
|---|---|
GraphDatabase.driver(uri, auth=(user, pass)) | Connect to Neo4j |
driver.session() | Open a session for queries |
session.run(cypher, **params) | Execute Cypher query |
driver.close() | Close driver connection |
Critical Cypher Queries
| Query Purpose | Cypher Pattern |
|---|---|
| Path to DA | MATCH p=shortestPath((u:User)-[*1..]->(g:Group {name:"DOMAIN ADMINS@..."})) |
| Kerberoastable | MATCH (u:User) WHERE u.hasspn = true AND u.enabled = true |
| Unconstrained Delegation | MATCH (c:Computer) WHERE c.unconstraineddelegation = true |
| AS-REP Roastable | MATCH (u:User) WHERE u.dontreqpreauth = true |
| DCSync rights | `MATCH p=(u)-[:GetChanges |
BloodHound Python Ingestor
bloodhound-python -d domain.local -u user -p pass -ns DC_IP -c all --zipCollection methods: all, group, localadmin, session, trusts, objectprops, acl
MITRE ATT&CK Mapping
| Technique | ID |
|---|---|
| Account Discovery | T1087 |
| Permission Groups Discovery | T1069 |
| Domain Trust Discovery | T1482 |
External References
Standards and References - BloodHound CE Reconnaissance
MITRE ATT&CK References
| Technique ID | Name | Tactic |
|---|---|---|
| T1087.002 | Account Discovery: Domain Account | Discovery |
| T1069.002 | Permission Groups Discovery: Domain Groups | Discovery |
| T1482 | Domain Trust Discovery | Discovery |
| T1615 | Group Policy Discovery | Discovery |
| T1018 | Remote System Discovery | Discovery |
| T1033 | System Owner/User Discovery | Discovery |
| T1016 | System Network Configuration Discovery | Discovery |
Official Resources
- BloodHound CE: https://github.com/SpecterOps/BloodHound
- SharpHound: https://github.com/BloodHoundAD/SharpHound
- BloodHound.py: https://github.com/dirkjanm/BloodHound.py
- BloodHound Query Library: https://queries.specterops.io/
- AzureHound: https://github.com/BloodHoundAD/AzureHound
Key Research
- SpecterOps: An Ace in the Hole - Stealthy Data Collection with BloodHound
- Compass Security: BloodHound Community Edition Custom Queries (2025)
- SpecterOps: Introducing the BloodHound Query Library (2025)
Workflows - BloodHound CE Reconnaissance
Complete Reconnaissance Workflow
1. Deployment
├── Pull BloodHound CE Docker images
├── Start services with docker compose up -d
├── Access web UI and set admin password
└── Verify API connectivity
2. Data Collection
├── Choose collector: SharpHound v2 (Windows) or BloodHound.py (Linux)
├── Run All collection method for comprehensive data
├── Run Session collection in loop for user mapping
├── Collect from all reachable domains
└── Exfiltrate ZIP data to analysis workstation
3. Import and Setup
├── Upload ZIP files via BloodHound CE web interface
├── Wait for data processing to complete
├── Mark owned/compromised principals
└── Set high-value targets
4. Analysis
├── Run built-in attack path queries
├── Execute custom Cypher queries
├── Identify ACL abuse opportunities
├── Map delegation configurations
├── Find Kerberoastable / AS-REP roastable accounts
└── Discover GPO modification paths
5. Attack Planning
├── Prioritize paths by hop count and stealth
├── Identify tools needed per hop
├── Plan OPSEC for each technique
└── Document execution plan
6. Reporting
├── Export graph visualizations
├── Generate path summaries
├── Document all findings with evidence
└── Provide remediation recommendationsStealthy Collection Workflow
Low-Noise Collection:
1. DCOnly mode: Only queries domain controllers via LDAP
SharpHound.exe -c DCOnly
2. Targeted collection: Specific container/OU
SharpHound.exe -c All --searchbase "OU=Servers,DC=domain,DC=local"
3. Session loop: Passive session enumeration over time
SharpHound.exe -c Session --loop --loopduration 04:00:00 --loopinterval 00:05:00#!/usr/bin/env python3
# For authorized penetration testing and educational environments only.
# Usage against targets without prior mutual consent is illegal.
# It is the end user's responsibility to obey all applicable local, state and federal laws.
"""BloodHound CE reconnaissance agent using bloodhound Python ingestor and Neo4j."""
import json
import sys
import argparse
import subprocess
from datetime import datetime
try:
from neo4j import GraphDatabase
except ImportError:
print("Install: pip install neo4j")
sys.exit(1)
def collect_bloodhound_data(domain, username, password, dc_ip, method="all"):
"""Run BloodHound Python ingestor to collect AD data."""
cmd = [
"bloodhound-python", "-d", domain, "-u", username, "-p", password,
"-ns", dc_ip, "-c", method, "--zip",
]
try:
result = subprocess.run(cmd, capture_output=True, text=True, timeout=300)
return {"status": "completed", "output": result.stdout[:1000]}
except FileNotFoundError:
return {"status": "error", "message": "Install: pip install bloodhound"}
except subprocess.TimeoutExpired:
return {"status": "timeout"}
def query_shortest_path_to_da(driver):
"""Find shortest path to Domain Admins."""
with driver.session() as session:
result = session.run(
"MATCH p=shortestPath((u:User)-[*1..]->(g:Group {name: $group})) "
"WHERE u.enabled = true RETURN u.name AS user, length(p) AS hops "
"ORDER BY hops LIMIT 10",
group="DOMAIN ADMINS@DOMAIN.LOCAL",
)
return [{"user": r["user"], "hops": r["hops"]} for r in result]
def query_kerberoastable_users(driver):
"""Find kerberoastable user accounts."""
with driver.session() as session:
result = session.run(
"MATCH (u:User) WHERE u.hasspn = true AND u.enabled = true "
"RETURN u.name AS user, u.serviceprincipalnames AS spns, "
"u.admincount AS admin_count ORDER BY u.admincount DESC"
)
return [{"user": r["user"], "spns": r["spns"],
"admin": r["admin_count"]} for r in result]
def query_unconstrained_delegation(driver):
"""Find computers with unconstrained delegation."""
with driver.session() as session:
result = session.run(
"MATCH (c:Computer) WHERE c.unconstraineddelegation = true "
"RETURN c.name AS computer, c.operatingsystem AS os"
)
return [{"computer": r["computer"], "os": r["os"]} for r in result]
def query_as_rep_roastable(driver):
"""Find AS-REP roastable accounts (no pre-auth required)."""
with driver.session() as session:
result = session.run(
"MATCH (u:User) WHERE u.dontreqpreauth = true AND u.enabled = true "
"RETURN u.name AS user, u.admincount AS admin_count"
)
return [{"user": r["user"], "admin": r["admin_count"]} for r in result]
def run_recon(neo4j_uri, neo4j_user, neo4j_password):
"""Run BloodHound reconnaissance queries."""
driver = GraphDatabase.driver(neo4j_uri, auth=(neo4j_user, neo4j_password))
print(f"\n{'='*60}")
print(f" BLOODHOUND CE RECONNAISSANCE")
print(f" Generated: {datetime.utcnow().isoformat()} UTC")
print(f"{'='*60}\n")
paths = query_shortest_path_to_da(driver)
print(f"--- SHORTEST PATHS TO DOMAIN ADMIN ({len(paths)}) ---")
for p in paths:
print(f" {p['user']}: {p['hops']} hops")
kerb = query_kerberoastable_users(driver)
print(f"\n--- KERBEROASTABLE USERS ({len(kerb)}) ---")
for k in kerb[:10]:
print(f" {k['user']} (admin={k['admin']})")
deleg = query_unconstrained_delegation(driver)
print(f"\n--- UNCONSTRAINED DELEGATION ({len(deleg)}) ---")
for d in deleg:
print(f" {d['computer']}: {d['os']}")
asrep = query_as_rep_roastable(driver)
print(f"\n--- AS-REP ROASTABLE ({len(asrep)}) ---")
for a in asrep:
print(f" {a['user']} (admin={a['admin']})")
driver.close()
return {"paths_to_da": paths, "kerberoastable": kerb,
"unconstrained_delegation": deleg, "asrep_roastable": asrep}
def main():
parser = argparse.ArgumentParser(description="BloodHound CE Recon Agent")
parser.add_argument("--neo4j-uri", default="bolt://localhost:7687", help="Neo4j URI")
parser.add_argument("--neo4j-user", default="neo4j", help="Neo4j username")
parser.add_argument("--neo4j-password", required=True, help="Neo4j password")
parser.add_argument("--collect", action="store_true", help="Run data collection first")
parser.add_argument("--domain", help="AD domain for collection")
parser.add_argument("--ad-user", help="AD username for collection")
parser.add_argument("--ad-pass", help="AD password for collection")
parser.add_argument("--dc-ip", help="Domain controller IP")
parser.add_argument("--output", help="Save report to JSON file")
args = parser.parse_args()
if args.collect and args.domain:
result = collect_bloodhound_data(args.domain, args.ad_user, args.ad_pass, args.dc_ip)
print(json.dumps(result, indent=2))
report = run_recon(args.neo4j_uri, args.neo4j_user, args.neo4j_password)
if args.output:
with open(args.output, "w") as f:
json.dump(report, f, indent=2, default=str)
print(f"\n[+] Report saved to {args.output}")
if __name__ == "__main__":
main()
#!/usr/bin/env python3
"""
BloodHound CE Attack Path Analysis Script
Processes BloodHound CE data exports and generates prioritized
attack path reports. For authorized red team engagements only.
"""
import json
import sys
import os
from datetime import datetime
from collections import defaultdict
def load_bloodhound_data(filepath: str) -> dict:
"""Load BloodHound CE exported JSON data."""
try:
with open(filepath, "r") as f:
return json.load(f)
except (FileNotFoundError, json.JSONDecodeError) as e:
print(f"Error loading data: {e}")
return {}
def analyze_users(data: dict) -> dict:
"""Analyze user objects for attack opportunities."""
analysis = {
"total_users": 0,
"enabled_users": 0,
"kerberoastable": [],
"asreproastable": [],
"dcsync_capable": [],
"admin_count_set": [],
"password_not_required": [],
"unconstrained_delegation": []
}
users = data.get("data", data.get("users", []))
if isinstance(users, list):
for user in users:
props = user.get("Properties", user.get("properties", {}))
name = props.get("name", props.get("samaccountname", "Unknown"))
analysis["total_users"] += 1
if props.get("enabled", True):
analysis["enabled_users"] += 1
if props.get("hasspn", False):
analysis["kerberoastable"].append(name)
if not props.get("dontreqpreauth", True) is False:
if props.get("dontreqpreauth", False):
analysis["asreproastable"].append(name)
if props.get("admincount", False):
analysis["admin_count_set"].append(name)
if props.get("passwordnotreqd", False):
analysis["password_not_required"].append(name)
return analysis
def analyze_computers(data: dict) -> dict:
"""Analyze computer objects for attack opportunities."""
analysis = {
"total_computers": 0,
"unconstrained_delegation": [],
"constrained_delegation": [],
"laps_enabled": [],
"laps_disabled": [],
"unsupported_os": [],
"domain_controllers": []
}
computers = data.get("data", data.get("computers", []))
if isinstance(computers, list):
for computer in computers:
props = computer.get("Properties", computer.get("properties", {}))
name = props.get("name", "Unknown")
analysis["total_computers"] += 1
if props.get("unconstraineddelegation", False):
analysis["unconstrained_delegation"].append(name)
if props.get("allowedtodelegate", []):
analysis["constrained_delegation"].append({
"name": name,
"delegates_to": props.get("allowedtodelegate", [])
})
if props.get("haslaps", False):
analysis["laps_enabled"].append(name)
else:
analysis["laps_disabled"].append(name)
os_name = props.get("operatingsystem", "").lower()
unsupported = ["2003", "2008", "xp", "vista", "windows 7"]
if any(ver in os_name for ver in unsupported):
analysis["unsupported_os"].append({
"name": name,
"os": props.get("operatingsystem", "Unknown")
})
if props.get("isdc", False):
analysis["domain_controllers"].append(name)
return analysis
def generate_report(user_analysis: dict, computer_analysis: dict) -> str:
"""Generate a comprehensive attack path analysis report."""
report = [
"=" * 70,
"BloodHound CE Attack Path Analysis Report",
f"Generated: {datetime.now().isoformat()}",
"=" * 70,
"",
"[User Analysis]",
f" Total Users: {user_analysis['total_users']}",
f" Enabled Users: {user_analysis['enabled_users']}",
f" Kerberoastable: {len(user_analysis['kerberoastable'])}",
f" AS-REP Roastable: {len(user_analysis['asreproastable'])}",
f" AdminCount Set: {len(user_analysis['admin_count_set'])}",
f" Password Not Required: {len(user_analysis['password_not_required'])}",
""
]
if user_analysis["kerberoastable"]:
report.append(" Kerberoastable Accounts:")
for acct in user_analysis["kerberoastable"][:20]:
report.append(f" - {acct}")
if user_analysis["asreproastable"]:
report.append(" AS-REP Roastable Accounts:")
for acct in user_analysis["asreproastable"][:20]:
report.append(f" - {acct}")
report.extend([
"",
"[Computer Analysis]",
f" Total Computers: {computer_analysis['total_computers']}",
f" Domain Controllers: {len(computer_analysis['domain_controllers'])}",
f" Unconstrained Delegation: {len(computer_analysis['unconstrained_delegation'])}",
f" Constrained Delegation: {len(computer_analysis['constrained_delegation'])}",
f" LAPS Enabled: {len(computer_analysis['laps_enabled'])}",
f" LAPS Disabled: {len(computer_analysis['laps_disabled'])}",
f" Unsupported OS: {len(computer_analysis['unsupported_os'])}",
""
])
if computer_analysis["unconstrained_delegation"]:
report.append(" Unconstrained Delegation Computers:")
for comp in computer_analysis["unconstrained_delegation"]:
report.append(f" - {comp}")
if computer_analysis["unsupported_os"]:
report.append(" Unsupported Operating Systems:")
for comp in computer_analysis["unsupported_os"]:
report.append(f" - {comp['name']}: {comp['os']}")
report.extend([
"",
"[Priority Attack Vectors]",
" 1. Kerberoastable accounts with path to DA (crack SPN passwords)",
" 2. AS-REP Roastable accounts (offline password cracking)",
" 3. Unconstrained delegation abuse (TGT theft via coercion)",
" 4. ACL-based paths (GenericAll, WriteDACL, ForceChangePassword)",
" 5. GPO modification paths (code execution on privileged OUs)",
" 6. Unsupported OS exploitation (unpatched vulnerabilities)",
"",
"=" * 70
])
return "\n".join(report)
def main():
"""Main entry point."""
if len(sys.argv) < 2:
print("Usage: python process.py <bloodhound_users.json> [bloodhound_computers.json]")
return
users_file = sys.argv[1]
computers_file = sys.argv[2] if len(sys.argv) > 2 else None
user_data = load_bloodhound_data(users_file)
user_analysis = analyze_users(user_data)
computer_analysis = {
"total_computers": 0, "unconstrained_delegation": [],
"constrained_delegation": [], "laps_enabled": [], "laps_disabled": [],
"unsupported_os": [], "domain_controllers": []
}
if computers_file:
computer_data = load_bloodhound_data(computers_file)
computer_analysis = analyze_computers(computer_data)
report = generate_report(user_analysis, computer_analysis)
print(report)
report_file = f"bloodhound_analysis_{datetime.now().strftime('%Y%m%d_%H%M%S')}.txt"
with open(report_file, "w") as f:
f.write(report)
print(f"\nReport saved to: {report_file}")
if __name__ == "__main__":
main()