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

跨内联二进制函数相似性检测

Cross-Inlining Binary Function Similarity Detection

Ang Jia, Ming Fan, Xi Xu, Wuxia Jin, Haijun Wang, Ting Liu

AI总结:

本文针对函数内联导致的二进制函数相似性检测难题,构建跨内联数据集并提出基于模式的CI-Detector模型,利用属性CFG和GNN分别建模三种跨内联模式,最终取得81%精确率和97%召回率,优于现有方法。

摘要:

二进制函数相似性检测在广泛的安全应用中发挥着重要作用。现有工作通常假设查询函数与目标函数具有相同的语义,并通过比较其完整语义来获得相似性。然而,我们发现函数映射更为复杂,尤其是在发生函数内联时。本文系统地研究跨内联二进制函数相似性检测。我们首先通过使用9个编译器、4种优化级别,针对6种架构,并设置2个内联标志,编译51个项目,构建了一个跨内联数据集,最终得到两个各包含216种组合的数据集。然后,我们通过关联这两个数据集中的公共源函数,构建跨内联函数映射。通过对该数据集的分析,我们发现三种跨内联模式广泛存在,而现有工作在检测跨内联二进制函数相似性时表现不佳。接下来,我们提出了一种基于模式的模型CI-Detector用于跨内联匹配。CI-Detector使用带属性的CFG来表示二进制函数的语义,并使用GNN将二进制函数嵌入为向量。CI-Detector分别为这三种跨内联模式训练一个模型。最后,将测试对输入到这三个模型中,并对产生的所有相似性进行聚合以得到最终相似性。我们进行了多项实验来评估CI-Detector。结果表明,CI-Detector检测跨内联对的精确率为81%,召回率为97%,超过了所有最先进的工作。

英文摘要:

Binary function similarity detection plays an important role in a wide range of security applications. Existing works usually assume that the query function and target function share equal semantics and compare their full semantics to obtain the similarity. However, we find that the function mapping is more complex, especially when function inlining happens. In this paper, we will systematically investigate cross-inlining binary function similarity detection. We first construct a cross-inlining dataset by compiling 51 projects using 9 compilers, with 4 optimizations, to 6 architectures, with 2 inlining flags, which results in two datasets both with 216 combinations. Then we construct the cross-inlining function mappings by linking the common source functions in these two datasets. Through analysis of this dataset, we find that three cross-inlining patterns widely exist while existing work suffers when detecting cross-inlining binary function similarity. Next, we propose a pattern-based model named CI-Detector for cross-inlining matching. CI-Detector uses the attributed CFG to represent the semantics of binary functions and GNN to embed binary functions into vectors. CI-Detector respectively trains a model for these three cross-inlining patterns. Finally, the testing pairs are input to these three models and all the produced similarities are aggregated to produce the final similarity. We conduct several experiments to evaluate CI-Detector. Results show that CI-Detector can detect cross-inlining pairs with a precision of 81% and a recall of 97%, which exceeds all state-of-the-art works.

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

↑