用少量API导入让恶意软件伪装成特定良性程序,且不破坏功能。
Learning to Look Benign: Targeted Evasion of Malware Detectors via API Import Injection

- 基于条件变分自编码器,仅添加API而不删改原有代码。
- 仅加20个API就使检测召回率从87.5%降至30%,99%被误判为目标类别。
- 攻击可迁移至真实文件,使商业引擎平均减少54.5%告警,适合安全研究者参考。
基于机器学习的恶意软件检测器广泛部署于杀毒与终端防护系统中,但其依赖静态特征使其易受对抗性干扰。本文探究能否通过引入少量目标良性类别的典型Win32 API导入,使恶意样本被故意误分类为特定良性类别(而非简单归为“非恶意”),且不移除已有导入或重新训练检测器。提出一种以条件变分自编码器(CVAE)为核心的框架,其解码器严格为加法型,仅能新增API调用,从而在设计上保留恶意功能。针对每个恶意样本,框架自动识别最接近的良性类别作为攻击目标。采用知识蒸馏的可微分代理模型实现对非可微集成检测器的梯度训练。在包含3,799个Windows可执行文件、提取自六类二进制API导入向量的数据集(五类良性,一类恶意)上实验显示,当检测器达到87.5%恶意召回率时,仅添加20个API即可将召回率降至30%;在注入数量k=20时,99%成功逃逸的样本被正确分类为目标类别。该方法在所有测试注入规模(k=5至50)下均优于频率基线与随机选择。在真实PE文件上验证表明,该攻击可迁移至商用静态检测引擎,平均使告警引擎比例下降54.5%。结果揭示了基于API的恶意软件分类器存在的具体漏洞,证明了在最小化、功能保持的前提下,实现对指定良性类别的精准逃避是可行的。
原文摘要 · Abstract (English)
Machine learning-based malware detectors are widely deployed in antivirus and endpoint detection systems, yet their reliance on static features makes them vulnerable to adversarial manipulation. This paper investigates whether a malware sample can be intentionally misclassified as a specific benign software category, not merely as "not malware", by adding a small number of Win32 API imports characteristic of that selected category, without removing any existing imports or retraining the detector. We propose a framework centered on a Conditional Variational Autoencoder (CVAE) whose decoder is strictly additive. It can introduce new API calls but never remove existing ones, preserving malware functionality by design. For each malware sample, the framework automatically identifies which benign category it most closely resembles and uses that as the evasion target. A knowledge-distilled differentiable proxy enables gradient-based training against the non-differentiable ensemble detector. Experiments on a six-class dataset of binary Win32 API import vectors extracted from 3,799 Windows executables (five benign categories, one malware class) show that, against a detector achieving 87.5% malware recall, adding just 20 API imports reduces recall to 30%. At k=20, among samples that evaded detection, 99% are classified as the intended target category. The CVAE outperforms both a frequency-based baseline and random selection at every tested injection size (k = 5 to 50). Validation on real PE files submitted to VirusTotal confirms that the attack transfers to commercial static detection engines, with an average 54.5% reduction in flagging engines. These findings expose a concrete vulnerability in API-based malware classifiers and demonstrate that targeted evasion into a chosen benign category is achievable with minimal, functionality-preserving modifications.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。