Evading Microsoft ATA for Active Directory Domination

Nikhil Mittal

BruCON 0x09 · Day 1

Overview

In this insightful talk from BruCON, security researcher Nikhil Mittal dives deep into the mechanisms of Microsoft Advanced Threat Analytics (ATA), a prominent detection solution designed to identify sophisticated attacks against Active Directory (AD). Mittal demonstrates how common lateral movement and domain persistence techniques, often flagged by ATA, can be subtly altered to evade detection. The presentation focuses on understanding ATA's detection logic—specifically its reliance on identifying anomalous protocol behavior—and then crafting attack methods that appear "normal" to the system.

Watch on YouTube

Visual summary for Evading Microsoft ATA for Active Directory Domination by Nikhil Mittal
Visual summary for Evading Microsoft ATA for Active Directory Domination by Nikhil Mittal

Key moments

  1. 0:00 Introduction to Microsoft ATA and its architecture
  2. 7:40 Bypassing Active Directory reconnaissance detection
  3. 15:45 Evading Overpass-the-Hash using AES keys
  4. 21:00 Golden Ticket bypasses: AES keys and non-existent users
  5. 27:30 Code execution methods to avoid ATA detection
  6. 35:20 Attacking ATA deployment: MongoDB access and alert tampering
  7. 44:00 General advice for silent Active Directory attacks

Evading Microsoft ATA for Active Directory Domination

Speakers: Nikhil Mittal

Conference: BruCON

YouTube: https://www.youtube.com/watch?v=5gu4r-IDDwU

Overview

In this insightful talk from BruCON, security researcher Nikhil Mittal dives deep into the mechanisms of Microsoft Advanced Threat Analytics (ATA), a prominent detection solution designed to identify sophisticated attacks against Active Directory (AD). Mittal demonstrates how common lateral movement and domain persistence techniques, often flagged by ATA, can be subtly altered to evade detection. The presentation focuses on understanding ATA's detection logic—specifically its reliance on identifying anomalous protocol behavior—and then crafting attack methods that appear "normal" to the system.

The talk is crucial for both red teamers seeking to enhance their stealth capabilities and blue teamers aiming to strengthen their defenses against advanced adversaries. By dissecting ATA's inner workings, Mittal exposes not only its detection blind spots but also potential vulnerabilities within the ATA infrastructure itself. This provides a roadmap for defenders to configure ATA more robustly and for attackers to refine their tactics to achieve Active Directory domination without triggering alerts.

Mittal, known for his open-source tools Kautilya and Nishang, draws upon extensive lab testing with ATA version 1.8, showcasing practical bypasses for well-known attacks like Overpass-the-Hash and Golden Ticket. His analysis underscores the constant cat-and-mouse game between offensive and defensive security, highlighting the importance of understanding underlying protocol behaviors to effectively counter advanced threats.

Background

▶ Watch: Introduction to Microsoft ATA and its architecture (0:00)

Microsoft Advanced Threat Analytics (ATA) is a security platform designed to detect advanced persistent threats and insider threats targeting Active Directory environments. Its primary function is to analyze network traffic to and from Domain Controllers (DCs), looking for suspicious activities, known attack patterns, and abnormal user behaviors. ATA achieves this by monitoring protocols such as LDAP, Kerberos, and DNS, building a behavioral profile for users and entities within the domain. Any deviation from these established baselines, or specific signatures of known attacks, triggers an alert in the ATA console.

The typical deployment architecture for ATA involves ATA Gateways and an ATA Center. Gateways can be deployed directly on Domain Controllers as a "Lightweight Gateway" service or on separate boxes, where they receive mirrored network traffic from the DCs. This traffic is then analyzed by the Gateway, and relevant data is forwarded to the ATA Center, which houses a database (specifically MongoDB) to store profiles, suspicious activities, and other critical information. The ATA Center is where security analysts monitor alerts and investigate potential breaches.

The problem ATA aims to solve is the increasing sophistication of AD attacks, which often involve lateral movement, privilege escalation, and persistence techniques that traditional signature-based security tools might miss. Attacks like Pass-the-Hash, Overpass-the-Hash, and Golden Ticket are particularly problematic because they leverage legitimate protocols and credentials, making them difficult to distinguish from normal activity without deep behavioral analysis. Mittal's research highlights that while ATA is a significant step forward, its detection logic, especially for protocol anomalies, can be understood and subsequently circumvented by attackers who meticulously craft their attack traffic to mimic legitimate interactions. The talk specifically focuses on ATA version 1.8, the latest available at the time of the presentation.

Key Findings

▶ Watch: Evading Overpass-the-Hash using AES keys (15:45)

Nikhil Mittal's research into ATA 1.8 reveals several critical findings regarding its detection capabilities and bypasses:

  1. Protocol Anomaly Reliance: ATA's primary detection mechanism for many common attacks relies on identifying specific, predictable anomalies in network protocol traffic. By understanding these specific anomaly triggers, attackers can modify their tools or techniques to avoid them.
  2. Reconnaissance Evasion: Basic reconnaissance activities, such as enumerating users or computers, are detected by ATA only when performed invasively against a Domain Controller using specific protocols (e.g., SMB session enumeration). Leveraging less intrusive methods like LDAP queries (via tools like PowerView) or targeting non-DC machines for SMB sessions can completely bypass these detections.
  3. Kerberos Attack Bypasses (Overpass-the-Hash, Golden Ticket): ATA detects these attacks by identifying downgraded encryption types (e.g., RC4-HMAC-MD5) in Kerberos AS_REQ or TGS_REQ packets. The key finding is that by using AES keys (AES-128, AES-256) alongside NTLM hashes when crafting Kerberos tickets with tools like Mimikatz, the traffic appears "normal" to ATA, thus evading detection.
  4. Golden Ticket Non-Existent User Bypass: A peculiar finding is that creating a Golden Ticket with a non-existent username can bypass ATA detection, regardless of the encryption type used. Mittal speculates this might be due to ATA's learning phase not establishing a profile for such an entity.
  5. Time-Based Golden Ticket Detection & Evasion: ATA 1.8 introduced time-based detection for Golden Tickets, flagging tickets used beyond their valid lifetime. This can be bypassed by injecting tickets directly into the current session's memory (/ptt in Mimikatz) and purging them, or by forging the ticket's creation time to be in the future.
  6. Code Execution Evasion: Certain remote code execution methods, specifically PowerShell Remoting, DCOM, and DLL loading, were not detected by ATA 1.8, unlike more common methods such as Scheduled Tasks, PSExec, or WMI.
  7. Avoiding DC Interaction: Attacks that minimize or entirely avoid direct communication with the Domain Controller, such as Silver Ticket and Kerberoasting, inherently bypass ATA's monitoring capabilities because the traffic is either normal or not seen by the ATA Gateway.
  8. ATA's Internal Security Flaws: The ATA Center, particularly its underlying MongoDB database, was found to lack strong internal security. MongoDB uses no password by default (listening on local loopback), allowing anyone with administrative access to the ATA Center to directly manipulate the database. This enables attackers to misattribute alerts to other users or completely suppress alerts from the console without leaving a trace.
  9. Behavioral Anomaly Detection Limitations: While ATA boasts User Behavior Analytics (UBA), Mittal observed that in his lab environment, triggering behavioral alerts (e.g., abnormal modification of sensitive groups) was less consistent or frequent compared to protocol anomaly detections, suggesting potential gaps or a higher false positive threshold.

These findings collectively demonstrate that while ATA provides valuable visibility, its specific detection mechanisms can be systematically analyzed and bypassed by a determined adversary, particularly if they gain administrative access to the ATA infrastructure itself.

Technical Deep Dive

▶ Watch: Golden Ticket bypasses: AES keys and non-existent users (21:00)

Mittal’s presentation meticulously breaks down ATA’s detection logic for various attack types and provides specific technical methods for evasion.

Reconnaissance Evasion

ATA detects reconnaissance activities primarily through SMB session enumeration against the Domain Controller. The alert specifically states "SMB session enumeration attempts were successfully performed by some user from some box against the domain controller." This specificity is key to the bypass.

  • ATA Detection Trigger: Commands like net user /domain or net group /domain that rely on SMB session enumeration against the DC.
  • Technical Bypass:
  1. Leverage LDAP: Instead of SMB, use tools that query Active Directory via LDAP (e.g., PowerView's Get-NetUser, Get-NetComputer, Get-NetGroup). LDAP is considered normal traffic for information gathering and does not trigger ATA alerts, as long as the queries are not excessively noisy or abnormal in volume/frequency (which could trigger UBA).
  2. Target Non-DCs: For more invasive enumeration methods like user hunting (e.g., Invoke-UserHunter), avoid targeting Domain Controllers. An attacker can first compile a list of all member computers in the domain, then filter out the DCs, and finally run Invoke-UserHunter against the remaining non-DC machines. This prevents ATA from seeing SMB session enumeration attempts against its monitored DCs.

Overpass-the-Hash Evasion

Overpass-the-Hash (also known as Kerberos ticket forging from NTLM hashes) is a core lateral movement technique. ATA detects this by observing a downgraded encryption type (E-Type) in the AS_REQ (Authentication Service Request) packet. When an NTLM hash is used to forge a Kerberos ticket, the resulting AS_REQ often uses a weaker encryption type like RC4-HMAC-MD5, whereas normal Kerberos requests typically use stronger AES-256 or AES-128 encryption.

  • ATA Detection Trigger: The encryption method of the encrypted timestamp field of AS_REQ message has been downgraded based on previously learned behavior.
  • Technical Bypass:
  1. Use AES Keys: Instead of solely relying on the NTLM hash, attackers should use Mimikatz to forge tickets with AES-128 and AES-256 keys alongside the NTLM hash. Mimikatz commands for this would include parameters for /aes128 and /aes256. By providing these stronger keys, the forged AS_REQ packet will appear to use the expected, stronger encryption type, making the traffic look normal to ATA. Mittal emphasizes using all three keys (NTLM, AES128, AES256) to ensure consistent normalcy. This requires obtaining these keys, typically from the KRBTGT account or other privileged accounts.

Golden Ticket Evasion

The Golden Ticket attack, which involves forging a Ticket Granting Ticket (TGT) for any user, granting them arbitrary privileges (typically Domain Admin), is another critical persistence mechanism. ATA detects Golden Tickets similarly to Overpass-the-Hash, by observing encryption downgrades in TGS_REQ (Ticket Granting Service Request) messages.

  • ATA Detection Trigger (Old): The encryption method for the TDD field of TGS_REQ method has been downgraded from previously learned behavior.
  • Technical Bypass (Encryption Downgrade):
  1. Use AES Keys: Similar to Overpass-the-Hash, when creating a Golden Ticket with Mimikatz, provide the AES-128 and AES-256 keys of the KRBTGT account in addition to its NTLM hash. This ensures the forged TGS_REQ uses strong encryption, bypassing the E-Type downgrade detection.
  2. Non-Existent Username: A surprising bypass involves creating a Golden Ticket for a non-existent username. Mittal suggests this might work because ATA's learning period (4 weeks for behavior, 1 week for anomaly detection) might not have established a profile for such an entity. Without a baseline, the anomaly might not be recognized.
  • ATA Detection Trigger (New in 1.8): Golden Ticket activity with a time-based component, e.g., the ticket was used for a period of 13 hours which exceeded the allowed maximum of one hour. This indicates ATA 1.8 now tracks ticket lifetime.
  • Technical Bypass (Time-Based):
  1. Inject and Purge (/ptt): The recommended method is to use Mimikatz's /ptt (Pass-the-Ticket) option to inject the Golden Ticket directly into the current session's memory. Crucially, once the desired actions are completed, the ticket should be purged from memory. This prevents the ticket from persisting and exceeding its valid lifetime on the target system.
  2. Forge Creation Time: For situations where saving to disk is desired, Mimikatz offers options like /startoffset to set a specific creation time for the ticket, effectively allowing an attacker to forge a ticket with a future creation time, thus preventing immediate time-based detection upon reuse.

Avoiding DC Interaction

Some attacks can entirely avoid ATA detection by minimizing or eliminating communication with the Domain Controller.

  • Code Execution:
  • Undetected: PowerShell Remoting, DCOM, and DLL loading (e.g., injecting Mimikatz via a reflective DLL) were not detected by ATA 1.8 for remote code execution. This allows an attacker to execute commands on a DC without triggering an alert.
  • Detected: Methods like Scheduled Tasks, PSExec, and WMI are detected, often with low-priority alerts.
  • Silver Ticket: This attack involves forging a service ticket (TGS) for a specific service (e.g., CIFS for file access) on a target server. Because the forged ticket is used directly with the service server, there is minimal to no communication with the DC that ATA would monitor, making it inherently stealthy.
  • Kerberoasting: This attack involves requesting Service Principle Names (SPNs) for services configured with user accounts, which returns TGS tickets. These tickets can then be brute-forced offline to recover the service account's NTLM hash. The initial TGS request to the DC (event ID 4769) is a normal operation and typically generates thousands of logs daily, making it indistinguishable from legitimate traffic for ATA.

ATA's Internal Vulnerabilities

Mittal also uncovered critical security shortcomings within ATA itself:

  • MongoDB No Password: The MongoDB database used by the ATA Center to store all profiles and suspicious activities listens only on the local loopback interface but has no password configured by default.
  • Impact: Any attacker who gains administrative access to the ATA Center server can directly connect to the MongoDB instance.
  • Attack Scenarios:
  1. Misattribution: By modifying the source account ID in the MongoDB collections, an attacker can change the reported source of a suspicious activity, attributing it to an innocent user (lab user in the demo) rather than the actual attacker. This leaves no trace in ATA's logs.
  2. Alert Suppression: Attackers can set the is visible attribute of any suspicious activity record in the database to false. This causes the alert to disappear entirely from the ATA console, again without any logs or audit trail within ATA itself.

These vulnerabilities mean that a successful Domain Admin compromise can lead to a complete compromise of ATA's monitoring capabilities, allowing attackers to operate undetected.

Demo / Proof of Concept

▶ Watch: Attacking ATA deployment: MongoDB access and alert tampering (35:20)

During the talk, Nikhil Mittal utilized a live ATA console (version 1.8) deployed in his lab environment. He described the process of setting up this lab, where over 450 students and professionals had attempted various attacks, providing a rich dataset for ATA's learning and detection.

The speaker first demonstrated how ATA's detection for reconnaissance activities, specifically SMB session enumeration, appears in the console, highlighting the alert message that specifies the enumeration attempts were made "against the domain controller." He then explained the bypass using tools like PowerView for LDAP queries or targeting non-DC machines, though a full live demo of this specific bypass was not performed due to the potential slowness of the lab environment during the presentation.

For the Overpass-the-Hash and Golden Ticket bypasses, Mittal described the technical steps in detail, emphasizing the use of AES keys with Mimikatz. While a full live demo of Mimikatz execution and subsequent lack of ATA detection was intended, the speaker noted the painfully slow network conditions in the conference environment and opted to describe the expected outcome, showing screenshots of the ATA console where no detection occurred after these modified attacks. He also visually walked through the time-based Golden Ticket detection introduced in ATA 1.8 and explained the /ptt and time-forging bypasses.

Crucially, Mittal showcased the vulnerabilities within the ATA Center's MongoDB database. He explained how, with administrative access to the ATA Center server, an attacker could connect to MongoDB and manipulate alert visibility. He walked through the concept of changing the is visible attribute of an alert to false directly in the database, causing it to disappear from the ATA console without a trace. He also explained how to change the source account ID for misattribution. While a full live execution of these database manipulations was constrained by time and network, the detailed explanation made the proof-of-concept clear.

The demonstrations, despite some live environment limitations, effectively illustrated ATA's detection mechanisms and the efficacy of the presented bypasses, providing concrete examples of how attackers can operate stealthily within an ATA-monitored environment.

Defensive Implications

▶ Watch: General advice for silent Active Directory attacks (44:00)

The detailed bypasses and vulnerabilities presented by Nikhil Mittal offer critical insights for defenders looking to strengthen their Active Directory security posture and optimize their Microsoft Advanced Threat Analytics (ATA) deployments.

  1. Rethink ATA Deployment Architecture:
  • Isolate ATA: The most significant recommendation is to deploy the ATA Center and Gateways outside the domain if possible. While Microsoft typically recommends integrating ATA into the domain for ease of management (e.g., patch management), Mittal highlights that if ATA is a domain member, a Domain Admin compromise directly leads to ATA compromise. Isolating ATA makes it an independent security boundary, though it introduces challenges for patch management and authentication. This is a crucial trade-off to consider based on an organization's risk tolerance.
  • Secure ATA Center Server: Regardless of domain membership, the ATA Center server must be treated as a highly sensitive asset. Implement stringent access controls, monitor all activity on the server, and ensure it is hardened according to best practices.
  1. Harden ATA's Internal Components:
  • MongoDB Password: Microsoft should implement a password for the MongoDB database. Until then, defenders must be aware that any administrative access to the ATA Center allows direct manipulation of alerts. Implement robust auditing and logging for direct database access or changes to critical ATA files and services.
  • Audit Trail for DB Tampering: There should be an audit trail for any direct manipulation of alerts within the MongoDB database. Defenders should push for this feature from Microsoft or implement their own monitoring solutions around the MongoDB instance.
  1. Enhance Kerberos Security:
  • Enforce AES: Since many Kerberos-based attacks (Overpass-the-Hash, Golden Ticket) are bypassed by using AES keys, organizations should strive to enforce AES-only Kerberos encryption where possible. This requires careful planning and testing but can mitigate the effectiveness of attacks relying on weaker RC4-HMAC-MD5 encryption.
  • Protect KRBTGT: The KRBTGT account is the crown jewel for Golden Ticket attacks. Implement the highest level of security for this account, including regular password rotation (twice, to generate a new key and invalidate the old one), strong auditing, and restricting access to its hash/keys.
  1. Refine Reconnaissance Monitoring:
  • ATA's SMB session enumeration detection is effective but limited to DCs. Defenders should implement supplemental monitoring for LDAP-based reconnaissance (e.g., unusually high volumes of queries from specific accounts or IPs, queries for sensitive attributes) and SMB enumeration against non-DC machines.
  1. Strengthen Code Execution Defenses:
  • Since PowerShell Remoting, DCOM, and DLL loading can bypass ATA, organizations must implement robust controls around these methods. This includes:
  • Constrained Language Mode for PowerShell.
  • JIT (Just-in-Time) Administration for privileged accounts.
  • Application Whitelisting (e.g., AppLocker, Windows Defender Application Control) to prevent unauthorized DLLs and scripts.
  • Enhanced logging for PowerShell, DCOM, and process injection events.
  1. Account for ATA's Learning Period:
  • Be aware of ATA's 1-week anomaly detection and 4-week behavior learning periods. During these times, new entities or newly deployed ATA instances may have reduced detection capabilities. Implement alternative monitoring during this phase and consider that attackers might leverage new accounts or new machines to evade initial detection.
  1. Focus on Behavioral Anomalies and Beyond:
  • While protocol anomaly detection can be bypassed, ATA's User Behavior Analytics (UBA) still offers value. Defenders should investigate and tune UBA alerts, even if they are less frequent in lab environments.
  • Layered Security: ATA is a powerful tool, but it's not a silver bullet. Combine ATA with other security controls like Endpoint Detection and Response (EDR), Security Information and Event Management (SIEM), network segmentation, and robust identity and access management.
  1. Red Team Emulation for Improved Blue Team:
  • Organizations should encourage red teams to use these bypasses during assessments. This provides valuable feedback to blue teams, helping them to tune ATA, identify gaps in other controls, and improve overall detection and response capabilities.

Key Takeaways

  • Understand ATA's Detection Logic: Many of ATA's primary detections rely on specific protocol anomalies (e.g., downgraded Kerberos encryption, SMB enumeration against DCs). Knowing these triggers is crucial for both bypassing and defending.
  • "Normal" Traffic Evades Detection: By modifying attack techniques to make their traffic appear "normal" (e.g., using AES keys for Kerberos attacks, leveraging LDAP for recon), attackers can effectively bypass ATA's anomaly-based detections.
  • Avoid Domain Controller Interaction: Attacks that minimize or entirely bypass direct communication with the Domain Controller (e.g., Silver Ticket, Kerberoasting) inherently evade ATA's monitoring capabilities.
  • ATA's Own Security is Critical: The ATA Center's internal components, particularly the MongoDB database lacking a password, present a significant attack surface. A compromised ATA Center allows attackers to suppress alerts or misattribute activities, rendering the system useless.
  • Layered Defense is Essential: While ATA provides valuable visibility, it is not foolproof. It must be complemented with other security controls, robust auditing, and careful deployment strategies to provide comprehensive protection against sophisticated AD attacks.
  • Behavioral Detection Needs Tuning: While ATA includes User Behavior Analytics, its efficacy in triggering alerts for abnormal user behavior may vary and requires careful tuning and monitoring in real-world environments.

About the Speaker(s)

Nikhil Mittal is a renowned security researcher and red teamer, best known for his expertise in offensive security and Active Directory attacks. He describes himself as a "hacker" who specializes in breaking systems, always with permission. Mittal is a prolific contributor to the open-source community, maintaining two popular toolkits: Kautilya, designed for programming human-faced devices to perform interesting actions, and Nishang, a comprehensive framework and collection of PowerShell scripts used across various phases of security assessments. He regularly shares his research and insights on his blog, labofapenetrationtester.com. Mittal is a frequent speaker at major security conferences worldwide, including prestigious events such as DEFCON, Black Hat Vegas, BruCON, and various other European conferences. His work consistently focuses on discovering new methods to penetrate environments and evade countermeasures.

Reviews

  • Dr. Zero (Offensive Security Researcher) — MUST SEE ★★★★★

→ Top-rated talks at BruCON 0x09

All talks from BruCON 0x09