DeepDetectNet vs RLAttackNet: An adversarial method to improve deep learning-based static malware detection model

Yong Fang, Zeng Yuetian, Beibei Li, Liang Liu, Lei ZhangPLoS 2020

Abstract

Deep learning methods are being increasingly widely used in static malware detection field because they can summarize the feature of malware and its variants that have never appeared before. But similar to the picture recognition model, the static malware detection model based on deep learning is also vulnerable to the interference of adversarial samples. When the input feature vectors of the malware detection model is based on static features of Windows PE (Portable Executable, PE) file, the model is vulnerable to gradient-based attacks. Regarding the issue above, a method of adversarial sample generation is proposed, which can summarize the blind spots of the original detection model. However, the existing malware adversarial sample generation method is not universal and low in generation efficiency due to the need for human control and difficulty in maintaining a normal file format. In response to these problems, this paper proposes a novel method of automatic adversarial samples generation based on deep reinforcement learning. Firstly, a static PE malware detection model based on deep learning called DeepDetectNet is constructed, the original AUC of which can reach 0.989. Then, an adversarial sample generation model based on reinforcement learning called RLAttackNet is implemented, which generates malware samples that can bypass DeepDetectNet. Finally, when we re-input the adversarial samples into the previously trained DeepDetectNet, the original defects of DeepDetectNet can be reinforced. Experimental results show that the RLAttackNet proposed in this paper can generate about 19.13% of malware samples bypass DeepDetectNet. When DeepDetectNet is retrained with these adversarial samples, the AUC value improves from 0.989 to 0.996 and attack success rate has a significant drop, from 19.13% to 3.1%, compared with the original model.

Introduction

Deep learning has revolutionized static malware detection—the art of identifying malicious files without actually running them. By analyzing the "static" features of a Windows Portable Executable (PE) file, these models can spot new malware variants that traditional signature-based tools miss.

However, deep learning models have a well-known Achilles' heel: adversarial samples. In computer vision, a few tweaked pixels can make a model see a "dog" as a "toaster." In cybersecurity, an attacker can tweak a malware file to make it look "benign." The challenge is that unlike images, you cannot simply add random noise to a program; if you mess up the PE file structure, the program breaks and is no longer functional malware. Existing attack methods often require manual human intervention or produce "broken" files. This paper seeks an automated way to generate functional adversarial malware to proactively find and fix a detector's weaknesses.

Methods

The authors propose a dual-system architecture inspired by the philosophy of Generative Adversarial Networks (GANs), where an attacker and defender evolve together through a feedback loop of generation and detection.

Overview of the adversarial malware generation and detection framework.

DeepDetectNet (The Defender)

DeepDetectNet is a 6-layer Deep Neural Network (DNN) trained to classify files as benign or malicious. It uses a feature vector of 2,478 dimensions, including:

  • Import Functions: A 2212-dimension binary vector tracking common API calls.
  • General Info: 10 features like file size and header metadata.
  • Byte Entropy: A 256-dimension vector capturing the statistical randomness of the file's contents.

RLAttackNet (The Attacker)

RLAttackNet is a reinforcement learning agent built on a Double Dueling DQN (Deep Q-Network) architecture. It interacts with the environment to learn which modifications successfully hide malware from the detector.

The reinforcement learning loop used by RLAttackNet to discover bypass strategies.
  • The Action Space: To ensure the malware remains functional, the authors defined 218 specific, deterministic actions. Instead of "add a random function," the agent chooses from specific actions like "add the CreateFontIndirectW function" or "rename the .text section to .mtext."
  • The Reward: The agent receives a positive reward only if it successfully modifies a malicious file so that DeepDetectNet labels it as "benign" without breaking the file's internal structure.

Finally, the authors use Adversarial Training: they take the successful bypass samples generated by RLAttackNet and feed them back into the training set for DeepDetectNet to "teach" it how to recognize those specific tricks.

Datasets

The study utilized a dataset of 7,374 samples:

  • 3,746 Benign samples: Collected from clean Windows 7, 8, and 10 installations.
  • 3,628 Malicious samples: Sourced from the VirusShare repository.

Key Insights and Ideas

  • Deterministic Actions over Randomness: Previous RL-based attacks often failed because their "action space" was too random, making it impossible for the agent to learn a coherent strategy. By using 218 specific, pre-defined PE modifications, the authors made the environment "stable" enough for the RL agent to converge.
  • Format-Preserving Attacks: The authors emphasized that an adversarial sample is useless if it doesn't run. They validated their modified files using Cuckoo Sandbox and IDA Pro, ensuring the "malware-ness" was preserved despite the disguise.
  • The "Slack" Space Strategy: The agent learned to exploit non-essential parts of the PE header and "slack" space (unused bytes between sections) to hide its modifications from the detector.

Key Results

  • Baseline Performance: The original DeepDetectNet achieved an AUC of 0.989.
  • The Vulnerability: RLAttackNet found that 19.13% of malware samples could be modified to bypass the detector.
  • The Fix: After retraining DeepDetectNet with these adversarial samples, the overall AUC improved to 0.996, and the attack success rate for RLAttackNet plummeted from 19.13% to 3.1%.

Conclusion

While the results are promising, the authors suggest that larger, more diverse datasets would further improve the model's robustness. Future work should include k-fold cross-validation and explore more advanced methods, such as Continuous Deep Q-Learning, to find even more optimal configurations for the attacker and defender.

Summary updated

BibTeX
@inproceedings{fang2020deepdetectnet,
  author = {Yong Fang and Zeng Yuetian and Beibei Li and Liang Liu and Lei Zhang},
  title = {{DeepDetectNet vs RLAttackNet: An adversarial method to improve deep learning-based static malware detection model}},
  booktitle = {PLoS},
  year = {2020},
  doi = {10.1371/journal.pone.0231626},
}
Figure