An Insight into the Machine-Learning-Based Fileless Malware Detection

Osama Khalid, Subhan Ullah, Tahir Ahmad, Saqib Saeed, Dina A. Alabbad, Mudassar Aslam, Attaullah Buriro, Rizwan Ahmad2023 · DOI

TL;DR

This paper tackles the challenge of detecting fileless malware, which evades traditional file-based detection by operating in system memory. The authors propose a novel approach using memory forensics and machine learning, achieving a high accuracy of 93.3% with a Random Forest classifier.

What Problem Does This Paper Address?

Fileless malware represents a significant and growing threat in cybersecurity. Unlike traditional malware that relies on executable files stored on a system's hard drive, fileless malware operates directly in the computer's main memory (RAM). It achieves this by leveraging legitimate system tools and processes, such as PowerShell or WMI, to execute malicious code. This stealthy approach makes it incredibly difficult for conventional antivirus software, which primarily scans for malicious files, to detect and remove. The paper aims to bridge this gap by developing a robust detection mechanism specifically for this evasive type of malware.

Methods

The core of the proposed solution lies in a combination of memory forensics and machine learning.

  1. Memory Forensics: The authors utilize the Volatility Framework, a powerful memory forensics tool, to extract crucial features from memory dumps. This involves capturing a snapshot of a virtual machine's memory after executing both malicious and benign samples. Volatility plugins are then employed to analyze these dumps, extracting information about running processes, loaded DLLs, network connections, registry hives, and other system activities.
  2. Machine Learning: The extracted features are then fed into various machine learning classifiers. The goal is to train models that can distinguish between malicious and benign memory states. The paper explores several state-of-the-art algorithms, including Random Forest, Decision Tree, Support Vector Machine, Logistic Regression, K-Nearest Neighbor, XGBoost, and Gradient Boosting.
  3. Feature Engineering & Optimization: The study also investigates the impact of feature scaling (using StandardScaler) and parameter optimization (via k-fold cross-validation) on classifier performance.

Datasets

The study utilized a combination of publicly available datasets and newly collected samples:

  • VirusShare: A repository of live malware samples.
  • AnyRun: An online interactive sandbox for malware analysis.
  • PolySwarm: A crowdsourced threat detection marketplace.

The authors note that the initial dataset was unbalanced, with more non-malware samples than malware. They augmented this by adding 26 new fileless malware samples. However, only five of these new samples were successfully executed, leading to a dataset of 26 fileless malware samples and an unspecified number of benign samples.

Key Insights and Ideas

  • Memory as the Battleground: The paper strongly emphasizes that for fileless malware, the primary battleground is the system's memory, not the file system. This shifts the focus of detection from static file analysis to dynamic memory analysis.
  • Leveraging Benign Tools: Fileless malware's effectiveness stems from its ability to masquerade as legitimate system processes. This means detection methods need to be sophisticated enough to differentiate malicious activity within seemingly normal operations.
  • Random Forest's Robustness: The Random Forest classifier consistently performed well across various experimental settings (default vs. tuned parameters, scaled vs. unscaled features), highlighting its robustness and effectiveness for this specific detection task.
  • The Challenge of Limited Data: The study acknowledges that obtaining a large, representative dataset of fileless malware is a significant challenge, impacting the generalizability of models.

Key Results

The study achieved a maximum accuracy of 93.3% using the Random Forest classifier. This was accompanied by a True Positive Rate (TPR) of 87.5% and a False Positive Rate (FPR) of 0%. This indicates a highly effective model for correctly identifying fileless malware while minimizing false alarms. The Random Forest classifier demonstrated superior performance compared to other evaluated algorithms like Logistic Regression, SVM, KNN, XGBoost, and Decision Tree.

Limitations and Future Work

The authors acknowledge several limitations:

  • Limited Dataset Size: The dataset used was relatively small (26 fileless malware samples), which can impact the generalizability and robustness of the models.
  • Dataset Imbalance: While efforts were made to balance the dataset, it remained somewhat unbalanced.
  • CnC Server Dependency: Some collected malware samples could not be executed because their Command and Control (CnC) servers were inactive, highlighting the ephemeral nature of some malware samples.

For future work, the authors suggest:

  • Incorporating More Features: Including features related to process creation, network connections, system behavior, configurations, and user activity could further enhance detection accuracy.
  • Exploring Deep Learning: Investigating deep learning approaches, which are known for their ability to learn complex patterns in high-dimensional data, could lead to improved performance.
  • Larger, Diverse Datasets: Expanding the dataset with more diverse and representative samples is crucial for ensuring the model's robustness and generalization capabilities.
  • Data Augmentation: Exploring data augmentation techniques to generate synthetic samples could help overcome the limitations of small datasets.

Summary updated

BibTeX
@misc{khalid2023insight,
  author = {Osama Khalid and Subhan Ullah and Tahir Ahmad and Saqib Saeed and Dina A. Alabbad and Mudassar Aslam and Attaullah Buriro and Rizwan Ahmad},
  title = {{An Insight into the Machine-Learning-Based Fileless Malware Detection}},
  year = {2023},
  doi = {10.3390/s23020612},
}
Figure