一句话:首个实证研究揭示混淆会显著影响静态机器学习恶意JavaScript检测器,并指出其根因与真实环境普遍性。
机器学习正被广泛用于恶意 JavaScript 检测,但恶意与良性脚本常在上传前进行混淆,且混淆会引入死代码等额外特征,可能干扰基于静态特征的检测器。本文首次开展实证研究,系统分析不同混淆器如何影响静态机器学习检测器的效果。结果表明:混淆会显著提升假阴性率与假阳性率;若训练集存在混淆偏置,检测器会倾向于识别混淆而非恶意行为。通过增加相关混淆样本或采用先进深度学习模型等常见措施并不能很好缓解该问题。其根因在于所用特征空间仅反映代码表层差异,而非良性/恶意本质,易受混淆带来的差异影响。VirusTotal 中的真实检测器也出现类似现象,说明这是普遍的现实问题。
Machine learning is increasingly being applied to malicious JavaScript detection in response to the growing number of Web attacks and the attendant costly manual identification. In practice, to hide their malicious behaviors or protect intellectual copyrights, both malicious and benign scripts tend to obfuscate their own code before uploading. While obfuscation is beneficial, it also introduces some additional code features (e.g., dead code) into the code. When machine learning is employed to learn a malicious JavaScript detector, these additional features can affect the model to make it less effective. However, there is still a lack of clear understanding of how robust existing machine learning-based detectors are on different obfuscators. In this paper, we conduct the first empirical study to figure out how obfuscation affects machine learning detectors based on static features. Through the results, we observe several findings: 1) Obfuscation has a significant impact on the effectiveness of detectors, causing an increase both in false negative rate (FNR) and false positive rate (FPR), and the bias of obfuscation in the training set induces detectors to detect obfuscation rather than malicious behaviors. 2) The common measures such as improving the quality of the training set by adding relevant obfuscated samples and leveraging state-of-the-art deep learning models can not work well.3) The root cause of obfuscation effects on these detectors is that feature spaces they use can only reflect shallow differences in code, not about the nature of benign and malicious, which can be easily affected by the differences brought by obfuscation. 4) Obfuscation has a similar effect on realistic detectors in VirusTotal, indicating that this is a common real-world problem.
@inproceedings{RenQWZZ023,
title = {An Empirical Study on the Effects of Obfuscation on Static Machine Learning-Based Malicious JavaScript Detectors},
author = {Kunlun Ren and Weizhong Qiang and Yueming Wu and Yi Zhou and Deqing Zou and Hai Jin},
booktitle = {ISSTA},
year = {2023},
doi = {10.1145/3597926.3598146}
}