Abstract
Anti-malware engines are the first line of defense against malicious software. While widely used, feature engineering-based anti-malware engines are vulnerable to unseen (zero-day) attacks. Recently, deep learning-based static anti-malware detectors have achieved success in identifying unseen attacks without requiring feature engineering and dynamic analysis. However, these detectors are susceptible to malware variants with slight perturbations, known as adversarial examples. Generating effective adversarial examples is useful to reveal the vulnerabilities of such systems. Current methods for launching such attacks require accessing either the specifications of the targeted anti-malware model, the confidence score of the anti-malware response, or dynamic malware analysis, which are either unrealistic or expensive. We propose MalRNN, a novel deep learning-based approach to automatically generate evasive malware variants without any of these restrictions. Our approach features an adversarial example generation process, which learns a language model via a generative sequence-to-sequence recurrent neural network to augment malware binaries. MalRNN effectively evades three recent deep learning-based malware detectors and outperforms current benchmark methods. Findings from applying our MalRNN on a real dataset with eight malware categories are discussed.
Introduction
Static malware detectors have evolved from simple signature-matching to sophisticated Deep Learning (DL) models capable of analyzing raw bytes. While these models excel at identifying "zero-day" threats, they remain vulnerable to adversarial examples—malware variants modified with strategic perturbations to trigger a "benign" classification.
Most existing attack methodologies are impractical for real-world scenarios, as they often require "white-box" access to model parameters or "gray-box" access to confidence scores. In practice, attackers typically only receive a binary response (blocked or not). Furthermore, many current attacks rely on brute-force byte injection, resulting in bloated files. MalRNN addresses these gaps by generating small, effective, and benign-looking perturbations in a true binary black-box setting.
Methodology: MalRNN Architecture
MalRNN treats the raw bytes of an executable file as a language. The system utilizes a Sequence-to-Sequence (Seq2Seq) Recurrent Neural Network (RNN) architecture, specifically employing Gated Recurrent Units (GRUs) to capture long-term patterns in binary data.
The process involves three core stages:
- Learning Benign Grammar: MalRNN is trained on thousands of legitimate Windows files to learn byte sequences that mimic the statistical patterns of benign software.
- The Append Attack: To ensure the malware remains functional, MalRNN appends its generated "benign-looking" bytes to the end of the file (the overlay). This data is not executed by the OS, preserving the original malicious payload.
- Iterative Feedback: The model generates bytes and tests the variant against a black-box detector. It uses the binary success/failure result to refine its generative model over multiple iterations.
Experimental Setup
The study utilized a comprehensive dataset consisting of:
- Malware: 6,307 samples (2017–2019) across eight categories (e.g., Ransomware, Botnets, Spyware) sourced from VirusTotal.
- Benign: 4,329 clean executables from a fresh Windows installation.
Functionality was verified via the VirusTotal API, confirming that over 90% of modified samples remained operational after the append attack.
Key Results and Discussion
MalRNN was evaluated against three state-of-the-art DL detectors: MalConv, NonNeg, and ConvNet.
Evasion Performance
MalRNN significantly outperformed standard benchmarks. Against an ensemble of all three detectors, MalRNN achieved a 38.78% evasion rate, compared to just 1.49% for a random append attack. Against the NonNeg detector specifically, MalRNN reached a near-perfect 99.97% evasion rate.
Efficiency and Optimization
Researchers identified a critical "elbow point" regarding the size of the appended data. As shown in the performance metrics, an append size of approximately 40% provides the optimal balance between evasion success and file size efficiency.
Category Sensitivity
Evasion difficulty varied by malware type. Ransomware and Botnets proved the most difficult to disguise, likely due to high-entropy code sections (such as encryption routines) that are harder to mask with simple append-based perturbations.
Conclusion
MalRNN demonstrates that malware evasion can be effectively framed as a natural language generation problem. By iteratively learning from simple binary responses, the model successfully identifies benign-looking patterns that bypass sophisticated detectors without requiring internal model knowledge. While currently limited to additive perturbations, this research highlights critical vulnerabilities in DL-based static detectors and provides a framework for developing more robust, adversarial-resistant anti-malware engines.
Summary updated