Active Directory & Identity Attacks

Active Directory & Identity Attacks

Active Directory and Entra ID are the central authority for authentication and authorization in ~90% of enterprises — compromise the directory and you compromise every account, host, and resource it governs. Identity is the new perimeter, and modern attackers don't break in, they log in with stolen or forged credentials and Kerberos tickets. This lesson builds the mental model from the protocol primitives up: domains, forests, trusts, Kerberos and NTLM, the KRBTGT signing key, and ACLs. It then walks the full kill chain — credential access (LSASS, Kerberoasting, AS-REP roasting, DCSync), lateral movement (Pass-the-Hash / Pass-the-Ticket), persistence and domain dominance (Golden/Silver tickets, DCShadow, SID-history), AD CS abuse (the ESC escalations), Kerberos delegation abuse, the high-impact AD CVEs, attack-path mapping with BloodHound, architectural defenses and hardening, detections by Windows Event ID, and the Entra ID cloud equivalents.

Legal & ethical use

This lesson demonstrates offensive techniques for educational purposes and authorized security testing only. Using them against systems you do not own or lack explicit written permission to test is illegal under computer-misuse laws worldwide, including Turkey’s Penal Code (Law No. 5237, arts. 243-245). The authors and PrimeThreat accept no liability for any misuse of or damage arising from this material.

The twelve pillars of Active Directory & identity security

From why the directory is the crown jewel to the cloud equivalents in Entra ID — each grounded in real MITRE ATT&CK technique IDs, CVE/CWE numbers, GUIDs, Event IDs, and NIST/RFC references.

1

Why identity is the crown jewel (framing)

Key points

  • Active Directory (on-prem) and Entra ID (cloud) are the central authority for authentication and authorization in roughly 90% of enterprises; compromising the directory means compromising every account, host, and resource it governs — it is the ultimate 'keys to the kingdom' target.
  • Identity is the new perimeter: once network perimeters dissolved (remote work, SaaS, BYOD), the attacker's objective shifted from 'get on the network' to 'become a privileged identity'. Most ransomware actors reach Domain Admin before deploying their payload.
  • Attackers don't break in, they log in: stolen or forged credentials and Kerberos tickets let adversaries operate as legitimate users, defeating signature-based defenses. This is why detection must focus on authentication telemetry, not just malware.
  • A single weak link — one reused password, one unconstrained-delegation host, one misconfigured certificate template — can create a deterministic path from a standard user to Domain Admin. This lesson teaches how to find, walk, and cut those paths.
  • Map this to the Security Spine: AD is the answer to 'what are we protecting' (Q1, crown jewels) and the primary battleground for 'where can they move' (Q3, attack paths) and 'would we see it' (Q4, identity detections).

References

ATT&CK TA0006 Credential Access
ATT&CK TA0008 Lateral Movement
NIST SP 800-207 Zero Trust Architecture
CWE-287 Improper Authentication
2

Core concepts — domains, forests, Kerberos, NTLM, KRBTGT, ACLs

Key points

  • Domain / forest / trust: a domain is an administrative and replication boundary; a forest is the SECURITY boundary (the trust container). Trusts (parent-child, external, forest) extend authentication across boundaries and are a common path for cross-domain/forest escalation (e.g. SID-history and trust-key abuse).
  • Kerberos flow (RFC 4120): the client sends an AS-REQ to the KDC and receives a TGT (encrypted and signed with the KRBTGT account key) in the AS-REP; to reach a service it presents the TGT in a TGS-REQ and receives a service ticket (TGS) encrypted with the target service account's key; it then presents that TGS to the service (AP-REQ). The TGT lifetime defaults to ~10 hours, renewable for 7 days.
  • KRBTGT account: a disabled domain account whose password hash is the signing key for ALL TGTs in the domain. Anyone who steals the KRBTGT hash can forge arbitrary TGTs (Golden Ticket). Its password must be rotated TWICE (with a replication interval between) to fully invalidate, because the prior key is kept for backward compatibility.
  • NTLM (MS-NLMP): a legacy challenge-response protocol. The NT hash is an unsalted MD4 of the password (CWE-916 weak hash, CWE-759 missing salt) — it never expires per session and is directly replayable, which is the entire basis of Pass-the-Hash. RC4-HMAC Kerberos (etype 23) uses this same NT hash, linking NTLM weakness directly to Kerberos attacks.
  • ACLs and DACLs: every AD object has a Discretionary ACL of Access Control Entries (ACEs). Dangerous rights — GenericAll, GenericWrite, WriteDACL, WriteOwner, AllExtendedRights, ForceChangePassword, Self/AddMember — let a low-privilege principal take control of higher-privilege objects. Misconfigured ACLs (CWE-732) are the silent backbone of most BloodHound attack paths.
  • Replication rights: DS-Replication-Get-Changes (GUID 1131f6aa-9c07-11d1-f79f-00c04fc2dcd2) and DS-Replication-Get-Changes-All (GUID 1131f6ad-9c07-11d1-f79f-00c04fc2dcd2) over MS-DRSR are exactly what DCSync abuses to pull password hashes as if it were a domain controller.

References

RFC 4120 Kerberos V5
RFC 3961 Kerberos Encryption and Checksum Specifications
RFC 3962 AES Encryption for Kerberos 5
CWE-916 Use of Password Hash With Insufficient Computational Effort
CWE-759 Use of a One-Way Hash without a Salt
CWE-732 Incorrect Permission Assignment for Critical Resource
3

Credential access — harvesting and forging secrets

Key points

  • LSASS memory dumping (T1003.001): the lsass.exe process caches credentials — NT hashes, Kerberos tickets, and sometimes cleartext via WDigest on legacy hosts. Tools include Mimikatz sekurlsa::logonpasswords, procdump -ma lsass.exe, the comsvcs.dll MiniDump, and NanoDump. It maps to the parent OS Credential Dumping (T1003).
  • Kerberoasting (T1558.003): any authenticated user can request a TGS for any account with a registered SPN (service accounts). The TGS is encrypted with the service account's key; if RC4 (etype 23) is allowed, the ticket is crackable OFFLINE with Hashcat (mode 13100) to recover the service account password. No special privilege is needed — only a valid domain account.
  • AS-REP Roasting (T1558.004): accounts flagged 'Do not require Kerberos preauthentication' (DONT_REQ_PREAUTH) return an AS-REP whose encrypted portion is crackable offline (Hashcat mode 18200). They are found via the LDAP filter on the userAccountControl flag 0x400000.
  • DCSync (T1003.006): with replication rights (typically Domain Admins, Enterprise Admins, or any principal granted Get-Changes + Get-Changes-All), an attacker uses the MS-DRSR GetNCChanges call to pull any account's NT hash — including KRBTGT — WITHOUT touching a DC's disk or LSASS. e.g. mimikatz lsadump::dcsync /user:krbtgt.
  • Overpass-the-Hash / Pass-the-Key: convert a stolen NT hash (or AES key) into a fully valid Kerberos TGT, upgrading an NTLM secret into Kerberos access and blending into normal traffic. It is closely related to Use Alternate Authentication Material (T1550.002) and Kerberos ticket abuse (T1558).
  • DPAPI secrets, NTDS.dit extraction, and SAM/LSA secrets are adjacent local credential sources — SAM (T1003.002), NTDS (T1003.003), and LSA Secrets (T1003.004) — all underprotected stores of credentials (CWE-522).

References

ATT&CK T1003.001 OS Credential Dumping: LSASS Memory
ATT&CK T1558.003 Steal or Forge Kerberos Tickets: Kerberoasting
ATT&CK T1558.004 Steal or Forge Kerberos Tickets: AS-REP Roasting
ATT&CK T1003.006 OS Credential Dumping: DCSync
ATT&CK T1003.003 OS Credential Dumping: NTDS
CWE-522 Insufficiently Protected Credentials
4

Lateral movement — reusing authentication material

Key points

  • Pass-the-Hash (T1550.002): present a stolen NT hash directly to NTLM authentication without ever knowing the plaintext — a capture-replay weakness (CWE-294). Tools: Mimikatz sekurlsa::pth, NetExec/CrackMapExec with -H, and impacket psexec/wmiexec with hashes.
  • Pass-the-Ticket (T1550.003): inject a stolen or forged Kerberos TGT/TGS into the current logon session (Mimikatz kerberos::ptt, Rubeus ptt) to authenticate as that principal. This includes reusing tickets harvested from LSASS.
  • Both are sub-techniques of Use Alternate Authentication Material (parent T1550): the unifying idea is that AD's tokens — hashes, tickets, certificates — are bearer secrets, so possession equals identity and theft equals impersonation.
  • Typical movement chain: dump credentials on host A (T1003.001) → identify where those credentials are admin via BloodHound → PtH/PtT to host B (T1550) → repeat, escalating privilege at each hop until a Domain Admin session or the KRBTGT hash is reached.
  • Discovery support: SharpHound/BloodHound collection, net session / HasSession edges, and SPN enumeration drive target selection (T1087 Account Discovery, T1069 Permission Groups Discovery).

References

ATT&CK T1550 Use Alternate Authentication Material
ATT&CK T1550.002 Pass the Hash
ATT&CK T1550.003 Pass the Ticket
CWE-294 Authentication Bypass by Capture-replay
CWE-287 Improper Authentication
5

Persistence & domain dominance — forged tickets and directory backdoors

Key points

  • Golden Ticket (T1558.001): with the KRBTGT hash, forge a self-signed TGT for any user (including a non-existent one) with arbitrary group membership and a multi-year lifetime. It grants domain-wide access and survives password resets of the impersonated user — only a double KRBTGT rotation kills it.
  • Silver Ticket (T1558.002): with a single SERVICE account's key (e.g. a host's machine account or an SPN's secret), forge a TGS directly for that one service, bypassing the KDC entirely. It is stealthier than a Golden Ticket because no TGS-REQ (Event 4769) is generated on the DC.
  • Skeleton Key (T1556.001 — Modify Authentication Process: Domain Controller Authentication): patch LSASS on a DC in memory so a master password authenticates as ANY user alongside their real password. It is volatile (lost on reboot) but devastating while live.
  • DCShadow (T1207 — Rogue Domain Controller): register a rogue DC and push malicious replication changes (e.g. SID-History edits, ACL edits) straight into AD, bypassing most SIEM logging that watches normal admin tooling.
  • SID-History injection (T1134.005): add a privileged SID (e.g. Domain Admins or Enterprise Admins) to an account's sIDHistory so it inherits that access across domain/forest trust boundaries — a stealthy escalation and persistence primitive.
  • AdminSDHolder / DACL backdoors and AddMember/ACL persistence (T1098 Account Manipulation; the directory-object DACL tampering is analogous to T1222 for filesystem ACLs, but T1222's scope is filesystem/registry permissions, not AD objects): grant a controlled low-privilege account hidden rights that auto-reapply via the SDProp process every 60 minutes.

References

ATT&CK T1558.001 Steal or Forge Kerberos Tickets: Golden Ticket
ATT&CK T1558.002 Steal or Forge Kerberos Tickets: Silver Ticket
ATT&CK T1556.001 Modify Authentication Process: Domain Controller Authentication
ATT&CK T1207 Rogue Domain Controller
ATT&CK T1134.005 Access Token Manipulation: SID-History Injection
ATT&CK T1098 Account Manipulation
6

AD Certificate Services abuse — the ESC escalations

Key points

  • AD CS issues certificates usable for Kerberos PKINIT authentication; a certificate for a privileged principal is a long-lived credential (CWE-295 / CWE-287). The abuse family is tracked by SpecterOps's 'Certified Pre-Owned' ESC taxonomy and maps to ATT&CK T1649 (Steal or Forge Authentication Certificates). Tools: Certify, Certipy.
  • ESC1: a template grants low-privilege users enrollment, has a client-authentication EKU, and sets ENROLLEE_SUPPLIES_SUBJECT — so the attacker requests a cert specifying an arbitrary Subject Alternative Name (e.g. a Domain Admin UPN) and authenticates as them.
  • ESC2: the template has the Any Purpose EKU (or no EKU), making issued certs usable for any authentication purpose. ESC3: an Enrollment Agent template lets the attacker request certificates on behalf of other users.
  • ESC4: the attacker has dangerous WRITE rights (GenericWrite/WriteDacl) over a template object and reconfigures it into an ESC1-vulnerable state — an ACL problem (CWE-732). ESC5: dangerous control over PKI-related AD objects or the CA computer object.
  • ESC6: the CA has the EDITF_ATTRIBUTESUBJECTALTNAME2 flag set, letting requesters inject an arbitrary SAN on ANY template regardless of its config. ESC7: the attacker holds ManageCA / ManageCertificates rights on the CA itself (can approve requests, flip flags).
  • ESC8: NTLM relay to the AD CS Web Enrollment HTTP endpoint (certsrv) — coerce a DC's machine-account authentication (e.g. via PetitPotam/PrinterBug, T1187 Forced Authentication) and relay it to enroll a DC certificate, yielding domain compromise. Related modern CVEs: CVE-2022-26923 (Certifried, dNSHostName spoofing on machine accounts) and the ESC15 / 'EKUwu' CVE-2024-49019.
  • Briefly: ESC9 (no szOID_NTDS_CA_SECURITY_EXT — no security extension), ESC10 (weak certificate mappings via registry), and ESC11 (NTLM relay to the ICertPassage RPC / ICPR interface) extend the family.

References

ATT&CK T1649 Steal or Forge Authentication Certificates
ATT&CK T1187 Forced Authentication
CVE-2022-26923
CVE-2024-49019
CWE-295 Improper Certificate Validation
CWE-732 Incorrect Permission Assignment for Critical Resource
7

Kerberos delegation abuse

Key points

  • Unconstrained delegation: a host flagged TRUSTED_FOR_DELEGATION caches the TGT of every user who authenticates to it. An attacker controlling such a host (often via coercion, T1187) captures a DC's or an admin's TGT and replays it (Pass-the-Ticket, T1550.003) — classically combined with the PrinterBug/PetitPotam coercion to force a DC to authenticate.
  • Constrained delegation (S4U2Proxy): an account configured with msDS-AllowedToDelegateTo can request service tickets to listed SPNs on behalf of any user via S4U. Because the target service name in the ST is not cryptographically bound to the SPN, an attacker can often pivot to other services on the same host (e.g. from HTTP to CIFS/LDAP) and impersonate Domain Admins.
  • Resource-Based Constrained Delegation (RBCD): if an attacker can write msDS-AllowedToActOnBehalfOfOtherIdentity on a target computer object (needs GenericWrite/WriteDacl — an ACL flaw, CWE-732, mapped to Account Manipulation T1098), they configure a controlled machine account to impersonate any user to that target — a very common BloodHound-discovered path to local SYSTEM/admin.
  • Delegation abuse is dangerous because it lets an attacker obtain tickets for HIGH-privilege users without ever cracking a password — it weaponizes a legitimate AD feature, which is why it is hard to detect without baselining delegation configuration.
  • Defense: mark Tier-0 / sensitive accounts 'Account is sensitive and cannot be delegated' (or add them to Protected Users), and audit all accounts with any delegation attribute set.

References

ATT&CK T1550.003 Pass the Ticket
ATT&CK T1098 Account Manipulation
ATT&CK T1187 Forced Authentication
RFC 4120 Kerberos V5
CWE-732 Incorrect Permission Assignment for Critical Resource
8

High-impact AD CVEs to know

Key points

  • Zerologon — CVE-2020-1472: a cryptographic flaw in the Netlogon (MS-NRPC) AES-CFB8 implementation lets an unauthenticated attacker with network access to a DC reset the DC machine account password to empty, leading to instant domain takeover. CVSS 10.0.
  • PrintNightmare — CVE-2021-34527 (RCE) and CVE-2021-1675 (LPE): flaws in the Windows Print Spooler allow remote code execution / privilege escalation; running the spooler on DCs is a common foothold and is also leveraged for coercion (the 'PrinterBug', MS-RPRN).
  • noPac / sAMAccountName spoofing — CVE-2021-42278 + CVE-2021-42287: chaining a machine-account name confusion with KDC behavior lets a standard user impersonate a DC and obtain a privileged ticket, escalating to Domain Admin.
  • Certifried — CVE-2022-26923: a standard user can escalate via AD CS by abusing the dNSHostName of a machine account to obtain a certificate authenticating as a DC.
  • PetitPotam (MS-EFSRPC coercion): not a single CVE but an authentication-coercion technique (T1187) that forces a DC to NTLM-authenticate to an attacker; combined with ESC8 NTLM relay it yields domain compromise. It is mitigated by Microsoft guidance KB5005413 and by enabling Extended Protection for Authentication.

References

CVE-2020-1472
CVE-2021-34527
CVE-2021-1675
CVE-2021-42278
CVE-2021-42287
CVE-2022-26923
9

Attack-path mapping with BloodHound

Key points

  • BloodHound models AD as a directed graph: NODES are objects (User, Computer, Group, Domain, OU, GPO, Container, and in newer versions Cert Template / CA / Enterprise CA) and EDGES are the relationships and rights between them.
  • Key edges encode abusable rights: MemberOf, AdminTo, HasSession, GenericAll, GenericWrite, WriteDacl, WriteOwner, Owns, AllExtendedRights, ForceChangePassword, AddMember, CanRDP, CanPSRemote, AllowedToDelegate, AddAllowedToAct (RBCD), and the ADCSESC1–ESC8 edges for certificate paths.
  • The core question BloodHound answers: 'shortest path from a principal I control to Domain Admins (or Tier-0)'. Each edge is a concrete, pre-researched attack primitive, so a path is a step-by-step escalation playbook.
  • Collection: SharpHound enumerates sessions, ACLs, group membership, and trusts; defenders run the SAME tool to find and prune dangerous paths BEFORE attackers walk them — this is attack-path management.
  • Defensive use ties back to Spine Q3 (where can they move): reduce the graph by removing excessive ACEs, cutting HasSession exposure of Tier-0 accounts, and eliminating unconstrained-delegation and ESC edges — measurably shrinking the attack surface.

References

ATT&CK T1069 Permission Groups Discovery
ATT&CK T1087.002 Account Discovery: Domain Account
ATT&CK T1482 Domain Trust Discovery
CWE-732 Incorrect Permission Assignment for Critical Resource
10

Defenses — architecture and hardening

Key points

  • Tiered administration / Enterprise Access Model: classify assets into Tier 0 (the identity control plane — DCs, AD CS, AD Connect), Tier 1 (servers/apps), and Tier 2 (workstations). Privileged credentials must NEVER log on to a lower tier, breaking credential-theft escalation chains.
  • Protected Users group: members cannot use NTLM, RC4/DES Kerberos, unconstrained delegation, or long-lived TGTs (no credential caching) — strong protection for Tier-0 accounts against Pass-the-Hash and ticket theft.
  • Group Managed Service Accounts (gMSA): 120-character automatically rotated passwords managed by AD, eliminating crackable static service-account passwords that fuel Kerberoasting.
  • Windows LAPS: randomizes and rotates each machine's local administrator password (stored encrypted in AD or Entra), killing the reused-local-admin password that enables lateral Pass-the-Hash across workstations.
  • AES-only Kerberos: set msDS-SupportedEncryptionTypes to AES and remove RC4 (etype 23) — RC4 service tickets are what make Kerberoasting offline-crackable; AES (RFC 3962) raises the bar substantially.
  • Disable / restrict NTLM: use 'Network security: Restrict NTLM' policies, enable Extended Protection for Authentication (channel/service binding) to defeat relay (ESC8), and audit NTLM usage before enforcing. Protect LSASS with RunAsPPL and Credential Guard (VBS) to block LSASS dumping (T1003.001).
  • Microsoft Defender for Identity (MDI): DC/AD CS sensors that detect Kerberoasting, DCSync, Golden Ticket, and reconnaissance behaviorally; pair it with honeytokens (decoy SPN accounts and honey users that should never be queried — any TGS request for them is high-fidelity malicious).

References

NIST SP 800-63B Digital Identity Guidelines: Authentication
NIST SP 800-207 Zero Trust Architecture
RFC 3962 AES Encryption for Kerberos 5
CWE-269 Improper Privilege Management
CWE-522 Insufficiently Protected Credentials
ATT&CK Mitigation M1026 Privileged Account Management
ATT&CK Mitigation M1015 Active Directory Configuration
11

Detections — Windows Event IDs and hunts

Key points

  • Event 4768 (a Kerberos TGT was requested): baseline AS-REQ activity; AS-REP Roasting and anomalous TGT requests (RC4 encryption type, accounts without pre-auth) surface here. Watch the Ticket Encryption Type field for 0x17 (RC4).
  • Event 4769 (a Kerberos service ticket was requested): THE primary Kerberoasting signal — a burst of TGS requests, especially with RC4 (0x17) encryption for many SPNs from one account, indicates roasting. Any 4769 for a honeytoken SPN account is malicious by definition.
  • Event 4624 (successful logon) / 4625 (failed logon): a pivot for lateral movement and password spraying — correlate Logon Type 3 (network) and 9 (NewCredentials, used by overpass-the-hash and runas /netonly) and anomalous source hosts for Tier-0 accounts.
  • Event 4662 (an operation was performed on a directory object): DCSync detection — look for replication extended-right access (the DS-Replication-Get-Changes GUIDs 1131f6aa-… / 1131f6ad-…) requested by accounts that are NOT domain controllers.
  • Supporting events: 4672 (special privileges assigned at logon — admin equivalence), 4670/5136 (object permission/attribute changes — ACL backdoors; RBCD msDS-AllowedToActOnBehalfOfOtherIdentity writes show in 5136), 4738/4742 (account/computer object changed), 4886/4887 (AD CS certificate request/issued — ESC abuse), and 1102 (audit log cleared — defense evasion, T1070.001).
  • Detection-engineering loop: pick a technique (e.g. Kerberoasting) → source (4769) → rule (RC4 + volume + non-machine account) → validate with Atomic Red Team / Rubeus in a lab → tune false positives (legacy RC4 services) → document response. Validate every rule before trusting it.

References

ATT&CK T1558.003 Kerberoasting
ATT&CK T1003.006 DCSync
ATT&CK T1550 Use Alternate Authentication Material
ATT&CK T1070.001 Indicator Removal: Clear Windows Event Logs
ATT&CK DS0026 Active Directory
12

Entra ID (Azure AD) — modern equivalents

Key points

  • The cloud identity plane has analogous bearer-token attacks: the Primary Refresh Token (PRT) is the cloud analog of a TGT — Pass-the-PRT lets an attacker reuse a stolen PRT to obtain tokens and SSO across Microsoft 365 / Azure.
  • Golden SAML (T1606.002 — Forge Web Credentials: SAML Tokens): with the AD FS / federation token-signing private key, an attacker forges SAML assertions to impersonate any federated user to any trusting cloud app — the cloud's Golden Ticket (UNC2452/SolarWinds used this).
  • Illicit consent grant / OAuth consent phishing (T1528 — Steal Application Access Token): trick a user into consenting to a malicious app that then accesses mail/files via OAuth, persisting independently of the password and surviving MFA.
  • Password spraying against cloud auth endpoints (T1110.003 — Brute Force: Password Spraying) and seamless-SSO abuse (the AZUREADSSOACC$ computer account is a Silver-Ticket-style target) bridge on-prem and cloud.
  • Hybrid risk: AD Connect (PHS/PTA) and the Connect server are Tier-0 — on-prem compromise propagates to the cloud and vice versa. Defenses: Conditional Access, phishing-resistant MFA (FIDO2), token protection / PRT binding, Privileged Identity Management (just-in-time roles), and Continuous Access Evaluation.

References

ATT&CK T1606.002 Forge Web Credentials: SAML Tokens
ATT&CK T1528 Steal Application Access Token
ATT&CK T1110.003 Brute Force: Password Spraying
NIST SP 800-63B Digital Identity Guidelines: Authentication
NIST SP 800-207 Zero Trust Architecture

See how the paths chain together

Theory becomes concrete on the attack-paths map: trace how one reused password, an unconstrained-delegation host, or a misconfigured certificate template chains a standard user into Domain Admin — and which control cuts each link.