arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2108.06082cs.CR
收藏

Asteria:基于深度学习的AST编码,用于跨平台二进制代码相似性检测

Asteria: Deep Learning-based AST-Encoding for Cross-platform Binary Code Similarity Detection

Shouguo Yang, Long Cheng, Yicheng Zeng, Zhe Lang, Hongsong Zhu, Zhiqiang Shi

摘要:

二进制代码相似性检测是漏洞搜索、补丁分析和恶意软件检测等安全应用的基础技术。随着物联网设备中关键漏洞的增加,越来越需要检测跨架构的漏洞搜索的类似代码。物联网硬件架构和软件平台的多样性要求在相似性检测中捕获代码片段的语义等价性。然而,现有的方法是不够的,在捕捉语义相似性。我们注意到,函数的抽象语法树(AST)包含了丰富的语义信息。受自然语言处理技术在句子语义理解中成功应用的启发,提出了一种基于深度学习的AST编码方法ASTERIA,用于度量不同平台下函数的语义等价性。我们的方法利用Tree-LSTM网络从AST中学习函数的语义表示。然后通过度量两个表示向量之间的相似性,可以高效、准确地进行相似性检测。我们已经实现了一个开放源代码的原型ASTERIA。Tree-LSTM模型在具有1,022,616个函数对的数据集上进行训练,并在具有95,078个函数对的数据集上进行评估。评估结果表明,我们的方法优于基于AST的工具Diaphora和国家的最先进的方法双子座的大利润率方面的二进制相似性检测。在相似度计算上,我们的方法比Diaphora和Gemini方法快了几个数量级。在漏洞搜索的应用中,我们的工具成功识别了5,979个物联网固件映像中的75个漏洞功能。

英文摘要:

Binary code similarity detection is a fundamental technique for many security applications such as vulnerability search, patch analysis, and malware detection. There is an increasing need to detect similar code for vulnerability search across architectures with the increase of critical vulnerabilities in IoT devices. The variety of IoT hardware architectures and software platforms requires to capture semantic equivalence of code fragments in the similarity detection. However, existing approaches are insufficient in capturing the semantic similarity. We notice that the abstract syntax tree (AST) of a function contains rich semantic information. Inspired by successful applications of natural language processing technologies in sentence semantic understanding, we propose a deep learning-based AST-encoding method, named ASTERIA, to measure the semantic equivalence of functions in different platforms. Our method leverages the Tree-LSTM network to learn the semantic representation of a function from its AST. Then the similarity detection can be conducted efficiently and accurately by measuring the similarity between two representation vectors. We have implemented an open-source prototype of ASTERIA. The Tree-LSTM model is trained on a dataset with 1,022,616 function pairs and evaluated on a dataset with 95,078 function pairs. Evaluation results show that our method outperforms the AST-based tool Diaphora and the-state-of-art method Gemini by large margins with respect to the binary similarity detection. And our method is several orders of magnitude faster than Diaphora and Gemini for the similarity calculation. In the application of vulnerability search, our tool successfully identified 75 vulnerable functions in 5,979 IoT firmware images.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑