Abstract
Deep learning-based malware detectors are highly susceptible to adversarial evasion attacks, where subtle modifications to a binary file can bypass detection. We propose a defense mechanism inspired by (de)randomized smoothing that utilizes chunk-based ablation. By training a base classifier on small, contiguous subsets of bytes and employing a majority voting scheme at inference, we significantly enhance the robustness of detectors like MalConv. Our evaluation on the BODMAS dataset demonstrates that our approach maintains high clean accuracy while providing superior resilience against state-of-the-art evasion techniques, outperforming standard non-smoothed classifiers by a significant margin.
Introduction and Problem Statement
End-to-end deep learning models, such as MalConv, have revolutionized malware detection by learning directly from raw binary data. However, these models are notoriously vulnerable to evasion attacks. Malware authors can perform functionality-preserving manipulations—such as injecting malicious payloads into "slack space," appending overlays, or creating new sections within a Portable Executable (PE) file—to manipulate the model's output without altering the file's behavior.
Traditional defenses like Gaussian noise, common in computer vision, are unsuitable for the binary domain because flipping random bytes often corrupts the executable. There is a critical need for a defense that preserves file integrity while mitigating the impact of localized adversarial injections.
Methodology: Chunk-based Ablation Smoothing
We introduce a chunk-based ablation smoothing scheme designed to limit the influence of localized adversarial content. The core principle is to prevent the model from processing the entire file as a single entity, thereby isolating potential malicious payloads.
Training and Inference
- Training: A base classifier is trained on small, contiguous "chunks" of the file (e.g., 5% of the total size). This forces the model to identify malicious patterns distributed throughout the binary rather than relying on specific header offsets that are easily manipulated.
- Inference: At test time, $L$ different chunks are extracted from the input file. These chunks are classified independently by the base classifier.
- Consensus: The final prediction is determined by a majority vote among the $L$ chunk-level predictions.
Selection Strategies
We evaluate two strategies for determining chunk locations:
- Randomized Chunk-based Ablation (RCA): Chunks are sampled from random locations within the file.
- Structural Chunk-based Ablation (SCA): Chunks are sampled sequentially from the start to the end of the file.
Experimental Evaluation
The proposed models, RCA-MalConv and SCA-MalConv, were evaluated using the BODMAS dataset, which contains 57,293 malware samples and 77,142 benign files. The models were tested against various evasion techniques, including "Shift" attacks and "GAMMA" attacks.
Key Results
- Robustness against Attacks: While a standard non-smoothed MalConv (NS-MalConv) saw its accuracy plummet to 40.8% under a "Shift" attack and as low as 14% under extreme evasion scenarios, our chunk-based models maintained approximately 95-97% accuracy.
- Clean Performance: The defense does not compromise standard detection capabilities, maintaining high accuracy (~98%) on un-manipulated files.
- Efficiency: Training time per epoch was reduced by approximately 80% because the model only processes a small fraction of the total bytes during each training step.
Conclusion
Chunk-based ablation smoothing provides a practical and effective defense against adversarial malware examples. By leveraging the consensus of localized predictions, the system becomes resilient to the injection-based attacks common in the malware domain. Future work will explore more granular labeling to handle benign library code within malicious files and the potential for automated adversarial content identification and removal.
Summary updated