Automated adversary emulation using Caldera

Erik Van Buggenhout (NVISO)

BruCON 0x0B · Day 1

Overview

In this BruCON 2019 presentation, Erik Van Buggenhout, a Senior Security Consultant at NVISO, delves into the critical need for automated adversary emulation in modern cybersecurity. The talk primarily focuses on Caldera, an open-source adversary emulation platform developed by MITRE, designed to empower blue teams to proactively test and enhance their detection capabilities against realistic threats. Van Buggenhout highlights the shift from traditional penetration testing and red teaming, which often focus solely on prevention or assessment, towards a more collaborative purple teaming approach centered on continuous improvement of an organization's defensive posture.

Watch on YouTube

Visual summary for Automated adversary emulation using Caldera by Erik Van Buggenhout
Visual summary for Automated adversary emulation using Caldera by Erik Van Buggenhout

Key moments

  1. 0:00 Introduction: Speaker, NVISO, and talk overview
  2. 2:00 Defining Adversary Emulation vs. Pen Testing
  3. 6:00 Red vs. Purple Teaming: Collaborative Security
  4. 16:00 Overview of Adversary Emulation Tools
  5. 24:00 Introducing Caldera: Automated Adversary Emulation
  6. 32:00 Live Demo: Running a basic Caldera operation
  7. 42:00 Customizing Caldera: Abilities & Plugins
  8. 56:00 Caldera's Strategic Role in Purple Teaming

Automated adversary emulation using Caldera

Speakers: Erik Van Buggenhout, Senior Security Consultant, NVISO

Conference: BruCON

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

Overview

In this BruCON 2019 presentation, Erik Van Buggenhout, a Senior Security Consultant at NVISO, delves into the critical need for automated adversary emulation in modern cybersecurity. The talk primarily focuses on Caldera, an open-source adversary emulation platform developed by MITRE, designed to empower blue teams to proactively test and enhance their detection capabilities against realistic threats. Van Buggenhout highlights the shift from traditional penetration testing and red teaming, which often focus solely on prevention or assessment, towards a more collaborative purple teaming approach centered on continuous improvement of an organization's defensive posture.

Van Buggenhout, drawing from his extensive background in penetration testing and red teaming, emphasizes that while red teams are excellent at finding vulnerabilities and gaining access, their primary purpose should be to make blue teams better. The challenge, however, lies in making these assessments repeatable, measurable, and directly actionable for defenders. This talk addresses that gap by showcasing how Caldera can automate the execution of Tactics, Techniques, and Procedures (TTPs), derived from frameworks like MITRE ATT&CK, thereby providing a structured and consistent method for assessing an organization's resilience against known adversary behaviors.

The core message is that effective defense requires understanding an adversary's methods and continuously validating whether existing security controls can prevent or detect them. Caldera offers a powerful solution by providing a platform to simulate these TTPs in a controlled environment, allowing blue teams to identify gaps in their logging, alerting, and incident response processes. Van Buggenhout's presentation serves as both an introduction to Caldera's capabilities and a call to action for the security community to contribute to its development, ultimately fostering stronger, more resilient defensive strategies.

Background

▶ Watch: Introduction: Speaker, NVISO, and talk overview (0:00)

The landscape of cybersecurity testing has evolved significantly, moving beyond rudimentary vulnerability scanning and even traditional penetration testing. Van Buggenhout distinguishes these activities from adversary emulation, a more sophisticated approach aimed at replicating the behaviors of real-world threat actors. Vulnerability scanning, while useful, merely identifies potential weaknesses. Penetration testing, even when exploiting vulnerabilities with tools like Metasploit, often operates within a defined scope and primarily focuses on prevention, not necessarily on how an actual adversary would operate or how effectively an organization can detect them. Red teaming comes closer but can sometimes stray into "crazy creative" exploits that, while effective, may not accurately reflect the TTPs of a specific, relevant adversary.

The critical differentiator for adversary emulation is its focus on realism. It's about understanding "who the adversary is to your environment or your organization" and then using their known TTPs to assess resilience. This concept is heavily underpinned by the MITRE ATT&CK framework, which Van Buggenhout describes as essential knowledge for anyone in modern cybersecurity. ATT&CK provides a globally accessible knowledge base of adversary tactics and techniques based on real-world observations, even linking them to specific threat groups (e.g., APT28, APT29).

The shift towards purple teaming is integral to this background. Traditional red-versus-blue engagements, while valuable for assessment, often lack a direct feedback loop, hindering the blue team's continuous improvement. Purple teaming, in contrast, promotes collaboration, with red and blue teams working side-by-side to test techniques, identify detection gaps (e.g., missing logs or use cases), and immediately implement fixes. This iterative process, guided by frameworks like ATT&CK, necessitates tools that can reliably and repeatedly execute adversary techniques, laying the groundwork for automated solutions like Caldera. The need for such automation stems from the difficulty of manually performing and reproducing complex emulation plans, especially when assessing detection capabilities over time.

Key Findings

▶ Watch: Red vs. Purple Teaming: Collaborative Security (6:00)

The presentation highlights several key findings regarding the state of adversary emulation and the specific contributions of Caldera:

  1. Distinction of Emulation from Traditional Testing: A primary finding is the clear differentiation between adversary emulation and other security testing methodologies. Van Buggenhout explicitly states that vulnerability scanning, general penetration testing, and even some "creative" red teaming activities do not qualify as true adversary emulation. The latter requires a focus on realistic adversary TTPs, a defined threat actor, and a dual emphasis on both prevention and detection capabilities, rather than just identifying exploitable vulnerabilities within a limited scope.
  1. MITRE ATT&CK's Role and Nuances: While MITRE ATT&CK is lauded as an indispensable resource, Van Buggenhout stresses that it's not a "Holy Trinity." He points out that ATT&CK has gaps and that not all techniques are of equal value or complexity. His detailed example of credential dumping illustrates this, showing that a single ATT&CK technique can encompass ten different attack vectors (e.g., SAM file extraction, registry hive dumping, cached credentials, DC Sync via MS-DRSR protocol) and require ten different detection methods. This emphasizes the need for granular testing and understanding beyond a simple "covered/not covered" binary assessment.
  1. Limitations of Existing Emulation Tools: Van Buggenhout reviews several tools, including Atomic Red Team, a lesser-known tool developed by Chris Gates, Infection Monkey, Sliver, and Covenant. While each has merits, he identifies their limitations in achieving structured, repeatable, and controlled adversary emulation.
  • Atomic Red Team is excellent for simple, manual tests but lacks orchestration.
  • Infection Monkey, despite its lateral movement capabilities, is "uncontrolled" and lacks the logic for targeted purple team engagements.
  • Advanced C2 frameworks like Covenant (a C# focused successor to PowerShell Empire) are powerful for manual red teaming but don't inherently provide the automation needed for continuous blue team improvement.
  • The general finding is that most existing tools lean either towards manual execution or uncontrolled, unstructured "monkey-like" behavior, making repeatability and precise blue team feedback challenging.
  1. Caldera's Structured Automation as a Solution: Caldera emerges as the primary solution to these challenges. Its design provides a structured, automated, and repeatable way to execute ATT&CK-mapped TTPs. Key findings about Caldera include:
  • Agent-based Execution: Caldera deploys agents (implants) to target systems, which then execute defined abilities (techniques). This pre-deployment model means Caldera focuses on post-initial access activities, not initial intrusion.
  • Modular Design: Its core components like abilities, groups, and adversaries allow for highly customizable emulation plans. An adversary consists of phases, each executing specific abilities.
  • Open-Source and Extensible: Developed by MITRE and open-source, Caldera encourages community contributions. The ability to develop custom abilities (e.g., using PowerShell or Python) and custom plugins (like NVISO's ATT&CK Navigator export) significantly enhances its utility and adaptability.
  • Focus on Detection: Critically, Caldera is designed to help blue teams detect techniques, not necessarily to evade detection of the agent itself. This is evident in the acknowledgement that modern defenses like AMSI (Anti-Malware Scan Interface) and Constrained Language Mode will catch common PowerShell-based attacks like Invoke-Mimikatz, prompting the need for alternative, potentially stealthier, abilities (e.g., using procdump).
  1. Importance of Customization and Repeatability: The live demos underscore the finding that out-of-the-box abilities might not always work (e.g., an outdated Invoke-Mimikatz.ps1 version failing). This reinforces the need for users to customize abilities and payloads to match their specific environment and threat model. The ability to run operations repeatedly and track results over time is presented as a fundamental step towards measurable defensive improvement.

Technical Deep Dive

▶ Watch: Introducing Caldera: Automated Adversary Emulation (24:00)

Caldera, developed by MITRE, is a Python-based framework designed for automated adversary emulation. Its architecture is built around several core concepts that facilitate structured and repeatable testing of defensive capabilities.

At its heart, Caldera operates with agents (or implants) that are deployed onto target systems. These agents are responsible for executing specific actions, termed abilities. Unlike traditional C2 frameworks focused on initial compromise, Caldera assumes an agent is already present, making its primary focus post-exploitation TTPs. The agents are cross-platform, supporting Windows, macOS, and Linux, and communicate back to the Caldera server (C2) to receive commands and report results. The speaker demonstrates deployment on Windows systems, noting that the agent often uses PowerShell for execution on Windows.

Central to Caldera's functionality are abilities. An ability represents the execution of a single technique or sub-technique, often mapped directly to a MITRE ATT&CK ID. Each ability is defined in a YAML file, specifying:

  • A unique UUID (e.g., credential.xst.01003). This UUID is crucial for referencing abilities in operations, as there's no name-based dropdown in the GUI.
  • The actual command to be executed (e.g., a PowerShell command to download and run Invoke-Mimikatz.ps1).
  • The platform it applies to (e.g., windows, linux).
  • The executor (e.g., powershell).
  • Potential payloads (e.g., Invoke-Mimikatz.ps1, procdump64.exe) that the agent needs to download or access.

For instance, a built-in ability for credential dumping might involve:

However, the speaker highlights that such a straightforward command often runs into modern defensive hurdles. On Windows, AMSI (Anti-Malware Scan Interface) and Constrained Language Mode in PowerShell are highly effective at detecting and blocking malicious scripts like Invoke-Mimikatz. This limitation underscores that Caldera's purpose is to test detection, not necessarily evade it. It forces blue teams to consider more sophisticated or alternative techniques, such as using legitimate tools.

This leads to the concept of custom abilities and payloads. Van Buggenhout illustrates how to create a custom ability to use Sysinternals procdump instead of Invoke-Mimikatz for LSA memory dumping. This involves:

  1. Defining a new YAML ability that executes procdump64.exe to dump the lsass.exe process (e.g., procdump64.exe -accepteula -ma lsass.exe C:\Users\Public\Libraries\lsass.dmp).
  2. Placing the procdump64.exe binary in Caldera's payloads directory, making it available for the agent to download or use.

This demonstrates how defenders can simulate more subtle adversary behaviors that might bypass initial, signature-based detections.

Adversaries in Caldera are collections of abilities organized into sequential phases. An emulation plan, such as MITRE's APT3 emulation plan, can be translated into a Caldera adversary, with each phase representing a stage of an attack (e.g., initial access, lateral movement, collection, exfiltration). The speaker shows the "Nosy Neighbor" adversary, a built-in example that runs a wide array of noisy techniques.

Groups allow for logical segmentation of target systems. Agents can be assigned to specific groups (e.g., windows, linux, domain controllers), enabling targeted operations. This is crucial for testing different segments of an environment or simulating attacks against specific asset types.

Facts are pieces of information that Caldera can use during operations, such as usernames, passwords, or specific file paths. These can be used by abilities (e.g., for brute-forcing or credential reuse) and can even be discovered by abilities and then used in subsequent steps, allowing for dynamic attack paths.

Finally, the speaker introduces the concept of plugins. Caldera's core chain plugin provides the main functionality. NVISO's custom callout plugin demonstrates extensibility, enabling the export of operation results into a JSON format compatible with the MITRE ATT&CK Navigator. This allows for a visual representation of tested techniques and their success/failure rates, providing immediate feedback on detection coverage. Developing plugins requires Python, as Caldera itself is written in Python. The process of adding new abilities or plugins often requires restarting Caldera and its database to ensure they are loaded correctly.

Demo / Proof of Concept

▶ Watch: Live Demo: Running a basic Caldera operation (32:00)

Erik Van Buggenhout provided two live demonstrations of Caldera, showcasing its capabilities and the process of setting up and running adversary emulation. The environment consisted of a Kali Linux machine hosting the Caldera server, connected to several target systems, including Windows 10, Windows Server 2008 (acting as a Domain Controller), and Ubuntu machines, all feeding logs into an Elastic Stack for monitoring.

Demo 1: Running a Built-in Adversary

The first demo focused on the core functionalities of Caldera's chain plugin:

  1. Groups: Van Buggenhout showed a list of connected agents categorized into groups (e.g., windows, linux). Each agent displayed its status, including its last check-in time.
  2. Abilities: He navigated through the extensive list of available abilities, organized by MITRE ATT&CK tactics (e.g., Collection, Credential Access, Execution). He highlighted simple examples like "Collect ARP Details" (a basic arp -a command) to illustrate how even simple commands are treated as abilities. He also showed more complex ones like "Run PowerSploit Mimikatz" (credential.xst.01003). The abilities are primarily PowerShell-driven on Windows.
  3. Adversaries: He demonstrated viewing pre-defined adversaries, such as the "Nosy Neighbor," which is designed to be very noisy and execute a broad range of techniques.
  4. Operations: To initiate emulation, he created an "Operation," selecting the "Nosy Neighbor" adversary and targeting all Windows machines. He enabled "cleanup" to remove artifacts post-execution. The live operation view showed each step as it was executed, providing real-time feedback on success or failure, along with the command output. For instance, clearing history on a Windows machine showed no output, while collecting ARP details displayed the full ARP table.

A key point from this demo was the attempted execution of Invoke-Mimikatz. The operation reported success (green status), but the output revealed an error: "secures acquired as a key import... I dumped credentials, no I didn't." Van Buggenhout clarified that this was not due to Credential Guard or LSASS protection, but rather an outdated Invoke-Mimikatz.ps1 script that required a newer version. This underscored the need for customization and ensuring abilities are up-to-date and effective in the target environment.

Demo 2: Custom Abilities and Plugin Integration

Building on the first demo's findings, Van Buggenhout demonstrated how to create custom abilities and integrate a custom plugin:

  1. Custom Ability with procdump: Instead of Invoke-Mimikatz, he introduced a custom ability to use Sysinternals procdump (a signed Microsoft tool) to dump the lsass.exe process memory. This ability was defined to run procdump64.exe -accepteula -ma lsass.exe C:\Users\Public\Libraries\lsass.dmp. He explained that procdump64.exe needed to be placed in Caldera's payloads directory.
  2. Database Restart: He noted that adding new abilities or plugins requires restarting the Caldera server and its database for them to be loaded.
  3. New Adversary and Operation: He created a new adversary with two phases:
  • Phase 1: Disable Windows Defender (using a PowerShell command).
  • Phase 2: Execute the custom procdump ability.

He ran this new operation against a single Windows 10 machine.

  1. Live Demo Challenges: During the live demonstration, the procdump ability initially failed to create the dump file, highlighting the common challenges of live demos (e.g., incorrect pathing, permissions). However, the intention was clear: to show how to use a more stealthy, legitimate tool for credential dumping as an alternative to Invoke-Mimikatz.
  2. Custom callout Plugin and ATT&CK Navigator: The most impactful part of the second demo was showcasing NVISO's custom callout plugin. This plugin allows users to export the results of an operation as a JSON file. Van Buggenhout then imported this JSON file into the MITRE ATT&CK Navigator. The Navigator visually represented the techniques that were executed, coloring them red (for successful execution) to show immediate coverage mapping. This demonstrated how Caldera, with custom plugins, can provide clear, actionable insights into an organization's detection capabilities against specific TTPs.

The demos, despite minor live hiccups, effectively illustrated Caldera's power in automating adversary emulation, customizing techniques, and integrating with other tools like the ATT&CK Navigator for visual feedback on defensive coverage.

Defensive Implications

▶ Watch: Caldera's Strategic Role in Purple Teaming (56:00)

Caldera offers profound implications for defensive security, fundamentally shifting how blue teams can test, measure, and improve their detection capabilities. The speaker emphasizes that Caldera is not a replacement for red teaming or even purple teaming, but rather a powerful tool to empower blue teams and make their efforts more effective and continuous.

  1. Continuous Detection Validation: Instead of relying on infrequent red team assessments, Caldera enables blue teams to continuously validate their detection controls. Organizations can run specific TTPs on a regular basis (e.g., quarterly) in a controlled test environment that mirrors production. By feeding logs from this test environment into their existing SIEM or Elastic Stack, blue teams can ascertain if their production detection rules would trigger as expected. This proactive approach helps identify detection gaps before a real adversary exploits them.
  1. Targeted Improvement and Prioritization: Caldera facilitates a data-driven approach to improving defenses. By mapping successful and failed abilities to the MITRE ATT&CK Navigator (especially with custom plugins like NVISO's callout), blue teams gain a visual understanding of their coverage. This visibility allows them to prioritize which techniques to focus on. Instead of trying to detect "everything," they can concentrate on the seven most prevalent techniques identified by Red Canary and Katie Nickels, or those commonly used by threat actors relevant to their organization (e.g., APT28, APT29).
  1. Granular Understanding of Techniques: The detailed example of credential dumping highlights that a single ATT&CK technique can have multiple variants, each requiring distinct detection methods (e.g., command-line logging for SAM file access vs. network traffic analysis for DC Sync). Caldera allows defenders to test these nuances individually, ensuring comprehensive coverage for complex techniques. It moves beyond a simplistic "yes/no" detection status to a more granular understanding of what is and isn't being caught.
  1. Testing Against Evolving Threats: As adversaries adapt, so too must defenses. Caldera's flexibility allows blue teams to quickly create custom abilities to simulate new or updated TTPs. For instance, if Invoke-Mimikatz is consistently blocked by AMSI, defenders can test alternatives like Sysinternals procdump to see if their controls detect this more subtle approach. This adaptability ensures that detection strategies remain relevant against evolving attack methodologies.
  1. Bridging the Red-Blue Knowledge Gap: Caldera helps democratize red team knowledge. Red teams can contribute their offensive techniques as Caldera abilities, which blue teams can then leverage and run independently, without needing deep offensive expertise. This fosters a better understanding of adversary tradecraft within the blue team, leading to more informed and robust defensive strategies.
  1. Repeatability and Measurable Progress: A core strength of Caldera is its repeatability. Manual red teaming often struggles with consistent reproduction of attacks. Caldera's automated nature ensures that the same techniques are executed identically each time, allowing for objective measurement of defensive improvements over time. This makes it possible to track metrics like "detection rate for lateral movement techniques" and demonstrate tangible progress to management.
  1. Training and Skill Development: Caldera provides an excellent platform for training blue team analysts. By observing live adversary emulation and analyzing the resulting logs, analysts can hone their hunting skills, learn to identify malicious patterns, and understand the indicators of compromise associated with specific ATT&CK techniques.

In summary, Caldera transforms adversary emulation from an ad-hoc, expert-driven activity into a structured, automated, and continuous process. It empowers blue teams to proactively identify, address, and measure gaps in their security controls, ultimately leading to a more resilient and mature defensive posture.

Key Takeaways

  • Adversary emulation is distinct from traditional testing: It focuses on realistic adversary TTPs, both prevention and detection, and a specific threat actor, moving beyond general vulnerability discovery.
  • MITRE ATT&CK is crucial but nuanced: While indispensable, ATT&CK techniques are not uniform (e.g., credential dumping has many variants), requiring granular testing and understanding for effective detection.
  • Caldera empowers blue teams through automation: It provides a structured, repeatable platform to execute ATT&CK-mapped techniques, enabling continuous validation of detection capabilities and proactive identification of defensive gaps.
  • Customization is key to effectiveness: Built-in abilities may not always work (e.g., outdated Invoke-Mimikatz), necessitating the creation of custom abilities and the use of alternative tools like Sysinternals procdump to simulate realistic and evolving adversary behaviors.
  • Integrate with existing tools for visibility: Custom plugins (like NVISO's callout for ATT&CK Navigator export) can visualize detection coverage, providing clear, actionable insights for prioritizing defensive improvements.
  • Caldera is not a red team replacement but a blue team enabler: It facilitates purple teaming by making red team knowledge accessible and repeatable, allowing blue teams to continuously test, measure, and improve their security posture against relevant threats.

About the Speaker(s)

Erik Van Buggenhout is a Senior Security Consultant at NVISO, a European cybersecurity firm specializing in consulting services such as penetration testing, forensics, and incident response. With a primary background in penetration testing and red teaming, dating back to his "golden years" between 2008 and 2012, Erik has extensive hands-on experience with offensive security tools and methodologies, including Metasploit. His current focus, as highlighted in this talk, is on improving blue team detection capabilities through structured adversary emulation and purple teaming approaches. He also teaches cybersecurity courses, further demonstrating his commitment to knowledge sharing and community development in the field.

Reviews

→ Top-rated talks at BruCON 0x0B

All talks from BruCON 0x0B