Attacks on Visualization-Based Malware Detection: Balancing\n Effectiveness and Executability

Hadjer Benkraouda, Jingyu Qian, Hung Quoc Tran, Berkay Kaplan · DOI

Introduction

As malware evolves, traditional signature-based detection often fails to keep pace with rapid mutations. In response, security researchers have increasingly turned to computer vision techniques. By transforming binary code into image representations, Convolutional Neural Networks (CNNs) can be trained to identify malicious patterns that are often obscured from traditional scanners. These visualization-based systems offer high speed and accuracy without the inherent risks of executing suspicious code.

The Visualization Paradigm

The core of this approach lies in mapping binary data to a visual space. Typically, a malware binary is converted into an 8-bit vector, where each byte corresponds to a pixel intensity, resulting in a grayscale image. More advanced methods may incorporate metadata or entropy values to create multi-channel RGB images, allowing the CNN to process the binary as if it were a standard photograph.

The Adversarial Challenge: The Inverse Feature-Mapping Problem

Despite their success, these "visual" detectors are vulnerable to adversarial examples—malicious samples specifically crafted to trick machine learning models into misclassification. While adversarial attacks are well-documented in standard image recognition, applying them to malware introduces a unique constraint: executability.

In a standard image, changing a few pixels might make a cat look like a dog to an AI, but the image remains an image. In malware, a "pixel" is a functional byte of code. If an attack modifies these bytes haphazardly, the resulting binary will likely crash, losing its malicious functionality. This creates the "Inverse Feature-Mapping Problem": how can an attacker manipulate an image's pixels in a way that translates back into valid, functional machine code?

Methods: Bridging the Gap with Semantic NOPs

To solve this, researchers proposed a four-stage pipeline designed to ensure that adversarial perturbations do not break the underlying program:

  1. Mask Generator: This component identifies "instruction boundaries" within the code section. It creates a mask that restricts changes to specific gaps, ensuring the core malicious logic remains untouched.
  2. AE Generator: Utilizing a modified Carlini & Wagner (C&W) attack, the system determines the mathematically optimal pixel changes needed to trigger a "benign" classification.
  3. NOP Generator: This is the critical innovation. Instead of using simple padding, the system uses a library of Semantic NOPs—sequences of instructions that perform no operation on the program state (e.g., add eax, 0 or push/pop pairs).
  4. AE Optimizer: This stage maps the mathematical perturbations to the closest matching instructions from the NOP library. By weaving these NOPs into the binary, the attack creates a file that looks different to a CNN but behaves identically to the original malware.

Key Results and Insights

The effectiveness of this approach was demonstrated on the Malimg and AOCD datasets. On the "Dialplatform.B" malware family, the attack achieved a staggering 98.9% success rate in evading detection. Crucially, 100% of the generated samples remained fully functional and executable.

Unlike previous "padding" attacks that could be easily stripped by pre-processing filters, these perturbations are woven directly into the reachable code section, making the adversarial noise inseparable from the program itself. However, the study also noted scaling challenges; for massive binaries with hundreds of thousands of instructions, the success rate dipped to approximately 81.8%, and generation time increased significantly.

Conclusion and Future Directions

This research highlights a significant vulnerability in visualization-based malware detection. By respecting the constraints of the underlying binary architecture through semantic NOPs, attackers can create robust, functional adversarial examples. Future work will focus on reducing the time overhead for large files and exploring whether perturbations can be safely extended to data sections to further increase the available "attack surface" within a binary.

Summary updated

BibTeX
@misc{benkraouda2021attacks,
  author = {Hadjer Benkraouda and Jingyu Qian and Hung Quoc Tran and Berkay Kaplan},
  title = {{Attacks on Visualization-Based Malware Detection: Balancing\textbackslash\{\}n Effectiveness and Executability}},
  year = {2021},
  eprint = {2109.10417},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2109.10417},
}
Figure