Blue Team · Expert
Active Directory Defence & Detection

Master detection of the full Active Directory attack lifecycle — Kerberoasting, DCSync, Pass-the-Hash, Golden Tickets, and BloodHound enumeration — through Windows event log analysis, understand why each technique leaves the specific artefacts it does, and implement the structural hardening controls that raise the cost of domain compromise.

Expert Blue Team Path ⏱ 28 min read
Learning Progress
0%

Active Directory Defence and Detection

Active Directory is the backbone of enterprise identity — it controls authentication, authorisation, and access management for every user, computer, and service in the organisation. Attackers who compromise AD can move laterally to any system, persist indefinitely using forged credentials, and extract all credentials in the domain. Defending AD means detecting the specific attack techniques used against it: Kerberoasting, DCSync, Pass-the-Hash, Golden Tickets, and more — each of which leaves distinctive log artefacts that a well-configured SIEM can surface.

AD defence requires understanding both the attack techniques from the adversary's perspective and the specific Windows Security Event log entries each leaves behind. This is one of the most technically demanding areas of Blue Team work — and one of the most impactful, because AD compromise is the prerequisite for the worst-case outcomes in most enterprise breaches.

🚨Crown jewels: Domain Controllers are Tier 0 infrastructure — compromise of a DC means compromise of every system in the domain. DC Security event logs must be forwarded to a SIEM and monitored in near real-time with alerting on specific event ID patterns. There is no post-compromise recovery from a domain that an attacker has fully owned — the only option is rebuild.

Why AD Attacks Are Especially Difficult to Detect

Active Directory attack techniques are particularly challenging to detect because many of them abuse legitimate AD protocols and functionality rather than exploiting software vulnerabilities. Kerberoasting uses the legitimate Kerberos service ticket request mechanism. DCSync uses the legitimate domain replication protocol. Pass-the-Hash uses legitimate NTLM authentication. BloodHound uses legitimate LDAP queries.

The result is that these attacks produce events that are indistinguishable from normal domain operations at the individual event level. Detection requires either contextual analysis (this is a legitimate event type, but from an anomalous account, source, or at an anomalous time), pattern recognition (this event type appearing in volume or in a specific sequence signals an attack), or the identification of specific field values that normal operations never produce (RC4 encryption on a modern domain that enforces AES, a Kerberos ticket with a 10-year lifetime).

📌 Non-Technical Analogy

Detecting AD attacks is like identifying a skilled pickpocket in a crowd. A pickpocket doesn't break any windows or trip any alarms — they perform actions that are superficially identical to normal human movement (standing near someone, reaching into a bag, walking away). The detection requires attention to subtle contextual signals: who is standing too close, who is moving their hands in an unusual pattern, who is paying attention in the wrong direction. A CCTV camera recording everyone present captures the evidence — but only an analyst who knows what normal behaviour looks like can identify the anomaly in the footage. Windows event logs are the CCTV. The analyst who understands which specific field values and sequences indicate attack rather than normal operation is the detective who can review that footage effectively.

Key AD Attack Techniques and Their Artefacts

MITRE ATT&CK Techniques and Primary Detection Events
Kerberoasting    T1558.003 -- Event 4769 (RC4 ticket request from non-service account)
AS-REP Roasting  T1558.004 -- Event 4768 (pre-auth not required, RC4 encrypted)
Pass-the-Hash    T1550.002 -- Event 4624 Type 3, NTLM auth, blank workstation name
DCSync           T1003.006 -- Event 4662 (DS-Replication-Get-Changes-All from non-DC)
Golden Ticket    T1558.001 -- Event 4769 anomalous ticket lifetime or disabled account
BloodHound enum  T1087.002 -- LDAP query volume spike, Event 4662 object access burst
Pass-the-Ticket  T1550.003 -- Event 4768/4769 from unexpected source addresses

The Windows Security Event Log Reference

Every AD attack detection maps to specific Windows Security Event IDs. Understanding which events to enable, where they are generated, and what fields within each event carry the detection signal is the foundation of AD monitoring. Most of these events are generated on Domain Controllers — DC log forwarding to your SIEM is a prerequisite for all of the following detections.

Event IDGenerated OnWhat It RecordsKey Detection Fields
4769Domain ControllerKerberos Service Ticket RequestTicket Encryption Type (0x17=RC4 is suspicious), Service Name, Account Name
4768Domain ControllerKerberos Authentication Ticket RequestPre-Authentication Type (0=no pre-auth = AS-REP roastable), Encryption Type
4624Target machineSuccessful Account LogonLogon Type (3=network), Authentication Package (NTLM vs Kerberos), Workstation Name (blank = suspicious)
4625Target machineFailed LogonSub Status code (0xC000006A=wrong password, 0xC0000064=no such user)
4662Domain ControllerOperation Performed on AD ObjectObject Type (domainDNS), Accesses (DS-Replication-Get-Changes-All GUID), Account (non-DC = attack)
4728Domain ControllerMember Added to Security-Enabled Global GroupGroup Name (Domain Admins, Enterprise Admins), Subject (who added the member)
4720Domain ControllerUser Account CreatedNew Account Name, Subject Account (who created it). Unexpected account creation = persistence.
4776Domain ControllerDomain Controller NTLM Credential ValidationAuthentication Package, Workstation, Error Code (0xC0000234=locked out)

AD Attack Detection in Practice

Example 01Kerberoasting detection

Kerberoasting requests service tickets for service accounts to crack offline. The RC4 encryption type on Event 4769 from a user account is the key indicator — modern domains should use AES.

Event 4769: Kerberos Service Ticket Requested
Time: 02:14:33  Account: jsmith@CORP.COM (normal user account)
Service: MSSQLSvc/sqlserver.corp.com
Ticket Encryption: 0x17 (RC4-HMAC)  <-- anomalous in modern AES-enforced AD
# Within 5 minutes: 12 more 4769 events from jsmith, all RC4
# Different services each time = Kerberoast sweep of all SPNs
# jsmith has no business reason to request SQL service tickets
Example 02DCSync attack detection

DCSync mimics a domain controller replication request to extract all password hashes from AD. Event 4662 with the replication rights GUID is the definitive signature.

Event 4662: Operation on Active Directory Object
Object Type: domainDNS
Accesses: Control Access
Properties: {1131f6aa-...} DS-Replication-Get-Changes-All
Account: jsmith  (not a DC or privileged sync account -- anomalous)
Source: CORP-WS-044  (a workstation -- DCs replicate from DCs, not workstations)
# Non-DC exercising replication rights = DCSync attack
# All domain password hashes are now in attacker hands
Example 03Pass-the-Hash detection

PtH uses stolen NTLM hashes to authenticate without the plaintext password. Event 4624 with specific field combinations reveals the technique.

Event 4624: Successful Logon
Logon Type: 3 (Network)
Account: Administrator
Authentication Package: NTLM
Source: CORP-WS-044 (jsmith's workstation)
Workstation name: -  (blank -- PtH indicator; normal logins populate this)
# Pattern: NTLM + blank workstation name + privileged account + workstation source
# Legitimate network logons from workstations use Kerberos, not NTLM
Example 04BloodHound/LDAP enumeration detection

BloodHound maps AD attack paths via LDAP queries. The volume and pattern of LDAP queries — thousands in minutes — is the unmistakeable indicator.

# Normal user LDAP activity: a few queries per day (email lookups)
jsmith LDAP queries: 8/day (baseline)

# BloodHound run -- LDAP queries spike dramatically:
jsmith LDAP queries: 4,821 in 3 minutes
Querying: all users, all groups, all computers, all GPOs, all trusts
# BloodHound systematically enumerates every AD object type
# 4000+ LDAP queries in minutes is the unmistakeable BloodHound signature
Example 05Golden Ticket detection

A Golden Ticket is a forged Kerberos TGT created with the KRBTGT hash. It grants access to any resource and has anomalous properties that appear in logs even though the ticket itself is cryptographically valid.

Event 4769: Kerberos Service Ticket Request
Ticket Lifetime: 10 years  (default maximum is 10 hours -- massive anomaly)
Account: Administrator (but this account is disabled in AD)
Encryption: 0x17 (RC4)  (attacker used RC4 to avoid AES requirement check)
# 10-year lifetime + disabled account = Golden Ticket
# KRBTGT password must be reset TWICE (with replication delay between) to invalidate

What You Need to Know

🔑
Kerberoasting
Requests RC4-encrypted service tickets for offline cracking. Detect via Event 4769 with encryption type 0x17 (RC4) from user accounts — especially multiple requests in rapid succession targeting different SPNs.
🗄️
DCSync
Mimics DC replication to extract all password hashes. Detect via Event 4662 with DS-Replication-Get-Changes-All rights exercised by a non-DC account. Any such event is a confirmed attack.
🔐
KRBTGT Reset
After any Kerberos compromise (Golden Ticket, DCSync), the KRBTGT account password must be reset TWICE with 10-hour gap between resets to invalidate all existing forged tickets across all DCs.
🦷
Tiered Administration
Tier 0 (DCs), Tier 1 (servers), Tier 2 (workstations). Admin accounts must never cross tier boundaries — a DA credential used on a workstation is immediately at risk of theft via credential harvesting.
🕷️
BloodHound
Maps attack paths through AD using LDAP queries. An attacker running BloodHound generates thousands of LDAP queries in minutes — a unique and highly detectable signature against any baseline.
🎯
Privileged Access Workstations
Dedicated machines for Tier 0/1 administration — no internet, no email, no standard software. Prevents credential theft from admin sessions conducted on general-purpose workstations.

Kerberos Architecture — Why Attacks Leave Specific Artefacts

Understanding why Kerberoasting, Golden Tickets, and AS-REP Roasting leave the specific detection signatures they do requires understanding how Kerberos authentication actually works. Defenders who understand the protocol rather than just the signatures can reason about novel variations on these attacks and understand what their SIEM alerts actually mean.

The Kerberos Flow in Three Steps

Kerberos authentication uses a trusted third party (the Key Distribution Centre, KDC, running on the Domain Controller) to enable clients and services to authenticate to each other without transmitting passwords over the network. The process has three distinct exchanges:

  1. AS-REQ / AS-REP (Authentication Service): The client requests a Ticket-Granting Ticket (TGT) from the KDC, proving identity by pre-authenticating with a timestamp encrypted with the user's password hash. The KDC returns a TGT encrypted with the KRBTGT account hash — valid for 10 hours by default. This is where AS-REP Roasting targets accounts with pre-authentication disabled: the KDC returns the AS-REP without requiring the pre-authentication proof, giving the attacker encrypted material to crack offline.
  2. TGS-REQ / TGS-REP (Ticket-Granting Service): The client presents the TGT and requests a Service Ticket (ST) for a specific service. The KDC issues the ST encrypted with the service account's password hash — without the service account being involved. This is the Kerberoasting opportunity: any domain user can request service tickets for any SPN-registered account, and the returned ticket is encrypted with that service account's hash, available for offline cracking.
  3. AP-REQ (Application Protocol): The client presents the Service Ticket to the target service, which decrypts it with its own password hash to confirm validity. The service never contacts the KDC — it trusts the cryptographic chain.

The Golden Ticket attack forges Step 1's output — a TGT — using the KRBTGT hash obtained through DCSync. Because services only verify the cryptographic validity of tickets (Step 3), a mathematically valid forged TGT with arbitrary contents (any username, any group membership, any lifetime) is accepted as legitimate by every service in the domain.

Example 06AS-REP Roasting detection and response

AS-REP Roasting targets accounts with Kerberos pre-authentication disabled — a setting sometimes incorrectly configured for compatibility. Unlike Kerberoasting, it doesn't even require domain user credentials to initiate.

# Detection: Event 4768 with pre-auth type 0
Event 4768: Kerberos Authentication Ticket (TGT) Requested
Account Name: svc_legacy
Pre-Authentication Type: 0  (pre-authentication disabled on this account!)
Ticket Encryption Type: 0x17 (RC4)
# The AS-REP is returned encrypted with the account's hash
# Attacker can crack this offline without any domain credential

# Immediate remediation query -- find all AS-REP roastable accounts:
Get-ADUser -Filter {DoesNotRequirePreAuth -eq $true} -Properties *
svc_legacy, svc_oldapp, testuser  (3 accounts with pre-auth disabled)

# Fix: enable pre-authentication on all accounts unless explicitly required
Set-ADAccountControl svc_legacy -DoesNotRequirePreAuth $false

SIEM Rule Design — Reducing False Positives While Catching Attacks

Raw event log monitoring produces enormous volumes of noise. Effective AD detection requires tuned SIEM rules that alert on specific field combinations rather than event IDs in isolation, and that incorporate baseline context to distinguish anomalous from expected behaviour. The goal is high-confidence alerts with low false-positive rates — an alert that fires hundreds of times per day trains analysts to ignore it.

Noisy Rule (Low Value)

Alert on: Any Event 4769 (Kerberos service ticket request)

Problem: Every user accessing any domain resource generates Event 4769. A 5,000-user domain generates hundreds of thousands per day. Every single one fires this rule. Zero detection value.

Tuned Rule (High Value)

Alert on: Event 4769 WHERE TicketEncryptionType = 0x17 AND AccountName is a user account (not a computer account$) AND ServiceName is NOT krbtgt AND RequestCount > 5 in 60 seconds

Result: Fires only when a user requests multiple RC4-encrypted service tickets in rapid succession — the Kerberoasting pattern. Near-zero false positives in a domain enforcing AES.

Example 07Production-quality SIEM detection rules

Concrete, field-specific SIEM detection logic for the four most critical AD attack techniques. These are written in pseudo-KQL/SPL syntax but translate directly to any SIEM platform.

--- Kerberoasting detection ---
WHERE EventID = 4769
  AND TicketEncryptionType = "0x17"
  AND AccountName NOT LIKE "%$"   -- exclude computer accounts
  AND ServiceName NOT IN ("krbtgt", "host/*")
HAVING COUNT(*) BY AccountName, SourceIP OVER 5 minutes > 3
SEVERITY: High

--- DCSync detection (highest confidence -- zero legitimate false positives) ---
WHERE EventID = 4662
  AND ObjectType CONTAINS "domainDNS"
  AND Properties CONTAINS "1131f6aa"  -- DS-Replication-Get-Changes-All GUID
  AND SubjectUserName NOT IN [domain_controller_accounts]
SEVERITY: Critical — page on-call immediately

--- Pass-the-Hash detection ---
WHERE EventID = 4624
  AND LogonType = 3
  AND AuthenticationPackage = "NTLM"
  AND WorkstationName = ""           -- blank = PtH indicator
  AND TargetUserName IN [privileged_accounts]
SEVERITY: High

--- Golden Ticket detection ---
WHERE EventID = 4769
  AND TicketOptions CONTAINS "forwardable"
  AND (TicketEncryptionType = "0x17"
       OR AccountName IN [disabled_privileged_accounts]
       OR TicketLifetime > 600)     -- >600 minutes is anomalous
SEVERITY: Critical

Structural AD Hardening — Making Attacks More Difficult and More Visible

Detection capability is the response to attacks that occur. Structural hardening raises the cost and complexity of attacks, reduces the available techniques, and makes detection signals cleaner by eliminating the legitimate activity that masquerades as attacks. The most impactful hardening controls address the specific weaknesses each technique exploits.

Eliminating the Kerberoasting Surface

Kerberoasting succeeds because service accounts with SPNs use password-based encryption for service tickets, and those passwords are often weak. Three controls eliminate or dramatically reduce this attack surface:

The Tiered Administration Model

Pass-the-Hash and credential theft attacks succeed because administrators use their privileged credentials on workstations and servers where credential-harvesting tools can extract them from memory. The tiered administration model prevents this by ensuring that privileged credentials are only ever used on machines of equivalent trust.

Enforcement is through logon restrictions configured via Group Policy — Domain Admins group is specifically denied logon to workstations, preventing the credential from being used even if an admin attempts it. Microsoft's Privileged Access Workstations (PAW) documentation provides the implementation guidance.

Detection ScenarioKerberoast → Lateral Movement → DCSync Caught in Real Time

02:14 UTC — Alert 1: SIEM Kerberoasting rule fires. jsmith@CORP.COM has requested 13 Kerberos service tickets with RC4 encryption in 4 minutes, targeting 13 different SPNs. Analyst is paged. jsmith is a standard IT support user — no business reason to request SQL, Exchange, or print service tickets.

02:19 — Alert 2: Pass-the-Hash rule fires. Administrator account logged in via NTLM from CORP-WS-044 (jsmith's workstation) with blank workstation name. One of the Kerberoasted service accounts was svc_sql with a weak password — cracked in under 4 minutes. svc_sql had local admin on the SQL server, providing a path to escalate.

02:31 — Alert 3: DCSync rule fires. Event 4662 with DS-Replication-Get-Changes-All exercised by an account on CORP-SRV-SQL-01 — not a Domain Controller. The attacker has pivoted from jsmith's workstation to the SQL server and used credentials found there to execute DCSync. All domain password hashes are now extracted.

02:32 — Response: Incident declared. jsmith's account suspended, CORP-WS-044 isolated. KRBTGT reset initiated (first reset). DC security logs exported. The alerts fired at 02:14, 02:19, and 02:31 — the responder was paged within 2 minutes of the first Kerberoasting event. Early detection prevented the Golden Ticket phase: the attacker had the KRBTGT hash but had not yet created a forged ticket when containment began.

The KRBTGT Double Reset: After any confirmed DCSync attack or Golden Ticket discovery, the KRBTGT account password must be reset twice. This is because Active Directory replicates the password change, and during the replication window both the old and new KRBTGT hashes are accepted to prevent authentication failures. A single reset invalidates all golden tickets after replication completes but the old hash may still work briefly. The second reset — performed after at least one replication cycle (typically 10 hours on healthy infrastructure) — closes this window entirely. Resetting KRBTGT will cause Kerberos authentication disruptions — coordinate with operations and schedule if possible.

Core Concepts Summary

🔑
Kerberoasting
Event 4769, encryption 0x17, user account, multiple SPNs in rapid succession. Prevent with gMSA (uncrackable random passwords) and AES enforcement. RC4 ticket requests become immediately anomalous.
🗄️
DCSync
Event 4662, DS-Replication-Get-Changes-All GUID, non-DC account. Zero legitimate false positives — any non-DC exercising replication rights is an attack. Page immediately. Reset KRBTGT twice.
🔐
KRBTGT Double Reset
Single reset leaves old hash valid during replication window. Second reset (10+ hours later) closes the window. Causes Kerberos disruption — coordinate with operations. Required after any confirmed Golden Ticket or DCSync.
🦷
Tiered Administration
Domain Admins only on PAWs/DCs (Tier 0). Server admins only on servers (Tier 1). Standard accounts on workstations (Tier 2). Enforced via GPO logon restrictions. Prevents credential theft by keeping high-value credentials off compromised workstations.
🕷️
BloodHound Detection
LDAP query volume spike — 4000+ queries in minutes from a user account. Monitor LDAP query rates per-user with alert threshold. Baseline is essential — some accounts legitimately query LDAP more than others.
🔀
Pass-the-Hash Pattern
Event 4624, Logon Type 3 (network), NTLM authentication, blank Workstation Name field, privileged account. Legitimate NTLM network logons populate workstation name. Blank is the definitive PtH indicator.
Golden Ticket Indicators
Ticket lifetime >600 minutes, disabled account in ticket, RC4 encryption on AES-enforced domain. The ticket is cryptographically valid — detection relies on anomalous field values, not authentication failure.
🛡️
gMSA — Kerberoasting Immunity
Group Managed Service Accounts use 240-char auto-rotating random passwords. Service ticket for a gMSA-backed SPN cannot be cracked regardless of compute time. Highest-ROI single control against Kerberoasting.
Ready to put it into practice?
Proceed to the Lab

You've covered the theory. Now apply it hands-on in the simulated environment.

Start Lab — AD Defence & Detection
← Return to all labs