JITUnpacker: 運用 JITHook 技術之 .NET 動態脫殼器

JITUnpacker: Dynamic .NET Unpacker using JITHook Technique

檔案

日期

2023

類型

語言

英文

摘要

要分析經過加殼的惡意程式,首先需要進行脫殼才能進一步更詳細的分析。隨著.NET 惡意程式的數量增加,資安從業人員經常需要對被加殼的.NET 程式進行脫殼。對於.NET 程式而言,存在一種獨特的加殼手法。利用 JITHook 技術,即在運行.NET 程式的環境中的 JIT(Just-In-Time)編譯器的虛擬方法表中替換函數,以攔截 JIT 編譯流程,還原實際被編譯的中間語言及其他相關的函數資訊。最終將整份程式中的所有函數內容替換,從而達到防止程式被反編譯的效果。

本文提出針對此加殼手法的脫殼工具 JITUnpacker。使用 JITHook 技術,先將 JIT 編譯函數轉換為脫殼函數。當加殼程式執行時,每個函數就會先經過由加殼程式以 JITHook 技術安裝的還原函數。還原過後的函數資訊會再被送往脫殼函數。我們就能在此時蒐集已經被還原後的函數資訊並達到脫殼。目前開放原始碼的兩個相似專案是 JITM 和 JITUnpackerFramework。但 JITM 並沒有處理兩種較為細節的資料,即例外處理表和 localVarSigTok,導致其無法還原所有函數。而 JITUnpacker-Framework 使用上較為複雜,經我們實測是無法執行。這使得 JITUnpacker 成為目前這類型的工具中,唯一能夠成功進行脫殼的工具。實驗結果顯示 JITUnpacker 確實能夠解除真實世界樣本中以 JITHook 技術實現的反編譯保護。
Analyzing a packed malware typically starts with unpacking it for a more thorough analysis. As the number of .NET malware increases, cybersecurity experts often need to deobfuscate obfuscated .NET programs. In the case of .NET programs, a distinct obfuscation method exists that is exclusive to .NET programs. This technique leverages JITHook technology, which entails the substitution of functions within the virtual method table of the JIT (Just-In-Time) compiler in the runtime environment of .NET programs. It allows for intercepting the JIT compilation process, facilitating the reconstruction of the actual intermediate language and related function information. Ultimately, all the functions in the program are replaced, making it difficult to decompile the program.

We have developed JITUnpacker, a tool designed to counter JITHook obfuscation. It replaces the JIT compilation function with an unpacker hook. During the execution of the packed program, each function is processed by the target hook installed by the packed program via JITHook technology. The restored function information is passed to the unpacker hook, facilitating deobfuscation. While similar open-source projects like JITM and JITUnpacker-Framework exist, JITM does not handle exception handling tables and localVarSigTok in detail, limiting its ability to fully restore all functions. JITUnpacker-Framework is intricate and nonexecutable, making JITUnpacker the only successful tool for deobfuscation in its category. Experimental results demonstrate JITUnpacker's capability to bypass the decompilation protection achieved using JITHook technology in real-world samples.
顯示完整詮釋資料 統計資料

引用此條目

Chang, S.-M. (2023). JITUnpacker: Dynamic .NET Unpacker using JITHook Technique. https://thesis.lib.nycu.edu.tw/handle/20.500.14371/1197

BibTeX RIS

引用文字依 APA 第 7 版格式自動產生,使用前請再核對。

分享

永久網址:https://thesis.lib.nycu.edu.tw/handle/20.500.14371/1197