Defending Hardware-based Malware Detectors against Adversarial Attacks

Abraham Peedikayil Kuruvila, Shamik Kundu, Kanad BasuarXiv 2020

TL;DR

Hardware-assisted Malware Detection (HMD) offers a low-overhead way to spot malicious software using low-level processor data, but it remains highly vulnerable to adversarial attacks. This paper introduces a Moving Target Defense (MTD) that dynamically shuffles multiple machine learning classifiers trained on different hardware features. By constantly shifting the attack surface, it makes it mathematically near-impossible ($10^{-1864}$ probability) for an attacker to evade detection, restoring up to 99.4% of the system's original accuracy.

What Problem Does This Paper Address?

Traditional software-based anti-virus tools struggle to keep pace with modern polymorphic malware and often introduce significant performance overhead. To solve this, researchers developed Hardware-assisted Malware Detection (HMD). HMDs monitor Hardware Performance Counters (HPCs)—specialized hardware registers that log low-level microarchitectural events like cache misses, branch instructions, and CPU cycles—and feed this data into machine learning classifiers to flag anomalies.

However, HMDs have a critical blind spot: adversarial attacks. An attacker can treat the HMD as a black box, reverse-engineer its behavior, and deploy an "adversarial sample generator" alongside their malware. By executing benign dummy loops or specific array operations, the malware artificially inflates its HPC metrics, effectively cloaking its malicious behavior and tricking the classifier into labeling it as benign. Figure 1 illustrates how this attack successfully bypasses standard hardware detection pipelines.

Figure 1: Process Flow Diagram of Malware Detection.

Methods

The authors combat these stealthy attacks by introducing a Moving Target Defense (MTD) framework. Instead of relying on a single classifier monitoring a fixed set of hardware features, the MTD system constantly changes the combination of features it inspects.

The methodology consists of two main phases:

  1. Feature Selection & Clustering: The authors use statistical methods—Univariate Selection, Feature Importance (via Decision Trees), and Correlation Matrices—to identify which HPCs are highly correlated with malware detection and with each other. This allows them to group optimal combinations of hardware features.
  2. Dynamic Shuffling: The runtime HPC data stream is split into short time intervals (e.g., 10 ms). For each iteration, a Linear Feedback Shift Register (LFSR) acts as a pseudo-random number generator to select one of $C$ pre-trained classifiers to evaluate the current window of data.

As shown in the architecture diagram (Figure 5), because the active classifier changes dynamically, the attacker cannot predict which hardware features are being monitored at any given millisecond.

Figure 5: Proposed Moving Target Defense.

Datasets

To ensure practical validity, the authors avoided virtualized environments (where HPC behavior can be distorted) and tested their framework on bare-metal systems:

  • Hardware Platforms: An ARM-based Raspberry Pi 3 Model B (Cortex-A53) and a standard x86 processor, using the Linux perf tool for data collection.
  • Malware Data: 300 initial malware samples collected from VirusShare, with an additional 50 samples reserved for adversarial testing.
  • Benign Data: Initially composed of the MiBench benchmark suite and basic computational algorithms. To simulate real-world workloads, the dataset was later adjusted to include web browsers, word processors, programming IDEs, and the SPEC and Phoronix benchmark suites.

Key Insights and Ideas

  • Turning Constraints into a Defense: Modern CPUs contain hundreds of HPCs, but hardware limitations allow only 4 to 6 to be monitored simultaneously. While this restriction normally helps attackers target specific counters, the MTD turns the vast pool of unused counters into a massive combinatorial defense space.
  • Precision is the True Target: The authors note that adversarial attacks specifically target precision rather than overall accuracy, dropping it to ~50% (equivalent to a random guess). This means malware successfully evades detection while benign programs pass normally, highlighting why static defenses fail.
  • The Priority Shuffling Trade-off: Shuffling too many classifiers can introduce non-optimal HPC features, slightly degrading baseline accuracy. The authors discovered that a priority-based selection—where the best-performing classifier is given higher priority while others are shuffled in randomly—maintains robust security without sacrificing detection performance.

Key Results

  • Precision Restoration: Under a strengthened adversarial attack, the precision of standard Decision Tree (DT) and Neural Network (NN) classifiers plummeted to near coin-toss levels (~50-53%). Implementing the MTD improved classification accuracy by up to 31.5%, achieving a 97.1% to 99.4% restoration of the original accuracy (see Figure 2).
Figure 2: Precision before and after Adversarial Attack.
  • Cross-Architecture Resilience: On x86 architectures, the MTD successfully restored DT accuracy by 25.7% and NN accuracy by 28.07% against adversarial manipulation.
  • Negligible Hardware Overhead: Hardware synthesis using the Synopsys Design Compiler demonstrated that integrating two parallel classifiers alongside an LFSR incurs minimal area and power overhead, making it highly practical for edge devices and IoT hardware.

Limitations and Future Work

A notable limitation is the accuracy trade-off when scaling the defense: as more classifiers are added to the pool, less-optimal HPC features must be utilized, which can cause baseline accuracy to diminish.

For future work, the authors plan to expand the MTD framework beyond Decision Trees and Neural Networks to evaluate other machine learning architectures, including Naive Bayes, Logistic Regression, Support Vector Machines (SVM), and Random Forests, to analyze their collective robustness against microarchitectural tampering.

Summary updated

BibTeX
@misc{kuruvila2020defending,
  author = {Abraham Peedikayil Kuruvila and Shamik Kundu and Kanad Basu},
  title = {{Defending Hardware-based Malware Detectors against Adversarial Attacks}},
  year = {2020},
  eprint = {2005.03644},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2005.03644},
}

Loading related content...

Figure