Dissecting Malware in the Wild

Hamish Spencer, Wei Wang, Ruoxi Sun, Minhui Xue

TL;DR

This paper investigates how to make malware evade machine learning-based antivirus detectors by systematically testing different manipulation techniques. The authors found that modifying the legacy DOS header of Windows executables is particularly effective, and that the number of iterations needed for evasion can be significantly reduced.

What Problem Does This Paper Address?

The rapid evolution of malicious software poses a significant challenge to cybersecurity. Traditional signature-based antivirus methods are often outmaneuvered by new malware variants. Machine learning (ML) has emerged as a powerful tool for malware detection, but these ML models are themselves vulnerable to "adversarial attacks." These attacks involve making subtle, often imperceptible, changes to malware samples that cause ML classifiers to misidentify them as benign, while retaining their malicious functionality. This paper aims to dissect these adversarial attacks by comparing different methods for generating them, with the goal of understanding which tactics are most effective and how to improve malware detection defenses.

Methods

The researchers employed two Python libraries, secml-malware and MAB-Malware, to generate adversarial malware samples. They focused on comparing different "action types" – specific modifications applied to malware binaries – and their effectiveness. The secml-malware library offers a set of distinct modification modules, while MAB-Malware utilizes a more complex reinforcement learning approach with an "action minimization" process to learn which modifications are most effective. The study also examined the impact of sampling methods (Thompson sampling vs. UCB1) within MAB-Malware on the efficiency of generating evasive samples. All experiments were conducted in a black-box setting, simulating real-world scenarios where the attacker doesn't know the internal workings of the target classifier.

Datasets

The primary dataset used consisted of approximately 2,500 known malicious Windows binaries. This dataset was filtered to retain samples that were initially recognized as malicious by the MalConv classifier, with a confidence level of at least 50%. The EMBER (Elastic Malware Benchmark for Empowering Researchers) dataset was also mentioned as a potential resource for future work.

Key Insights and Ideas

  • DOS Header is a Prime Target: Modifications to the legacy DOS header of Windows executables proved to be the most effective strategy for evading the MalConv classifier. This is attributed to the header's role in pointing to the main executable structure, allowing for significant rearrangement of the file's layout.
  • Efficiency Gains are Possible: The number of iterations required for an adversarial example to be generated can be significantly reduced. The study found that beyond 15 iterations, adversarial attacks often experienced diminishing returns.
  • Exploration is Key in Sampling: The Thompson sampling method, which balances exploring new actions with exploiting known effective ones, significantly outperformed the simpler UCB1 algorithm in generating evasive samples, highlighting the importance of exploration in adversarial attack generation.
  • Not All Modifications Are Equal: Actions that only altered section names or instruction sequences were found to be less effective, suggesting that deeper structural manipulation is more impactful.

Key Results

  • High Evasion Rates for DOS Header Attacks: Attacks like "Edit DOS" and "Extend DOS" showed high success rates in generating evasive samples. For instance, "Extend DOS" was able to create an evasive sample within a single iteration for about half of the tested malware samples.
  • Reduced Iterations: For successful adversarial examples, the majority of attacks required 15 iterations or fewer, with some, like "Edit DOS" and "Extend DOS," often achieving evasion within the first 1-5 iterations.
  • Sampling Method Impact: Thompson sampling was nearly twice as effective as UCB1 in creating evasive samples over 4,500 iterations.
  • Classifier Limitations: The MalConv classifier showed a significant drop in detection rate when faced with DOS header manipulation attacks, with some achieving less than 30% detection after 25 iterations in prior research.

Limitations and Future Work

The authors acknowledge that their research was primarily focused on the MalConv classifier. A key limitation was the inability to gather detailed iteration information for modifications implemented solely in the MAB-Malware library (Section Append, Section Rename, Code Randomization). Future work could involve testing these adversarial attack generation techniques against commercial antivirus engines, not just research-oriented classifiers. Further exploration into optimizing the action minimizer in MAB-Malware and investigating the impact of different machine learning parameters and sampling algorithms is also suggested.

Summary updated

BibTeX
@inproceedings{spencer2022dissecting,
  author = {Hamish Spencer and Wei Wang and Ruoxi Sun and Minhui Xue},
  title = {{Dissecting Malware in the Wild}},
  booktitle = {ACSW},
  year = {2022},
  doi = {10.1145/3511616.3513099},
}
Figure