Evading Classifiers by Morphing in the Dark

Hung Dang, Yue Huang, Ee-Chien Chang

TL;DR

This paper introduces "EvadeHC," a novel black-box attack that evades PDF malware classifiers with minimal knowledge of the classifier's internals or training data. It achieves this by "morphing" malicious PDF files in the dark, using only the classifier's binary accept/reject decision and a separate malware tester, demonstrating significant efficiency gains over existing methods.

What Problem Does This Paper Address?

Machine learning classifiers have become ubiquitous in security applications, including malware detection. However, these systems are vulnerable to adversarial attacks where malicious inputs are subtly modified to evade detection. Existing evasion techniques often assume the attacker has significant knowledge about the target classifier, such as its internal workings, training data, or even its confidence scores for given inputs. This paper tackles a more realistic and constrained scenario: an attacker with only black-box access to the classifier (only knowing its final decision, e.g., "accept" or "reject") and a tool to "morph" malicious samples. The challenge is to find an evading sample without any insight into why the classifier makes its decisions, relying solely on trial and error guided by a novel scoring mechanism.

Methods

The core of the proposed solution is the EvadeHC algorithm. It operates in a "dark" environment, meaning the attacker only knows the binary output of the detector (accept/reject) and the outcome of a separate malware tester (malicious/benign).

Key components include:

  • Black-box Morpher (M): A tool that takes a sample and a random seed to produce a morphed version. The adversary doesn't know how M works internally, treating it as a black box.
  • Tester (T): A separate tool (e.g., a sandbox) that verifies if a morphed sample still retains its malicious functionality.
  • Detector (D): The target PDF malware classifier, which only outputs a binary decision (accept/reject).
  • Scoring Mechanism: A novel function that assigns a real-value score to a sample based on the "flipping distances" – how many morphing steps it takes for a sample to become benign (malice-flipping distance) and how many steps to be accepted by the detector (reject-flipping distance). This score helps guide the search.
  • Hill-Climbing Approach (EvadeHC): This algorithm iteratively searches for evading samples. It maintains a set of candidate samples and, in each iteration, generates new paths by morphing from these candidates. It uses the scoring mechanism to select the most promising candidates for the next iteration, effectively "climbing" towards an evading sample. EvadeHC employs a branch-and-bound technique to efficiently search for the best candidates, significantly reducing the number of detector queries.

The paper also introduces baseline methods like SeqRand (a simple random search) and BiRand (an optimized binary search approach) for comparison.

Datasets

The experiments were conducted using a dataset of 500 malicious PDF files sourced from the Contagio archive, previously used in similar research [35]. These samples were selected because they exhibited malicious behavior, were compatible with the morphing mechanism, and were initially rejected by both target detectors. The authors also used ten benign PDF files to provide "benign objects" for the morphing process.

Key Insights and Ideas

  • Evasion is possible with minimal knowledge: The most striking insight is that effective evasion attacks can be mounted even when the attacker has very limited information about the target classifier, challenging the notion that hiding classification scores is a sufficient defense.
  • Scoring mechanism is key: The novel scoring function, derived from malice-flipping and reject-flipping distances, proves to be more informative than relying solely on classifier confidence scores, enabling more efficient evasion.
  • Domain-agnostic approach: While tested on PDF malware, the core principles of EvadeHC are domain-agnostic, suggesting broader applicability to other machine learning-based security systems.
  • Hardened detectors are still vulnerable: Even when detectors are "hardened" by adjusting their thresholds to be more restrictive, EvadeHC demonstrates significant robustness and achieves higher evasion rates compared to existing methods.

Key Results

  • 100% Evasion Rate: EvadeHC achieved a 100% evasion rate against both PDFRATE and Hidost detectors on the experimental dataset.
  • Significant Efficiency Gains: EvadeHC dramatically reduced the number of detector queries and overall running time compared to baseline methods like SeqRand and BiRand. For instance, it required up to 450 times fewer detector queries and was orders of magnitude faster than SeqRand.
  • Robustness against Hardened Detectors: Even when detectors were hardened by lowering malware thresholds, EvadeHC maintained a significantly higher evasion rate (e.g., 62% against hardened Hidost) compared to BiRand (8%) and EvadeGP (50%).
  • Superiority over Score-Based Methods: EvadeHC outperformed a score-based evasion technique (EvadeGP) even without access to classification scores, highlighting the effectiveness of its scoring mechanism.

Limitations and Future Work

  • "Dark" Morpher Assumption: The paper assumes a "blackbox morpher" that is consistent but whose internal workings are unknown. If the morpher's behavior were more predictable or exploitable, evasion might be easier.
  • Tester Cost: While the focus is on minimizing detector queries, the tester (sandbox) can be computationally expensive. The paper notes that if tester queries were more costly, the binary search could be adapted to minimize tester queries instead.
  • Hardening Thresholds: The paper suggests that setting more "restrictive" malware thresholds could be a mitigation strategy, but acknowledges this requires further investigation.
  • Randomization as Defense: The authors propose randomization in classifiers (flipping decisions near the threshold) as a potential defense, but note its effectiveness needs more study.
  • Stateful Detection: The paper suggests that detecting evasion attempts by maintaining state and using similarity clustering on queried samples could be a defensive measure.
  • Evasion for Defense: The authors propose that their evasion techniques could be used to generate diverse adversarial examples for training more robust classifiers.

Summary updated

BibTeX
@inproceedings{dang2017evading,
  author = {Hung Dang and Yue Huang and Ee-Chien Chang},
  title = {{Evading Classifiers by Morphing in the Dark}},
  booktitle = {CCS},
  year = {2017},
  url = {https://openreview.net/forum?id=5TwuBu_DWG_},
}
Figure