MalGrid: Visualization Of Binary Features In Large Malware Corpora

Tajuddin Manhar Mohammed, Lakshmanan Nataraj, Satish Chikkagoudar, Shivkumar Chandrasekaran, B. S. ManjunatharXiv 2022

TL;DR

MalGrid is a novel visualization system that maps millions of malware samples onto a 2-dimensional spatial grid, allowing analysts to "see" the relationships between massive datasets at a glance. By converting binary files into images and using dimensionality reduction, it creates intuitive maps where malware families cluster together, significantly speeding up the triage and identification of new threats.

What Problem Does This Paper Address?

The cybersecurity landscape is currently drowning in data. With antivirus vendors like Kaspersky reporting an average of 380,000 new malware samples discovered every day, manual analysis is impossible. While most "new" malware are simply minor modifications of existing ones, the sheer volume makes it difficult for researchers to maintain situational awareness or quickly categorize new variants.

Current visualization tools often focus on single files or use complex, non-scalable feature representations that require executing the code (dynamic analysis). The authors of MalGrid sought a way to visualize entire corpora of malware statically—without running the code—to help analysts semantically arrange and explore the "malware space."

Methods

The MalGrid pipeline follows a clear four-step process to turn raw binaries into a visual map:

  1. Image Representation: Binaries are converted into grayscale images called Byteplots. This treats the raw bytes of a file as pixel intensity values, effectively turning code into a visual texture.
  2. Feature Extraction: The system extracts high-dimensional features from these images. The authors compared "hand-crafted" features (GIST descriptors) against "deep" features extracted from the final layers of pre-trained deep learning models like VGG-16, Xception, and ResNet-152.
  3. Dimensionality Reduction: To make the data viewable, these high-dimensional features (often thousands of dimensions) are squashed down to 2D. The authors tested several techniques, including PCA, UMAP, and Random Projections, but found t-SNE (t-Distributed Stochastic Neighbor Embedding) to be the most effective for spreading out and clustering the samples.
  4. Spatial Visualization: The resulting 2D points are displayed in two ways: a point-based scatter plot and a grid-based view where each sample is represented by a thumbnail icon.
Fig. 2: Block schematic of MalGrid visualization system to visualize large malware corpora.

Datasets

The researchers evaluated MalGrid using three primary datasets:

  • VirusShare: A random sample of 15,000 files (5,000 malware, 5,000 benign, and 5,000 unknown) used for initial visualization experiments.
  • Smalldata: A curated set of 9,339 malware and 7,228 benign samples scraped from Windows system files and the Malimg dataset.
  • Malimg: A well-known benchmark containing 9,339 malware executables categorized into 25 distinct families.

Key Insights and Ideas

  • Malware as Texture: The core "aha moment" is that malware variants belonging to the same family share similar visual textures when converted to Byteplots. This allows computer vision techniques to work where traditional signature-based methods might fail.
  • t-SNE Superiority: In the context of malware features, t-SNE proved significantly better at creating distinct, interpretable clusters compared to UMAP or PCA, which tended to produce more overlapping "blobs."
  • Resilience to Packing: One of the most interesting findings was how the visualization handles "packed" (obfuscated) malware. While complex packers like Themida increase the entropy and spread the clusters out, the family groupings remain visible, suggesting that visual features capture something fundamental about the underlying code that obfuscation can't entirely hide.
  • The "Semantic" Grid: By mapping samples to a grid, analysts can identify "empty spots" that might represent potential future variants, providing a proactive way to think about the evolution of a malware family.
Fig. 4: Visualization of Byteplot GIST [2] (320-dimensional) features for 15,000 samples using different dimensionality reduction techniques.

Key Results

The authors backed up their visualizations with impressive classification performance:

  • Binary Classification (Malware vs. Benign): Using VGG-16 features and a Random Forest classifier, they achieved an accuracy of 0.993.
  • Multi-class Classification (Family ID): On the Malimg dataset (25 families), ResNet-152 features achieved 0.987 accuracy.
  • Visual Separation: The visualizations clearly show malware and benign samples occupying different regions of the feature space, and malware families forming distinct "clouds" that match the high classification scores.
Visualization of malware families, showing how different types of malware naturally cluster into distinct, color-coded groups.

Limitations and Future Work

While MalGrid is powerful, the authors noted several areas for improvement:

  • Platform Specificity: The current study focused exclusively on Windows binaries. Future work is needed to see if these visual patterns hold for Android (APK) or Linux (ELF) malware.
  • Adversarial Attacks: The paper doesn't deeply explore how a malware author might intentionally craft a binary to "look" like a benign file or a different family to fool the visualization.
  • Scaling to 3D: The authors suggest that moving to 3D visualizations could help manage even larger datasets in the range of hundreds of millions of samples.

Summary updated

BibTeX
@misc{mohammed2022malgrid,
  author = {Tajuddin Manhar Mohammed and Lakshmanan Nataraj and Satish Chikkagoudar and Shivkumar Chandrasekaran and B. S. Manjunath},
  title = {{MalGrid: Visualization Of Binary Features In Large Malware Corpora}},
  year = {2022},
  eprint = {2211.02696},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2211.02696},
}
Figure