A Practical Adversarial Attack Against Sequence-Based Deep Learning Malware Classifiers

Kai Tan, Dongyang Zhan, Lin Ye, Hongli Zhang, Binxing Fang

This paper, titled "A Practical Adversarial Attack against Sequence-based Deep Learning Malware Classifiers," presents a significant shift in how we think about "tricking" AI-driven security systems. Instead of just editing log files in a lab, the authors demonstrate how to modify the actual source code of malware to make it invisible to modern deep-learning detectors.

TL;DR

Researchers have developed a practical adversarial attack that evades deep-learning malware classifiers by inserting benign code fragments into malicious programs. By combining Reinforcement Learning (DQN) with a heuristic backtracking search and LLVM-based code transformation, they can generate functional malware that "looks" benign to AI while preserving its original destructive capabilities.

What Problem Does This Paper Address?

Deep learning models, such as Recurrent Neural Networks (RNNs) and Transformers, are increasingly used to detect malware by analyzing sequences of system calls or API calls. While these models are powerful, they are vulnerable to "adversarial attacks"—small, intentional perturbations designed to cause misclassification.

Most existing research on adversarial sequences is purely theoretical: it assumes an attacker can directly edit the execution logs of a system. In the real world, logs are often protected, encrypted, or processed too quickly to be tampered with. Furthermore, many existing attacks "break" the malware by deleting or replacing essential malicious calls. The challenge is: How do you create an adversarial attack that is practical to implement, preserves the malware's functionality, and maintains semantic logic?

Methods

The authors propose a three-stage framework to bridge the gap between theory and practice:

  1. Construction of Perturbation Action Set: Instead of inserting random system calls, the authors use frequent pattern mining (like the Apriori algorithm) on benign software datasets. This identifies "natural" sequences of benign behavior (e.g., opening, reading, and then closing a file) that are less likely to trigger suspicion.
  2. DQN-based Sequence Perturbation: They train a Deep Q-Network (DQN) to act as an intelligent agent. This agent learns where to insert benign fragments into a malicious sequence to maximize the "evasion score" of a surrogate detection model.
  3. Heuristic Backtracking Search: To ensure the resulting sequence is logically sound (e.g., you don't try to read a file after you've closed it), they use a backtracking search strategy. This ensures the inserted behaviors follow the rules of a directed graph representing valid system call dependencies.
  4. Automatic Code Modification: This is the "practical" part. They use the LLVM compiler infrastructure to map the desired sequence modifications back to the malware's Intermediate Representation (IR) bitcode. This allows them to automatically recompile the malware into a new, functional executable that naturally generates the adversarial sequence during execution.

Datasets

The approach was evaluated on three primary sources:

  • ADFA-LD: A well-known public dataset of Linux system call traces.
  • AndroCT: A large-scale dataset containing over 35,000 Android applications (API call sequences).
  • Exploit-DB Synthesis: To test practicality, the authors downloaded 80 real-world "Proof of Concept" (PoC) exploits from Exploit-DB and used their tool to modify the source code directly.

Key Insights and Ideas

  • The "Benign-Only" Constraint: By strictly inserting benign behaviors rather than deleting malicious ones, the authors ensure the malware's core functionality remains intact. This is a crucial pivot toward operational realism.
  • Semantic Validity Matters: A sequence like close() -> read() is a dead giveaway of a naive attack. By using directed graphs and backtracking, the attack ensures that the "noise" added to the malware is semantically coherent.
  • LLVM as the Bridge: Using LLVM IR allows the attack to be language-agnostic. Whether the malware is written in C, C++, or Rust, the tool can modify the underlying bitcode to achieve the desired adversarial effect.

Key Results

The framework was tested against four common architectures: LSTM, CNN, Transformer, and Autoencoders.

  • High Success Rates: On the AndroCT dataset, the attack achieved a success rate of 64.4% against CNN-based detectors, outperforming several state-of-the-art baselines.
  • Efficiency: The "Perturbation Rate" (the amount of extra code added) was kept low, typically around 18-21%, meaning the malware doesn't bloat excessively to achieve evasion.
  • Robustness against Defense: The authors tested their attack against defensive measures like "Sequence Squeezing" and "Adversarial Learning." Their method remained effective, maintaining a success rate of over 60% even when the detector was specifically trained to look for adversarial samples.

Limitations and Future Work

While the results are impressive, the authors acknowledge a few hurdles:

  • The Cat-and-Mouse Game: As malware evolves, the "benign patterns" used for the attack may also need to be updated continually to stay ahead of more sophisticated detectors.
  • Architecture Specifics: The performance of the attack can vary depending on the specific architecture of the target classifier.
  • Future Directions: The authors suggest exploring "continuous learning" techniques to allow the attack agent to adapt to new defensive patches in real-time. They also emphasize the need for the security community to develop more robust, context-aware sequence classifiers that can see through these "semantically valid" insertions.

Summary updated

BibTeX
@article{tan2024practical,
  author = {Kai Tan and Dongyang Zhan and Lin Ye and Hongli Zhang and Binxing Fang},
  title = {{A Practical Adversarial Attack Against Sequence-Based Deep Learning Malware Classifiers}},
  journal = {IEEE Trans. Computers},
  year = {2024},
  doi = {10.1109/tc.2023.3339955},
}
Figure