Binary code similarity comparison is a methodology for identifying similar or identical code fragments in binary programs. It is indispensable in fields of software engineering and security, which has many important applications (e.g., plagiarism detection, bug detection). With the widespread of smart and IoT (Internet of Things) devices, an increasing number of programs are ported to multiple architectures (e.g. ARM, MIPS). It becomes necessary to detect similar binary code across architectures as well. The main challenge of this topic lies in the semantics-equivalent code transformation resulting from different compilation settings, code obfuscation, and varied instruction set architectures. Another challenge is the trade-off between comparison accuracy and coverage. Unfortunately, existing methods still heavily rely on semantics-less code features which are susceptible to the code transformation. Additionally, they perform the comparison merely either in a static or in a dynamic manner, which cannot achieve high accuracy and coverage simultaneously. In this paper, we propose a semantics-based hybrid method to compare binary function similarity. We execute the reference function with test cases, then emulate the execution of every target function with the runtime information migrated from the reference function. Semantic signatures are extracted during the execution as well as the emulation. Lastly, similarity scores are calculated from the signatures to measure the likeness of functions. We have implemented the method in a prototype system designated as BinMatch and evaluate it with nine real-word projects compiled with different compilation settings, on variant architectures, and with commonly-used obfuscation methods, totally performing over 100 million pairs of function comparison.
ReSIM: Re-ranking Binary Similarity Embeddings to Improve Function Search Performance
KASTEL Security Research Labs, Karlsruhe Institute of Technology(卡尔斯鲁厄理工学院 KASTEL 安全研究实验室);DIAG, Sapienza University of Rome(罗马第一大学 DIAG 系);European Molecular Biology Laboratory (EMBL) Rome(欧洲分子生物学实验室(EMBL)罗马分部)
A Large Scale Study of AI-based Binary Function Similarity Detection Techniques for Security Researchers and Practitioners
Institute of Information Engineering, Chinese Academy of Sciences(中国科学院信息工程研究所);School of Cyber Security, University of Chinese Academy of Sciences(中国科学院大学网络安全学院);University of New South Wales(新南威尔士大学);Imperial College London(帝国理工学院);Nanyang Technological University(南洋理工大学)
Understanding Binary Code Similarity for Real-World Vulnerability Detection: A Large-Scale Empirical Study
Institute of Information Engineering, CAS(中国科学院信息工程研究所);University of Chinese Academy of Sciences(中国科学院大学);Hangzhou Dianzi University(杭州电子科技大学);Shandong University(山东大学)
On the Lack of Robustness of Binary Function Similarity Systems
Sapienza University of Rome(罗马萨皮恩扎大学);The State Key Laboratory of Blockchain and Data Security(区块链与数据安全国家重点实验室);Zhejiang University(浙江大学);Hangzhou High-Tech Zone (Binjiang) Institute of Blockchain and Data Security(杭州高新技术区(滨江)区块链与数据安全研究院);University College London(伦敦大学学院)
Explainer-guided Targeted Adversarial Attacks against Binary Code Similarity Detection Models
The State Key Laboratory of Blockchain and Data Security, Zhejiang University(区块链与数据安全国家重点实验室,浙江大学);Institute of Blockchain and Data Security(区块链与数据安全研究院);University College London(伦敦大学学院);University of Southern California(南加州大学);Columbia University(哥伦比亚大学)
Trex: Learning Execution Semantics from Micro-Traces for Binary Similarity
Columbia University(哥伦比亚大学);University of California, Riverside(加州大学河滨分校)
Detecting semantically similar functions -- a crucial analysis capability with broad real-world security usages including vulnerability detection, malware lineage, and forensics -- requires understanding function behaviors and intentions. This task is challenging as semantically similar functions can be implemented differently, run on different architectures, and compiled with diverse compiler optimizations or obfuscations. Most existing approaches match functions based on syntactic features without understanding the functions' execution semantics. We present Trex, a transfer-learning-based fr…