[논문 리뷰] Trex: Learning Execution Semantics from Micro-Traces for Binary Similarity
Trex는 제약이 적은 마이크로 트레이스에서 실행 의미를 학습한 후 Masked LM과 계층적 Transformer로 사전학습하고, 아키텍처, 최적화, 난독화 간에 의미적으로 유사한 함수들을 맞추기 위해 파인튜닝하며 정확도와 속도를 향상시킨다.
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 framework, to automate learning execution semantics explicitly from functions' micro-traces and transfer the learned knowledge to match semantically similar functions. Our key insight is that these traces can be used to teach an ML model the execution semantics of different sequences of instructions. We thus train the model to learn execution semantics from the functions' micro-traces, without any manual labeling effort. We then develop a novel neural architecture to learn execution semantics from micro-traces, and we finetune the pretrained model to match semantically similar functions. We evaluate Trex on 1,472,066 function binaries from 13 popular software projects. These functions are from different architectures and compiled with various optimizations and obfuscations. Trex outperforms the state-of-the-art systems by 7.8%, 7.2%, and 14.3% in cross-architecture, optimization, and obfuscation function matching, respectively. Ablation studies show that the pretraining significantly boosts the function matching performance, underscoring the importance of learning execution semantics.
연구 동기 및 목표
- 보안 작업인 취약점 탐지, 악성코드 추적, 포렌식 등의 의미 기반 함수 유사성을 촉진한다.
- 마이크로 트레이스를 통해 실행 의미를 학습함으로써 이식성에 따른 아키텍처 간 및 최적화 간의 도전을 해결한다.
- 명령 단위 실행 효과를 포착하고 이를 함수 유사성 작업으로 옮겨 적용하는 사전학습 모델을 개발한다.
제안 방법
- 마스킹된 언어 모델링 목적을 사용한 제약이 적은 동적 실행에서 도출한 마이크로 트레이스를 계층적 Transformer로 사전학습한다.
- 마이크로 트레이스를 코드 토큰, 동적 값, 명령 위치, 피연산자 위치, 아키텍처를 포착하는 다섯 개의 입력 시퀀스와 8바이트 값을 인코딩하는 값-인코딩 bi-LSTM을 포함하여 표현한다.
- 모델이 마스킹된 코드 토큰과 8바이트 동적 값을 예측하도록 학습하여 근사적인 실행 의미를 학습한다.
- 사전학습된 모델 위에 작은 MLP를 쌓아 함수 임베딩을 출력하고 코사인 유사도 기반의 유사도 목표를 최적화하여 파인튜닝한다.
- 추론 동안 함수 임베딩을 계산하고 실행을 즉시 수행할 필요 없이 코사인 유사도로 의미적 유사성을 측정한다.
실험 결과
연구 질문
- RQ1제약이 적은 마이크로 트레이스가 이식성, 최적화 간, 난독화 간 함수 매칭으로 전이되는 근사 실행 의미를 학습하는 데 사용될 수 있는가?
- RQ2마이크로 트레이스와 함께한 사전학습이 정적 코드 기반 접근법보다 의미 기반 함수 유사성을 향상시키는가?
- RQ3계층적 Transformer가 아키텍처 간의 긴 실행 트레이스를 효율적으로 모델링하여 대규모 이진 유사성 검색을 가능하게 하는가?
주요 결과
| Metric | Cross-Architecture | Cross-Optimization | Cross-Obfuscation | Runtime Speed (×) |
|---|---|---|---|---|
| Improvement over SOTA | 7.8% | 7.2% | 14.3% | 8× faster |
- Trex는 크로스-아키텍처 함수 매칭에서 SOTA를 7.8%, 크로스-최적화 매칭에서 7.2%, 크로스-난독화 매칭에서 14.3%의 개선으로 능가한다.
- Trex는 함수 매칭에서 이전 신경망 아키텍처에 비해 최대 8배 빠르게 실행된다.
- 마이크로 트레이스 마스크 LM 태스크로의 사전학습이 어블레이션 연구에서 매칭 정확도를 15.7% 높인다.
- 평가에는 x86, x64, ARM, MIPS의 13개 프로젝트에서 1,472,066개의 함수가 포함되며 네 가지 최적화와 다섯 가지 난독화를 다룬다.
- 실세계 펌웨어 이미지 180건에 대한 사례 연구에서 Trex가 16건의 비공개 CVE를 발견했다.
더 나은 연구,지금 바로 시작하세요
연구 설계부터 논문 작성까지, 연구 시간을 획기적으로 줄여보세요.
카드 등록 없음 · 무료 플랜 제공
이 리뷰는 AI가 만들고, 인간 에디터가 검토했습니다.