Marvolo: Programmatic Data Augmentation for Practical ML-Driven Malware Detection

Michael D. Wong, Edward Raff, James Holt, Ravi NetravaliarXiv 2022 · DOI

Introduction: The Data Scarcity Problem in Malware Detection

Deep learning models, such as the raw-byte-processing MalConv, have revolutionized malware detection by eliminating the need for manual feature engineering. However, these models are notoriously data-hungry. To achieve high accuracy (exceeding 90%), they require massive, diverse datasets like the commercial Ember dataset, which contains over a million samples. For many researchers and practitioners, accessing the raw binaries for such datasets is cost-prohibitive, with licensing fees often exceeding $400,000 annually.

Consequently, most practitioners rely on smaller, free datasets ranging from 20,000 to 75,000 samples. As shown in the figure below, model performance degrades significantly as training data volume decreases, often dropping to accuracy levels between 60% and 71%.

Model accuracy significantly decreases as the training set size is reduced, highlighting the need for data augmentation.

In fields like computer vision, data scarcity is addressed through simple augmentations like cropping or rotating images. In cybersecurity, however, randomly altering bytes in an executable typically breaks the program's functionality or changes its behavior. This makes traditional augmentation impossible without expensive manual reverse-engineering to verify that a "malicious" file remains malicious after mutation.

Marvolo: Semantics-Preserving Data Augmentation

To bridge this gap, we introduce MARVOLO, a binary mutator designed to apply data augmentation directly to Windows Portable Executable (PE32) files. MARVOLO utilizes semantics-preserving code transformations to ensure that the augmented data remains valid and retains its original label.

The MARVOLO pipeline: binaries are decompiled, subjected to iterative code transformations, and reassembled into new malicious variants.

The system decompiles a binary, applies transformations that alter the code's appearance without changing its external behavior, and reassembles it. MARVOLO employs ten distinct transformations, including junk code insertion, instruction swapping, register reassignment, and the use of opaque predicates. Because the underlying semantics are preserved, the original label (malicious or benign) can be safely propagated to the new variant.

Optimizing for Scale and Speed

Decompiling and reassembling binaries is computationally intensive. To make large-scale augmentation practical, MARVOLO introduces two key optimizations:

  1. Code Similarity Clustering: MARVOLO identifies and groups binaries that share identical code sections. By running the expensive mutation pipeline on only one representative binary per cluster and using fast drop-in replacements for the rest, the system achieves an 85% reduction in processed files.
  2. Intermediate Binary Generation: Rather than outputting a single variant, MARVOLO monitors the cumulative change after each transformation step. If the difference is significant, it exports an intermediate variant, allowing a single pass to yield multiple diverse samples.

These optimizations result in a 79x speedup compared to naive decompilation/reassembly approaches.

Key Insights and Results

MARVOLO effectively automates the evasion techniques—such as obfuscation—that malware authors already use manually in the wild. Our evaluation yielded several critical findings:

  • Accuracy Gains: Integrating MARVOLO-augmented samples boosted MalConv's accuracy by 1–5% on the Ember dataset and approximately 2% on the Brazilian Malware Dataset.
  • Generalization to Zero-Days: The most significant accuracy improvements occurred on previously unseen malware families. By training on augmented data, the model learns to recognize the patterns of code obfuscation itself, rather than just specific malware signatures.
  • Efficiency: Adding as few as 3,000 to 6,000 mutated samples was sufficient to capture the majority of the accuracy benefits, demonstrating that targeted diversity is more important than sheer volume.

Conclusion and Future Work

MARVOLO demonstrates that programmatic data augmentation is a viable and efficient strategy for improving malware detection in resource-constrained environments. While currently limited to modifying code (.text) sections to ensure semantic equivalence, future iterations could explore targeted augmentation. By analyzing existing datasets to identify missing obfuscation patterns, MARVOLO could be directed to generate the specific types of data needed to harden models against emerging threats.

Summary updated

BibTeX
@misc{wong2022marvolo,
  author = {Michael D. Wong and Edward Raff and James Holt and Ravi Netravali},
  title = {{Marvolo: Programmatic Data Augmentation for Practical ML-Driven Malware Detection}},
  year = {2022},
  eprint = {2206.03265},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2206.03265},
}
Figure