When Malware Changed Its Mind: How "Split Personalities" Affect Malware Analysis and Detection
Tudor Dumitras (University of Maryland, College Park)
USENIX Enigma Conference 2023 · Day 1 · Grand Ballroom
Overview
In the realm of cybersecurity, malware is perpetually evolving, employing increasingly sophisticated techniques to evade detection and analysis. This talk, "When Malware Changed Its Mind: How 'Split Personalities' Affect Malware Analysis and Detection," presented by Tudor Dumitras of the University of Maryland, College Park, delves into a critical, often overlooked aspect of this evasion: the dynamic, context-dependent behavior of malware, termed "split personalities." The presentation challenges the prevailing reliance on dynamic malware analysis conducted predominantly in controlled lab environments, arguing that such isolated observations fail to capture the true breadth of malware's actions in the wild.

Key moments
- 0:00 Introduction: The false sense of security in malware detection
- 3:20 Malware's 'Split Personalities' and sandbox evasion
- 8:00 Large-scale study: Collecting real-world malware traces
- 9:30 Finding: Malware exhibits extreme behavioral variability in the wild
- 12:15 Impact on malware clustering: Overestimated accuracy with single traces
- 14:30 Sandbox-trained models fail to detect WannaCry in the wild
- 17:30 Practical advice: How many environments are needed for coverage?
- 20:10 Conclusion: A radical shift for dynamic malware analysis
When Malware Changed Its Mind: How "Split Personalities" Affect Malware Analysis and Detection
Speakers: Tudor Dumitras, Professor, University of Maryland, College Park
Conference: USENIX Enigma
YouTube: https://www.youtube.com/watch?v=2TYFv3DGUMs
Overview
In the realm of cybersecurity, malware is perpetually evolving, employing increasingly sophisticated techniques to evade detection and analysis. This talk, "When Malware Changed Its Mind: How 'Split Personalities' Affect Malware Analysis and Detection," presented by Tudor Dumitras of the University of Maryland, College Park, delves into a critical, often overlooked aspect of this evasion: the dynamic, context-dependent behavior of malware, termed "split personalities." The presentation challenges the prevailing reliance on dynamic malware analysis conducted predominantly in controlled lab environments, arguing that such isolated observations fail to capture the true breadth of malware's actions in the wild.
Dumitras introduces a groundbreaking study—the largest of its kind—that analyzed millions of real-world malware execution traces. The core finding reveals that a single malware sample can exhibit vastly different behaviors across various hosts and over time, a phenomenon that significantly undermines the accuracy of current malware detection and clustering tools. This variability extends far beyond simple sandbox evasion, encompassing environmental factors, operating system configurations, and even the malware's own internal logic. The talk highlights a fundamental disconnect between the high performance metrics reported in lab-based research and the far lower effectiveness observed in real-world deployments, providing a stark warning against a "false sense of security."
The implications of this research are profound for malware analysts, security tool developers, and organizations relying on these technologies. By demonstrating the inherent limitations of single-trace, sandbox-centric analysis, Dumitras advocates for a radical shift towards incorporating multiple, real-world execution traces into the analysis pipeline. This approach, he argues, is not only crucial for developing more robust and accurate security solutions but also represents the "next big thing" in dynamic malware analysis, promising unique new insights into the ever-evolving threat landscape.
Background
▶ Watch: Introduction: The false sense of security in malware detection (0:00)
The cornerstone of understanding and combating malware lies in malware analysis, broadly categorized into static analysis (examining binary code without execution) and dynamic analysis (observing malware behavior during execution). While static analysis offers insights into potential functionalities, dynamic analysis, involving the collection and analysis of execution traces, is widely considered superior for understanding active malicious behaviors, creating detection rules, clustering samples into families, and attributing attacks. This experimental technique, often performed in sandboxes—controlled, virtualized environments designed to prevent damage and propagation—forms the backbone of modern malware detection systems.
Despite the widespread adoption and reported high performance numbers (often exceeding 95% detection rates in evaluations), there's a significant disparity between lab results and real-world efficacy. This isn't solely due to flaws in experimental evaluations, the base rate fallacy, malware evolution leading to concept drift, or misleading marketing. Instead, a core issue lies in the fundamental assumption that malware behaves consistently. As Dumitras explains, "split personalities" describe how the same malware sample can exhibit different behaviors when executed on different hosts or at different times.
This concept isn't entirely new; security professionals have long been aware of such variability. However, it gained significant traction with the discovery of Red Pills in 2004. Red Pills are techniques malware uses to detect if it's running inside a virtual machine (VM) or sandbox, subsequently altering its behavior or going dormant to evade analysis. Subsequent research has largely focused on two areas: developing program analysis techniques to detect these sandbox evasion tactics (often time-based triggers) and creating "better" sandboxes by making them closer to bare metal, adding "aging artifacts," or randomizing VM configurations.
However, all this prior work predominantly focused on what malware does in a sandbox. The critical unanswered questions remained: How much do malware behaviors actually vary in the wild? What parts of the behavior change most significantly? And most importantly, how does this impact the effectiveness of dynamic malware analysis tools when deployed in real-world scenarios?
To illustrate the tangible impact, Dumitras presented the example of the Ramnit worm. A specific vulnerability exploit (line 22 in a pseudocode example) within Ramnit aims for privileged escalation. On unpatched Windows 7 systems, running in non-admin mode, this exploit creates hundreds of Windows mutexes. If a malware detection signature is developed based solely on this trace (e.g., observing hundreds of mutex creations), it would be entirely ineffective on patched systems or when Ramnit runs in admin mode. This scenario highlights a crucial problem: signatures derived from limited, lab-based traces might offer a false sense of security, failing to detect prevalent behaviors in the wild. Furthermore, vendors and users alike would struggle to accurately estimate the true effectiveness of such tools without real-world telemetry. This gap—the lack of understanding of malware's true behavioral variability in diverse, real-world environments—is precisely what the presented research aimed to address.
Key Findings
▶ Watch: Large-scale study: Collecting real-world malware traces (8:00)
The study presented by Tudor Dumitras leveraged an unprecedented dataset to shed light on malware's "split personalities" in the wild. Partnering with a security company, the researchers collected an astonishing 7.6 million execution traces from over 5 million real user machines across various geographic locations. Crucially, this data represented real-world infections where the antivirus had not yet classified the sample, acting as a "last line of defense" rather than controlled experiments. No samples were distributed, no inputs provided, and executions were not triggered by the researchers, ensuring the authenticity of the observed behaviors. Furthermore, strict privacy protocols were maintained, with no private user data collected.
The first significant finding challenged a potential assumption: behavioral variability isn't exclusive to malicious software. Benign programs also exhibit variable behavior, with a difference of eight or more actions between the longest and shortest 25% of their traces. Potentially Unwanted Programs (PUPs) showed more variability, averaging 19 actions. However, malware samples displayed a vastly higher degree of variability, with a staggering difference of 59 actions between their longest and shortest traces. This quantitatively demonstrated that malware's behavioral shifts are far more pronounced than those of other software categories.
Analyzing the types of actions that varied most, the study found that file creations were the most variable for all software categories (benign, PUP, and malware). This variability extended not only to the number of file creation actions but also to the parameters, specifically the file names created. Malware, in particular, was observed creating a multitude of unique and often random file names, a clear indicator of its dynamic and evasive nature.
The research identified several key reasons for these observed behavioral differences:
- Malware-implemented evasion techniques: While sandboxes are a target, these extend to detecting specific OS versions, installed software, or network conditions.
- Differences in operating systems and libraries: As seen with the Ramnit example, specific OS versions (e.g., Windows 7) or patch levels can trigger different code paths.
- Risky operations that fail: Malware might attempt operations (e.g., privilege escalation, injecting into a specific process) that succeed on some hosts but fail on others, leading to different execution branches.
- Different commands from Command and Control (C2) channels: Real-world C2 interactions mean malware receives varying instructions, leading to diverse actions.
- Differences between first and subsequent executions: Initial installation routines often involve one-time setup operations (e.g., persistence mechanisms, dropping components) that don't occur in later executions.
- Randomized file names and other parameters: Malware often uses randomness to avoid static signatures, leading to highly diverse file system interactions.
Crucially, the study highlighted that while much prior research focused on sandbox evasion, this is just one facet of behavioral variability. The vast majority of reasons for "split personalities" are unrelated to sandbox detection. This leads to a pivotal conclusion: sandbox traces, even from the most advanced sandboxes capable of catching all evasion techniques, cannot account for the broad range of behaviors encountered in the wild. This fundamental limitation means that relying solely on sandbox data inherently leads to an incomplete and often misleading understanding of malware's true capabilities and actions.
Technical Deep Dive
▶ Watch: Impact on malware clustering: Overestimated accuracy with single traces (12:15)
The technical core of this talk revolves around demonstrating the severe limitations of traditional dynamic malware analysis methods, particularly those reliant on single execution traces from sandboxed environments, when confronted with the reality of malware's "split personalities" in the wild. The researchers' methodology involved a large-scale empirical study, leveraging real-world execution traces to expose these discrepancies.
The study's data acquisition was a critical technical achievement. By partnering with a security vendor, they gained access to 7.6 million execution traces from over 5 million unique user machines. These traces were not generated in a controlled lab but represented actual infections where the installed antivirus could not immediately classify the sample as either benign or malicious. This "last line of defense" collection mechanism ensured that the observed behaviors were genuinely representative of malware operating in its natural habitat, responding to diverse system configurations, user interactions, and network conditions. The data collection was passive, meaning the researchers did not distribute samples, provide inputs, or trigger executions, further reinforcing the authenticity of the collected telemetry.
To quantify the impact of behavioral variability, the researchers conducted two key experiments: one on malware clustering and another on malware detection.
Impact on Malware Clustering:
Malware clustering is an unsupervised machine learning technique aimed at grouping similar malware samples into families, typically based on their behavioral traces. Historically, research papers on this topic have used only one trace per sample. Recognizing the "split personalities" problem, Dumitras and his team utilized four traces per sample in their experiment, a departure from standard practice.
The expectation for an effective clustering tool would be that all traces from a single malware sample would be placed within the same cluster, indicating a consistent family identity. However, their findings painted a different picture:
- One-third (33%) of the samples exhibited sufficient variability that their individual traces were placed into more than one cluster.
- For one percent (1%) of samples, each of their four traces was placed into a separate cluster, indicating extreme behavioral divergence.
This demonstrates that relying on a single trace per sample significantly overestimates the accuracy of malware clustering tools. A tool might appear highly effective in a lab setting, but its ability to accurately group real-world, diverse behaviors would be severely compromised. The implication is that even vendors and independent evaluators cannot accurately gauge this overestimation without access to multiple, diverse execution traces from the wild.
Impact on Malware Detection:
The second experiment focused on the impact of variability on malware detection, specifically targeting the notorious WannaCry worm and ransomware. The researchers trained several supervised machine learning models to detect WannaCry and compared their performance using different training and testing datasets:
- Sandbox-to-Sandbox (Cuckoo to Cuckoo): When models were trained on traces from Cuckoo Sandbox and tested on other Cuckoo Sandbox traces, they achieved a 76% true positive rate (detection rate) at a 1% false positive rate. This reflects typical high lab performance.
- Sandbox-to-Sandbox (Cuckoo to Hubble): Training on Cuckoo and testing on Hubble Sandbox showed a slight performance drop, suggesting some generalization between different sandboxes.
- Sandbox-to-Wild (Cuckoo to Wild): The most critical result: when models trained on Cuckoo Sandbox traces were tested against real-world WannaCry traces from the wild, the true positive rate plummeted to a mere 18%. This indicates that models trained exclusively on sandbox data are largely ineffective against real-world, varied malware behaviors.
- Combined Sandbox-to-Wild: Even when following best practices by combining traces from multiple sandboxes (Cuckoo and Hubble) for training, and then testing against wild traces, the improvement was minimal.
To visually explain this drastic performance drop, the researchers used a 2D projection of the feature space. Features were counts of tokens extracted from WannaCry parameters. In the sandbox-only plot, traces from Cuckoo and Hubble sandboxes appeared relatively well-clustered. However, when wild traces were added, the plot showed a massive, highly dispersed cloud of points, indicating extreme behavioral variability. The sandbox traces, when mapped onto this wild feature space, occupied only a very small, confined area. This visualization powerfully illustrated that sandboxes capture only a tiny fraction of the behavioral diversity that WannaCry exhibits in real-world environments. Models trained on this limited "sandbox island" simply cannot generalize to the vast "ocean" of behaviors in the wild.
The technical takeaway is clear: current dynamic analysis approaches, heavily reliant on a narrow range of sandbox-collected traces, introduce significant blind spots. They overlook environment- and time-dependent behaviors, present a skewed view of malware's actions, and ultimately lead to an overestimation of the accuracy of detection and clustering tools. The research suggests that to achieve robust coverage, analysts should aim for at least three different execution environments as diminishing returns are observed beyond this number. While temporal variability (e.g., collecting traces three to four weeks apart) also contributes, it was found to be less impactful than environmental diversity for improving behavioral coverage.
Demo / Proof of Concept
▶ Watch: Sandbox-trained models fail to detect WannaCry in the wild (14:30)
This technical talk focused on presenting the methodology, empirical study, and statistical findings of a large-scale research project rather than showcasing a live demonstration or proof-of-concept tool. While the speaker detailed experiments conducted on malware clustering and detection using real-world data and specific malware samples like WannaCry, these were explained through data visualizations and performance metrics rather than an interactive demonstration of a tool. The core "proof" lies in the quantitative results and the stark contrast between lab performance and real-world efficacy, as illustrated by the drastic drop in detection rates for WannaCry when moving from sandbox-trained models to wild-tested scenarios.
Defensive Implications
▶ Watch: Conclusion: A radical shift for dynamic malware analysis (20:10)
The findings presented by Tudor Dumitras carry critical implications for cybersecurity defenders, ranging from security analysts and tool developers to organizational decision-makers. The central message is a call to fundamentally re-evaluate how malware is analyzed and how security tools are assessed and deployed.
For Users of Malware Detection and Classification Tools (e.g., SOC Analysts, IT Security Managers):
- Trust But Verify: The most crucial advice is to be highly skeptical of marketing claims and even research papers reporting extremely high detection rates (e.g., 95%+). These numbers are likely based on lab-controlled sandbox environments and do not reflect real-world performance.
- Rigorous In-Environment Evaluation: Organizations must evaluate security tools rigorously within their own specific environments. This means testing with samples and scenarios that mimic their actual threat landscape and infrastructure, rather than relying solely on vendor-provided benchmarks or generic lab results. The true effectiveness of a tool can only be understood when confronted with the unique configurations and conditions of the target environment.
- Acknowledge the "False Sense of Security": Understand that deploying tools based on overestimated lab performance can create a dangerous false sense of security, leaving organizations vulnerable to threats that their systems are theoretically supposed to detect.
For Developers of Malware Detection Rules and Signatures (e.g., Threat Intelligence Engineers, AV Vendors):
- Embrace Multiple Traces from the Wild: The paradigm shift advocated is to move away from single-trace, sandbox-centric analysis. Instead, developers should strive to collect and analyze multiple execution traces from diverse real-world environments for each malware sample. This is essential for creating robust rules and signatures that can account for the full spectrum of malware's "split personalities."
- Target Environmental Diversity: The research suggests that collecting traces from approximately three different environments provides a good balance, as diminishing returns are observed beyond this point. This guidance helps prioritize resource allocation for data collection.
- Consider Temporal Variability: While less impactful than environmental diversity, collecting executions three to four weeks apart can also contribute to a more comprehensive understanding of malware behavior, especially for campaigns that evolve over time.
- Expand Feature Space Coverage: Developers need to recognize that current sandbox-based models operate on a very narrow sliver of the actual malware behavior space. Their goal should be to expand this coverage by incorporating features observed across diverse real-world executions, making their models more generalizable and resilient.
- Rethink "Representative" Behavior: The concept of a single "representative" trace for a malware sample is flawed. Analysts must consider the entire range of observed behaviors and prioritize developing detection logic that is resilient to this variability, rather than relying on a single, potentially context-specific, action sequence.
Broader Implications for the Security Industry:
- Industry-Academia Collaboration: The study itself is a testament to the power of industry-academia collaboration. Security companies are in a unique position to ethically collect large volumes of real-world execution data, which is vital for advancing research and developing next-generation security products. Organizations should seek and foster such partnerships.
- Ethical Data Collection: The talk explicitly states that collecting real-world execution data can be done ethically, emphasizing the importance of non-distribution of samples, passive collection, and strict user privacy. This addresses a common concern and provides a roadmap for responsible data acquisition.
- Market Shift: The $5 billion malware analysis market is expected to grow, but its reliance on flawed methodologies poses a risk. This research points towards a necessary "radical shift" in how dynamic analysis is done, suggesting that adopting real-world, multi-trace analysis could be the "next big thing" that transforms security products and services. Defenders should push their vendors towards these advanced methodologies.
In essence, the defensive implication is a call for greater realism and humility in the face of malware's adaptability. Defenders must move beyond the controlled confines of the lab and embrace the messy, variable reality of the wild to build truly effective and resilient security defenses.
Key Takeaways
- Malware Exhibits "Split Personalities" in the Wild: Malware behavior is highly variable, changing significantly across different host environments and over time, far beyond simple sandbox evasion. This variability is much more pronounced in malware (59 actions difference) compared to benign programs (8 actions) or PUPs (19 actions).
- Sandbox-Based Analysis is Insufficient: Current dynamic malware analysis, heavily reliant on single execution traces from sandboxes, captures only a narrow range of behaviors. It fails to account for the true diversity of malware actions in real-world environments, even if perfect sandbox evasion detection is achieved.
- Overestimated Accuracy of Security Tools: The limited scope of sandbox analysis leads to a significant overestimation of the accuracy of malware clustering and detection tools. Experiments showed that models trained on sandboxes had a drastically reduced true positive rate (e.g., 18% for WannaCry) when tested against real-world traces.
- "Trust But Verify" for Tool Users: Organizations using malware detection and classification tools should be skeptical of high lab performance numbers and rigorously evaluate tools in their own specific environments with diverse, real-world data to understand their true effectiveness.
- Integrate Multiple Real-World Traces for Rule Development: For those developing malware detection rules or signatures, it is crucial to base them on multiple execution traces collected from various real-world environments. Aim for approximately three different environments to achieve good behavioral coverage.
- Ethical Data Collection and Collaboration are Key: Collecting real-world execution data ethically is feasible and essential. Collaboration between industry (which has access to such data) and academia (for analysis and research) is vital for advancing the state of dynamic malware analysis.
About the Speaker(s)
Tudor Dumitras is a distinguished professor at the University of Maryland, College Park, specializing in cybersecurity research. His work, as evidenced by this talk, focuses on understanding and addressing fundamental challenges in malware analysis, detection, and system security. He is particularly known for his empirical studies that leverage large-scale, real-world data to uncover insights into attacker behaviors and defense mechanisms. Dumitras emphasizes the importance of practical, actionable research, often collaborating with industry partners to bridge the gap between academic findings and real-world security product development. His presentation at USENIX Enigma highlights his commitment to pushing the boundaries of dynamic malware analysis and advocating for more robust, data-driven approaches to cybersecurity.
Reviews
Dr. Zero (Offensive Security Researcher) — MUST SEE
Dumitras just took a baseball bat to every vendor claiming 99% machine learning detection rates. By analyzing 7.6 million wild execution traces, he proves that sandbox-trained models fall off a cliff when they hit actual user environments. This is a mandatory watch for anyone building or buying EDR.
Heather Calloway (CISO) — MUST SEE
A large-scale empirical study proving that malware behaves so differently in the wild that sandbox-trained detection models are effectively blind. It completely invalidates the 95% detection claims vendors put on their datasheets. Required reading if you are evaluating endpoint tools or running a SOC.