Courses3 levels
Level 1 · Foundations11 courses
Level 2 · Core5 courses
Level 3 · Advanced5 courses
Labs8 topics
Library Practice exams AI Range Pricing Start free

Practice library / Active Directory and Windows attacks

Lab · Medium · 1.5 hoursFree account

AD Enumeration with BloodHound

Collect a domain into BloodHound CE, then read a session edge and an ACL edge to find the path to Domain Admin.

  • active-directory
  • bloodhound
  • sharphound
  • enumeration
  • attack-paths
On this page 15 sections
  1. ·Overview
  2. ·Prerequisites
  3. ·Lab setup
  4. ·Build the target
  5. 1Confirm your foothold credential
  6. 2Stand up BloodHound CE
  7. Locked: Collect the domain with BloodHound's Python collector
  8. Locked: Upload the collection to BloodHound CE
  9. Locked: Mark your foothold and find the shortest path
  10. Locked: Read the session edge
  11. Locked: Read the ACL edge
  12. Locked: Write a Cypher query for what the built-in queries miss
  13. Locked: Check
  14. Locked: Clean-up
  15. Locked: Command reference

BloodHound reads Active Directory as a graph of permissions, not a list, and that graph is the fastest way to find a path to Domain Admin. One ACL edge or one live session can collapse a domain that looks safe on paper, which is why real incident reports keep naming the tool. The exercises here deploy BloodHound CE, collect a domain with its Python collector, and read each edge back to the command it implies.

Lab Objectives

  • Deploy BloodHound CE and collect a domain with BloodHound's Python collector
  • Read BloodHound's nodes, edges and built-in queries to find a path to Domain Admin
  • Explain what a session edge and an ACL edge each mean, and the command each implies
  • Write a raw Cypher query to find attack surface no built-in query covers
  • Map collection and edge abuse to the Windows event IDs a defender sees

Overview

Active Directory permissions form a graph, not a list. A user is a member of a group, that group has rights on another group, and somewhere in that chain sits a path to Domain Admin that no single net group command shows you. BloodHound builds that graph from one collection pass, then lets you ask it the one question that matters: "what is the shortest path from the account I have to the account I want?"

Prerequisites

  • Finish Active Directory Basics first. This lab assumes you already know a Domain Controller, LDAP, a group and an SPN (Service Principal Name), and goes straight to graphing the relationships between them.
  • Windows Command Line & PowerShell is useful, not required, for reading the PowerShell commands BloodHound's abuse-info panels show you.
  • Active Directory LDAP Enumeration teaches the same objects by hand, one raw LDAP query at a time. BloodHound automates that collection and draws the result as a graph instead of a list.

Lab setup

ItemPurpose
Docker and the Docker Compose pluginRuns BloodHound CE's own stack (graph database, API and web UI) on your Kali attack box
bloodhound-pythonThe Python collector. Reads the domain over LDAP and SMB with credentials you already have, no code execution on a domain host needed
crackmapexecConfirms a credential works before you spend a collection run on it
A browserReads the BloodHound CE web UI at http://127.0.0.1:8080

Build the target

KaliRange hosts no targets, no virtual machines and no lab files. You run this lab on your own machine, against a domain that you build. The names and 10.10.x.x addresses below are the example addresses of this lab. Replace them with the addresses of your own domain.

Your lab domain must have these parts:

HostRole
DC01 (10.10.20.10)Domain Controller of CORP.LOCAL, Windows Server 2022
FS01 (10.10.20.21)Domain-joined file server
  • About fifty users, a few groups and a few computers, so that the graph has enough in it to read.
  • The foothold account j.doe@CORP.LOCAL with the password Str0ngPass!99: a plain domain user with no admin rights. Use your own password and put it in the commands.
  • The path of Step 5: j.doe is a member of IT-SUPPORT, IT-SUPPORT is a member of HELPDESK-ADMINS, and HELPDESK-ADMINS has GenericAll on DOMAIN ADMINS.
  • The session path of Step 6: t.admin, a Domain Admin, is logged on to FS01, and a group that holds j.doe can open Remote Desktop on FS01.
  • A Kerberoastable account SVC_SQL: it has a Service Principal Name and adminCount=1 (Step 8).

Build such a domain from free, legal parts. Install an evaluation copy of Windows Server 2022 from the Microsoft Evaluation Center (180 days) in virtual machines on your own computer, promote one to a domain controller and join the other. Or start from GOAD ("Game of Active Directory"), a deliberately vulnerable Active Directory lab that Orange Cyberdefense publishes on GitHub. Its domain names differ from CORP.LOCAL, so change the names in the commands. Take a snapshot of each virtual machine before Step 1.

Authorized-lab only. Run every command in this lab only against a domain that you own or have written permission to test, here 10.10.20.10 and 10.10.20.21, and nowhere else. Collecting Active Directory permission data without authorization is unauthorized access in most countries, even when the collection itself only reads.

Step 1: Confirm your foothold credential

1

Test the j.doe credential against the Domain Controller

Check that the foothold credential actually authenticates before you stand up any tooling around it. A failed collection run is hard to debug; a failed login is not.

crackmapexec smb 10.10.20.10 -u j.doe -p 'Str0ngPass!99'

Example output:

SMB  10.10.20.10  445  DC01  [*] Windows Server 2022 Build 20348 x64 (name:DC01) (domain:corp.local) (signing:True) (SMBv1:False)
SMB  10.10.20.10  445  DC01  [+] corp.local\j.doe:Str0ngPass!99

The [+] line confirms the password is correct and the account is not locked or disabled. signing:True tells you DC01 requires SMB signing, which rules out a relay attack against it directly — that is a different lab's problem, not this one's.

Step 2: Stand up BloodHound CE

2

Bring up BloodHound CE's own stack with Docker Compose

Clone the official BloodHound CE repository and start its Docker Compose stack. This runs the graph database, the API and the web UI together as one unit on your Kali attack box.

git clone https://github.com/SpecterOps/BloodHound.git
cd BloodHound/examples/docker-compose
docker compose up -d

Example output:

[+] Running 3/3
 ✔ Container docker-compose-app-db-1      Started
 ✔ Container docker-compose-graph-db-1    Started
 ✔ Container docker-compose-bloodhound-1  Started
docker compose logs bloodhound | grep -i password

Example output (the exact wording changes between releases; look for the word "password" and copy the value that follows it):

bloodhound-bloodhound-1  | INFO: Initial password set. Login as "admin" with this password, then change it.
bloodhound-bloodhound-1  | INFO: Password: bL8xR2qpT9vK

Open http://127.0.0.1:8080, log in as admin with that password, and set a new password when prompted. Keep this stack bound to your own Kali box. BloodHound's database holds a full map of domain permissions; exposing port 8080 beyond your lab network hands that map to anyone who can reach it.

Sign in to continue

9 more sections are for signed-in members. It is free: sign in with Google.

Related