Skip to main content
QUICK REVIEW

[论文解读] Asteria-Pro: Enhancing Deep-Learning Based Binary Code Similarity Detection by Incorporating Domain Knowledge

Shouguo Yang, Chaopeng Dong|arXiv (Cornell University)|Jan 2, 2023
Software Engineering Research被引用 6
一句话总结

Asteria-Pro 通过在预过滤和重排序模块中整合领域知识,增强了基于深度学习的二进制代码相似性检测,将计算时间减少了 96.9%,并将 MRR 和召回率分别提高了 23.71% 和 36.4%,在真实固件中检测出 1,482 个存在漏洞的函数,精度达到 91.65%。

ABSTRACT

The widespread code reuse allows vulnerabilities to proliferate among a vast variety of firmware. There is an urgent need to detect these vulnerable code effectively and efficiently. By measuring code similarities, AI-based binary code similarity detection is applied to detecting vulnerable code at scale. Existing studies have proposed various function features to capture the commonality for similarity detection. Nevertheless, the significant code syntactic variability induced by the diversity of IoT hardware architectures diminishes the accuracy of binary code similarity detection. In our earlier study and the tool Asteria, we adopt a Tree-LSTM network to summarize function semantics as function commonality and the evaluation result indicates an advanced performance. However, it still has utility concerns due to excessive time costs and inadequate precision while searching for large-scale firmware bugs. To this end, we propose a novel deep learning enhancement architecture by incorporating domain knowledge-based pre-filtration and re-ranking modules, and we develop a prototype based on Asteria called Asteria-Pro. Pre-filtration module seeks to eliminates dissimilar functions to boost subsequent deep learning model calculations, while re-ranking module aims to raises the rankings of vulnerable functions among candidates generated by deep learning model. Our evaluation indicates that pre-filtration module cuts the calculation time by 96.9% and re-ranking improves MRR and Recall by 23.71% and 36.4%. By incorporating the pre-filtration and re-ranking modules, Asteria-Pro outperforms existing state-of-the-art approaches in bug search task, by a significant large margin. We conduct a large-scale real-world firmware bug search and Asteria-Pro manages to detect 1,482 vulnerable functions with a high precision 91.65%.

研究动机与目标

  • 解决由于架构多样性与语法变异性导致的基于深度学习的物联网固件二进制代码相似性检测(BCSD)准确率低和计算成本高的挑战。
  • 克服现有 BCSD 工具严重依赖仿真或符号执行的局限性,这些方法在大规模固件分析中不可行。
  • 通过将领域特定知识融入深度学习流程,提升真实固件中漏洞检测的可扩展性和精度。
  • 在无需源代码或函数名称的情况下,实现对多样化物联网硬件架构中同源漏洞函数的高效且准确检测。

提出的方法

  • 引入一个预过滤模块,利用函数名称启发式方法和领域特定规则,在深度学习编码前剔除不相似的函数,大幅减少候选函数对的数量。
  • 应用基于 Tree-LSTM 的深度学习模型,将函数语义编码为密集嵌入,捕捉与指令集架构无关的功能共性。
  • 设计一个重排序模块,利用函数调用结构和控制流模式,对深度学习模型输出的相似性分数进行校准,提升真正例。
  • 将预过滤和重排序模块整合到统一流程中,同时提升 BCSD 过程的效率与精度。
  • 利用从提升的中间表示中提取的抽象语法树(AST),提取与架构无关的语义特征作为模型输入。
  • 使用图神经网络(GNNs)建模二进制函数中的控制和数据依赖关系,提升语义表征能力,超越简单的序列模型。

实验结果

研究问题

  • RQ1基于领域知识的预过滤是否能显著降低大规模固件分析中基于深度学习的二进制代码相似性检测的计算成本?
  • RQ2基于函数调用结构的后处理重排序模块在重新评分相似性分数方面,能在多大程度上提升漏洞检测的精度?
  • RQ3在真实固件中检测 N-day 漏洞时,Asteria-Pro 与最先进 BCSD 工具相比,在准确率、速度和可扩展性方面表现如何?
  • RQ4预过滤和重排序模块的集成是否可泛化应用于其他基于嵌入的 BCSD 方法,而不仅限于 Asteria-Pro?

主要发现

  • 预过滤模块通过在深度学习推理前剔除 96.9% 的非相似函数对,将相似性检测的总计算时间减少了 96.9%。
  • 重排序模块相较于仅使用基线深度学习模型,将平均倒数排名(MRR)提高了 23.71%,召回率提高了 36.4%。
  • 在大规模真实固件分析中,Asteria-Pro 以 91.65% 的高精度成功检测出 1,482 个存在漏洞的函数。
  • 该工具识别出 CVE-2017-13001 中的内联漏洞代码,证明其能够检测跨多种固件二进制文件的复杂且混淆的漏洞。
  • 将预过滤和重排序模块嵌入其他基线嵌入方法后,显著提升了其精度,表明该方法具有广泛的适用性。
  • Asteria-Pro 在速度和准确率方面均优于现有最先进的 BCSD 方法,尤其在跨架构漏洞检测方面表现突出。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。