[論文レビュー] Trex: Learning Execution Semantics from Micro-Traces for Binary Similarity
Trex は、 masked LM での事前学習と階層的 Transformer を用いた under-constrained なマイクロトレースから実行意味論を学習し、その後、アーキテクチャ、最適化、難読化を横断する意味的に類似する関数に一致させるためにファインチューニングし、精度と速度を改善する。
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.
研究の動機と目的
- 脆弱性検出、マルウェア追跡、法科学調査などのセキュリティ任務のための意味的関数類似性を動機づける。
- マイクロトレースから実行意味論を学習することで、クロスアーキテクチャおよびクロス最適化の課題に対処する。
- 命令レベルの実行効果を捉える事前学習済みモデルを開発し、それを関数類似性タスクへ転移させる。
提案手法
- masked language modeling objective を用いて、under-constrained dynamic execution から導出されたマイクロトレース上で階層的 Transformer を事前学習する。
- マイクロトレースを、コードトークン、動的値、命令位置、オペランド位置、アーキテクチャを捉える5つの入力系列で表現し、8バイト値には値をエンコードする bi-LSTM を含める。
- 欠損したコードトークンと8バイトの動的値を予測するようモデルを訓練し、おおよその実行意味論を学習する。
- 事前学習済みモデルの上に小さな MLP を積み重ねて関数埋め込みを生成し、コサイン類似度に基づく類似度目的関数を最適化してファインチューニングする。
- 推論時には関数埋め込みを計算し、実行をその場で行う必要なくコサイン類似度で意味的類似性を測定する。
実験結果
リサーチクエスチョン
- RQ1under-constrained なマイクロトレースを用いて、クロスアーキテクチャ・クロス最適化・クロス難読化の関数マッチングへ転移する近似的な実行意味論を学習できるか。
- RQ2マイクロトレースを用いた事前学習は、静的コードベースのアプローチを超える意味的関数類似性を向上させるか。
- RQ3階層的 Transformer は、アーキテクチャを跨ぐ長い実行トレースを効率的にモデル化し、スケーラブルなバイナリ類似検索を可能にするか。
主な発見
| 指標 | クロスアーキテクチャ | クロス最適化 | クロス難読化 | 実行速度(×) |
|---|---|---|---|---|
| Improvement over SOTA | 7.8% | 7.2% | 14.3% | 8× faster |
- Trex は、クロスアーキテクチャの関数マッチングで SOTA を 7.8%、クロス最適化で 7.2%、クロス難読化で 14.3% 上回る。
- Trex は関数マッチングの従来のニューラルアーキテクチャより最大 8× 高速に動作する。
- マイクロトレース masked LM タスクでの事前学習は、アブレーション実験でマッチング精度を 15.7% 向上させる。
- 評価は x86、x64、ARM、MIPS の 13 プロジェクトから 1,472,066 件の関数を対象に、4つの最適化と5つの難読化で行われた。
- 180 の実世界ファームウェア画像でのケーススタディにより、Trex が 16 件の未公開 CVE を発見した。
より良い研究を、今すぐ始めましょう
論文設計から論文執筆まで、研究時間を劇的に削減しましょう。
クレジットカード登録不要
このレビューはAIが作成し、人間の編集者が確認しました。