Everything here comes from lab work and reading. I put this together from two places: a stretch of Active Directory purple teaming I did in an isolated playground domain, and the handwritten notes I made while studying for a Windows and C2 technical interview with Synacktiv. None of it was run against anything I don't own. I'm writing it down because the attacks only really stick once you can also explain how a defender would see them, and because future me will want this in one place.I kept going back and forth between two sets of notes. One was a tidy writeup of AD attacks with the detection side bolted on, the kind of thing you build in a lab where you own the domain controller and can watch the event log light up. The other was a stack of scribbled pages, half in French, that I filled in before an interview that was going to cover Windows internals, relaying, Azure identity, and command and control. They cover the same world from slightly different heights, so I merged them. The order below roughly follows how an engagement tends to unfold. First you understand the terrain, then you pull credentials out of it, then you abuse trust relationships, then you take the domain, and finally you look at where all of this is drifting, which is the cloud.
The ground floor: how Active Directory is laid out
- A domain is a group of objects that share one AD database.
- A tree is one or more domains that share a contiguous namespace.
- A forest is the top-level container. It can hold more than one tree, and it's the real security boundary. A forest can contain several domains sitting under one top-level namespace.
- Organizational Units (OUs) are the containers inside a domain that hold users, groups, computers, and other OUs. They exist mostly so admins can organize and delegate.
- Nested groups create hidden privilege chains. A normal user can end up in a group that's in a group that eventually grants Domain Admin, and nobody notices because the path is three hops deep.
- SYSVOL over SMB has to stay reachable. Every machine pulls its policy from a share on the DC using SMB, so that door can't be closed, and valid credentials plus that open door is often enough to reach the DC.
- Legacy protocols like NetBIOS and LLMNR are still on by default for backward compatibility. They broadcast name-resolution requests across the local network, and an attacker who's just listening can catch usernames and hashes without touching anything.
How Kerberos actually authenticates you
Kerberoasting
AS-REProasting
Kerberos delegation and the S4U extensions
- Unconstrained delegation. The service (a user account with an SPN, or a machine account) can impersonate a user toward any service. This is the dangerous one. When a user authenticates to a box with unconstrained delegation, their TGT gets cached on that box, and whoever controls the box can reuse it anywhere.
- Constrained delegation. The service can impersonate a user, but only toward a specific, whitelisted set of services. Narrower, safer.
- Resource-based constrained delegation (RBCD). The control flips. Instead of the delegation being defined on the service doing the impersonating, it's defined on the target resource. The target computer object carries an LDAP attribute, msDS-AllowedToActOnBehalfOfOtherIdentity, and whichever accounts are listed there are allowed to impersonate any user toward it. This matters because if you can write that attribute on a machine, you can grant yourself the right to impersonate an admin to it.
- S4U2Self lets a service get a ticket in a user's name toward itself. It only produces a forwardable ticket when protocol transition is configured.
- S4U2Proxy lets a service get a ticket in a user's name toward another service.
Passwords left lying around in SYSVOL (GPP)
Credentials sitting in file shares
Credentials in object properties
Editable GPOs
Coercion and relay: NTLM
Kerberos relay through unconstrained delegation
- Add a DNS record that points at your machine.
- Add an SPN (for example CIFS/...) to the service account's SPN list.
- Start the krbrelayx listener with the service account's hash, so it can decrypt the TGS you're about to receive and extract the TGT inside it.
The Printer Bug
- Relay to another DC and DCSync. DCs trust each other's machine accounts for replication, so relaying DC1$ to DC2's LDAP lets you call the replication RPCs and dump hashes. Needs SMB signing disabled on the target.
- Force the DC to authenticate to a machine with unconstrained delegation, cache the forwarded TGT in LSASS, and export it with Rubeus or Mimikatz (sekurlsa::tickets /export).
- Relay to AD CS (ESC8). Relay the DC's auth to the Certificate Authority's HTTP enrollment endpoint, request a certificate as DC$, then use that cert for PKINIT to get a TGT. Stealthy, and it exploits web enrollment without channel binding.
- Relay to LDAP to configure RBCD. Write msDS-AllowedToActOnBehalfOfOtherIdentity on a computer object you control, then use S4U to impersonate an admin to it.
Owning the domain: DCSync and Golden Tickets
Into the cloud: Entra ID roles versus Azure RBAC
Managed identities
- System-assigned identities are tied to a single resource and die with it.
- User-assigned identities are standalone and can be attached to several resources at once.
Directory synchronization models
- PHS (Password Hash Synchronization). The on-prem NT hash is itself hashed again before syncing: a per-user salt plus a thousand iterations of HMAC-SHA256, and that final value is what lands in the tenant alongside the user. Authentication happens in the cloud.
- PTA (Pass-Through Authentication). Passwords are validated on-prem through a lightweight agent, so the cloud never holds the credential material.
- ADFS / federation. An on-prem federation server issues the SAML tokens, and the cloud trusts them.
Purple teaming in Azure
- Entra ID sign-in logs and audit logs.
- Microsoft Graph activity logs.
- Azure Activity logs for control-plane operations on resources.
- Microsoft Defender logs, feeding into Sentinel as the SIEM that ties it all together.
The C2 plumbing: redirectors and frameworks
- Malleable C2 profiles shape the beacon's traffic to imitate normal web requests.
- Jitter and sleep on the beacon break up the regular check-in rhythm that makes automated detection easy.
- Encryption on the C2 channel.
- Domain fronting to blend the real destination behind a trusted front.
- Chaining redirectors so no single hop exposes the team server.
- Avoiding the default IOCs that ship with tools, since out-of-the-box profiles and certificates are exactly what signatures look for.


