Static Malware Detection & Subterfuge: Quantifying the Robustness of Machine Learning and Current Anti-Virus

William Fleshman, Edward Raff, Richard Zak, Mark McLean, Charles Nicholas

Abstract

In the evolving landscape of cybersecurity, Machine Learning (ML) is frequently positioned as a superior alternative to traditional, signature-based Anti-Virus (AV) systems. However, the efficacy of these models is often measured by simple accuracy metrics that fail to account for adversarial subterfuge. This paper investigates the robustness of both ML-based and commercial AV detectors by subjecting them to a variety of evasion techniques. The findings demonstrate that while ML models exhibit a more holistic understanding of file maliciousness compared to the brittle, signature-dependent nature of traditional AV, they remain susceptible to sophisticated evasion strategies like Return-Oriented Programming (ROP) injection.

Introduction

The transition from traditional signature-based detection to Machine Learning models is often framed as a panacea for malware detection. Traditional AV systems rely on digital fingerprints—signatures—of known threats, which are inherently static and easily bypassed by minor, non-functional modifications. ML models, which learn patterns from raw bytes, promise better generalization.

However, benchmarking these systems is difficult due to concept drift and the proprietary nature of commercial datasets. This research shifts the focus from standard accuracy—"How many threats can you catch?"—to robustness: "How difficult is it for an adversary to hide from you?" By introducing a testing framework based on non-functional file modifications, the authors quantify the resilience of modern detection systems against adversarial manipulation.

Methodology

The study compares two primary ML approaches against four anonymous, top-tier commercial AV products:

  1. Byte n-gram model: A traditional ML approach analyzing sequences of bytes.
  2. MalConv: A convolutional neural network (CNN) designed to process raw bytes directly.

To evaluate robustness, the researchers employed four distinct evasion techniques ($\phi$):

  • Random Benign Modifications: Applying functionality-preserving changes, such as renaming sections or appending bytes.
  • Targeted Occlusion: A novel black-box "Occlusion Binary Search" algorithm that identifies the most critical contiguous byte regions for a classifier and replaces them with benign data to attempt a classification flip.
  • UPX Packing: A common obfuscation method that compresses executables.
  • ROP Injection: A sophisticated attack that converts malicious shellcode into a series of benign control-flow instructions already present within the file.

The models were trained on a massive industry dataset of 2 million balanced samples and tested against a held-out set of 80,000 files, with smaller subsets used for computationally intensive adversarial tests.

Key Insights: Holistic vs. Specific Detection

The Fragility of Signatures

Traditional AV products proved remarkably brittle. In tests involving just 10 random, non-functional modifications, one commercial AV's detection rate plummeted from nearly 100% to approximately 20%. This confirms that these systems often rely on specific, localized byte sequences. When these "fingerprints" are disturbed, the detection mechanism fails, even if the underlying malicious functionality remains intact.

ML as a Holistic Classifier

In contrast, ML models demonstrated significant resilience to minor tweaks. In the benign modification tests, ML models showed less than a 1% change in confidence. The failure of the "Targeted Occlusion" attack against ML models suggests that these classifiers do not rely on a single "malicious string." Instead, they recognize malicious intent distributed across the entire binary. This holistic approach makes them much harder to fool with simple obfuscation.

The Training Data Trap

Despite their robustness, ML models are prone to learning "degenerate" rules. For example, if a training set contains a high proportion of malicious packed files, a model may learn that "all packed files are malicious." This leads to high false-positive rates when encountering legitimate software that uses similar compression or obfuscation techniques.

Results and Analysis

  • Modification Robustness: ML models were virtually unaffected by random modifications that crippled commercial AVs.
  • Occlusion Performance: Even when 2KB of critical data (roughly 0.5% of the file) was replaced, the n-gram model's detection rate dropped by only 0.13%. Commercial AVs saw massive accuracy drops under the same conditions.
  • The ROP Blind Spot: Both ML and AV systems struggled with ROP injection. Because the injected code utilizes benign instructions already resident in the file, static analysis often fails to identify the threat. One exception was a specific AV (AV4) that likely utilized manually-engineered logic to detect ROP patterns, highlighting a current limitation in purely data-driven ML models.

Conclusion and Future Work

The research highlights a significant disparity between ML and traditional AV: while AV is often more accurate on "known" samples due to vast industry signatures, it is far more fragile. ML models offer superior robustness but face challenges with novel evasion techniques like ROP injection that are underrepresented in training data.

Future research should explore data augmentation, using these evasion techniques during the training phase to harden models. Additionally, the limitations of static analysis suggest that the next frontier lies in dynamic analysis, where ML models observe file behavior during execution to identify threats that are successfully hidden at rest.

Summary updated

BibTeX
@inproceedings{fleshman2018static,
  author = {William Fleshman and Edward Raff and Richard Zak and Mark McLean and Charles Nicholas},
  title = {{Static Malware Detection \& Subterfuge: Quantifying the Robustness of Machine Learning and Current Anti-Virus}},
  booktitle = {MALWARE},
  year = {2018},
  doi = {10.1109/malware.2018.8659360},
}
Figure