Abstract
Malware family classification aims to identify the specific family (e.g., GuLoader or BitRAT) a malware sample may belong to, in contrast to malware detection or sample classification, which only predicts a Yes/No outcome. Accurate family identification can greatly facilitate automated sample labeling and understanding on crowdsourced malware analysis platforms such as VirusTotal and MalwareBazaar, which generate vast amounts of data daily. In this paper, we explore and assess the feasibility of using traditional binary string features for family classification in the new era of large language models (LLMs) and Retrieval-Augmented Generation (RAG). Specifically, we investigate how Family-Specific String (FSS) features can be utilized in a manner similar to RAG to facilitate family classification. To this end, we develop a curated evaluation framework covering 4,347 samples from 67 malware families, extract and analyze over 25 million strings, and conduct detailed ablation studies to assess the impact of different design choices in four major modules, with each providing a relative improvement ranging from 8.1% to 120%.
Introduction
In the field of cybersecurity, while malware detection (identifying if a file is malicious) is a relatively mature area, malware family classification remains a complex challenge. Identifying whether a sample is a variant of GuLoader, BitRAT, or AgentTesla is vital for threat intelligence and incident response. Traditional approaches often struggle with scalability (manual signatures), cost (dynamic analysis), or interpretability (deep learning on raw bytes).
Historically, "strings"—human-readable text like URLs, file paths, and API names embedded in binaries—were considered too noisy or easily obfuscated for reliable classification. This research re-evaluates string-based classification by leveraging the semantic reasoning of Large Language Models (LLMs) and the efficiency of Retrieval-Augmented Generation (RAG).
Methodology: The FSS Pipeline
The core of the proposed approach is the identification and utilization of Family-Specific Strings (FSS)—strings that appear uniquely or predominantly within a single malware family. The authors developed a four-stage pipeline to harness these features.
- String Extraction: The process begins by extracting strings using static tools like FLOSS. To overcome obfuscation, a hybrid approach is employed where dynamic execution (via Falcon Sandbox) captures strings that only materialize in memory during runtime.
- Vector Database Construction: To manage the noise inherent in binary strings, an LLM-assisted filtering process is used. The study found that strings shorter than 13 characters are generally non-informative. High-value strings are converted into embeddings and stored in a searchable vector database.
- Observation Point (OP) Selection: Given the thousands of strings in a typical sample, the system must select representative "query" strings. The research demonstrates that using k-means clustering to select centroids as OPs is significantly more effective than random sampling.
- Inference and Classification: Retrieved FSS "hints" from the database are used for final classification. The study compares statistical vector-based scoring against LLM-based reasoning (using fine-tuned GPT-4o-mini).
Experimental Setup and Datasets
The evaluation framework utilized a comprehensive dataset curated from MalwareBazaar. The dataset was structured to test both the construction of the knowledge base and the system's ability to generalize to new, unseen threats from early 2024.
The testing set specifically included samples from 67 families, ensuring a diverse and challenging evaluation environment for the RAG-based classification model.
Key Insights and Results
The study yielded several critical insights into the modern application of string-based features:
- Semantic Filtering Efficiency: Using GPT-3.5 to evaluate string meaningfulness helped establish an optimal length threshold ($L=13$). This filtering reduced database size by an order of magnitude while increasing top-1 accuracy by 29%.
- Vector Scoring vs. LLM Reasoning: Interestingly, simple vector-based similarity scoring slightly outperformed fine-tuned LLMs in the final classification step. This is attributed to the LLM's sensitivity to "garbled" or unparseable strings common in malware, whereas vector methods proved more robust to such noise.
- Impact of Dynamic Analysis: For heavily obfuscated families (e.g., Stop or Formbook), static analysis is often insufficient. Integrating dynamic execution data provided a massive performance boost, with improvements up to 120%.
- Interpretability: A major advantage of this RAG-based approach is its inherent interpretability. Unlike "black box" deep learning models, this system provides the specific strings that triggered a classification, allowing security analysts to verify the results manually.
Conclusion and Future Work
This research demonstrates that traditional string features, when combined with RAG and LLM technologies, remain a powerful and interpretable tool for malware family classification. While obfuscation remains a challenge, the hybrid static-dynamic approach significantly mitigates this issue. Future work will explore hybrid inference engines that combine the robustness of vector scoring with the nuanced reasoning of LLMs to further refine classification accuracy.
Summary updated