基于AMSI的上下文嵌入恶意PowerShell码检测
AMSI-Based Detection of Malicious PowerShell Code Using Contextual Embeddings
摘要:
PowerShell是一个命令行shell,支持脚本语言。它被广泛用于组织的配置管理和任务自动化,但也越来越多地被网络犯罪分子用于对组织发动网络攻击,主要是因为它预装在Windows机器上,并暴露了攻击者可能利用的强大功能。这使得检测恶意PowerShell代码的问题既紧迫又具有挑战性。微软的反恶意软件扫描接口(AMSI)允许防御系统在执行之前扫描传递给脚本引擎(如PowerShell)的所有代码。在这项工作中,我们使用AMSI提供的信息进行恶意PowerShell代码检测的第一次研究。我们提出了几种新的基于深度学习的恶意PowerShell代码检测器,这些代码采用来自PowerShell“语言”的单词的预训练上下文嵌入。网络安全领域的一个已知问题是,与未标记数据相比,标记数据相对稀缺,这使得难以设计对许多类型的恶意活动的有效监督检测。PowerShell代码也是如此。我们的工作表明,这个问题可以通过学习基于未标记数据的预训练上下文嵌入来缓解。我们使用AMSI从一家大型反恶意软件供应商收集的真实数据来训练和评估我们的模型。我们的性能分析表明,使用未标记的数据进行嵌入显着提高了我们的检测器的性能。我们性能最好的模型使用的架构能够处理字符和标记级别的文本信号,并获得近90%的真阳性率,同时保持低于0.1%的低假阳性率。
英文摘要:
PowerShell is a command-line shell, supporting a scripting language. It is widely used in organizations for configuration management and task automation but is also increasingly used by cybercriminals for launching cyberattacks against organizations, mainly because it is pre-installed on Windows machines and exposes strong functionality that may be leveraged by attackers. This makes the problem of detecting malicious PowerShell code both urgent and challenging. Microsoft's Antimalware Scan Interface (AMSI) allows defending systems to scan all the code passed to scripting engines such as PowerShell prior to its execution. In this work, we conduct the first study of malicious PowerShell code detection using the information made available by AMSI. We present several novel deep-learning based detectors of malicious PowerShell code that employ pretrained contextual embeddings of words from the PowerShell "language". A known problem in the cybersecurity domain is that labeled data is relatively scarce in comparison with unlabeled data, making it difficult to devise effective supervised detection of malicious activity of many types. This is also the case with PowerShell code. Our work shows that this problem can be mitigated by learning a pretrained contextual embedding based on unlabeled data. We trained and evaluated our models using real-world data, collected using AMSI from a large antimalware vendor. Our performance analysis establishes that the use of unlabeled data for the embedding significantly improved the performance of our detectors. Our best-performing model uses an architecture that enables the processing of textual signals from both the character and token levels and obtains a true positive rate of nearly 90% while maintaining a low false-positive rate of less than 0.1%.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。