Tatzer, C. (2020). Opcode coverage-guided virtualization deobfuscation based on symbolic execution [Diploma Thesis, Technische Universität Wien]. reposiTUm. http://hdl.handle.net/20.500.12708/79934
Obfuscation ist ein verbreitetes Konzept um die Analyse von Programmen zu erschweren. Es fußt auf dem Prinzip von semantisch äquivalenten Transformationen. Das Verstecken von sensiblen Teilen einer Applikation kann unter verschiedenen Umständen wünschenswert sein. Allerdings kann jede Programm-Transformation durch Deobfuscation rückgängig gemacht werden. Virtualisierungs-Obfuscation ist eine moder...
Obfuscation ist ein verbreitetes Konzept um die Analyse von Programmen zu erschweren. Es fußt auf dem Prinzip von semantisch äquivalenten Transformationen. Das Verstecken von sensiblen Teilen einer Applikation kann unter verschiedenen Umständen wünschenswert sein. Allerdings kann jede Programm-Transformation durch Deobfuscation rückgängig gemacht werden. Virtualisierungs-Obfuscation ist eine moderne Methode, welche den Prozess des Reverse Engineerings jedoch sehr deutlich verlangsamen kann. Ausgeklügelte Ansätze zur Deobfuscation von virtualisiertem Code existieren. Es werden verschiedene Techniken wie Symbolic Execution, Dynamic Taint Analysis und Binary Instrumentation verwendet um Devirtualisierung zu erreichen. Eine gemeinsame Voraussetzung von bestehenden Lösungen ist ein Instruction Trace. Jedoch ist davon auszugehen, dass ein Instruction Trace nicht den gesamten möglichen Code abdecken kann, sobald Conditional Branches im Kontrollfluss des Programms vorkommen. Daher basiert der vorgeschlagene Ansatz zur Deobfuscation von Virtualisierung ausschließlich auf Symbolic Execution und seiner Fähigkeit Programmpfade zu entdecken. Code-Coverage wird maximiert durch Priorisierung von noch nicht ausgeführten Bereichen von virtualisiertem Code. Eine Kategorisierungs-Strategie ist notwendig um die Bereiche der Obfuscation in Sektionen zu unterteilen, die erforscht werden sollen und solche, die umgangen werden sollen. Dieses Vorgehen ermöglicht die Entdeckung neuer Pfade. Wenn ausreichend Ressourcen zur Verfügung stehen, können alle möglichen Pfade in der Virtualisierung abgedeckt werden. Die Dispatch-Jumps werden iterativ konkretisiert, um alle virtuellen Opcodes zu finden und zuzuordnen und um Kontrollfluss aus dem virtualisierten Code zu extrahieren, also ohne Context-Switches von nativem Code und dem Holen von neuem Byte-Code abzubilden. Die Ergebnisse der Deobfuscation sind virtuelle Graphen, welche die genannten simplifizierten Repräsentationen von Kontrollfluss beinhalten. Sie erlauben die einfache Erkennung von Kontrollstrukturen wie Schleifen innerhalb des virtualisierten Codes und helfen einem Reverse Engineer bei der weiteren Analyse eines virtualisierten Programms. Die automatisierte Erkennung von solchen Strukturen benötigt eine hohe Code-Coverage. Eine umfangreiche Evaluierung zeigt, dass mit dem implementierten Ansatz eine ausreichend hohe Code-Coverage erreicht wird und ermutigt den Ansatz in verschiedenen Richtungen weiter zu verfolgen. Darüber hinaus konnten vielseitige Erkenntnisse über Virtualisierungs-Obfuscation und Symbolic Execution erlangt werden.
de
Obfuscation is a common concept centered around the idea of semantically equivalent transformations that increase the difficulty of analyzing a binary. It can be deemed necessary in different circumstances to hide sensitive parts of a program. However, deobfuscation by inverting the introduced program transformations is always only a matter of time. Nonetheless, virtualization obfuscators are a st...
Obfuscation is a common concept centered around the idea of semantically equivalent transformations that increase the difficulty of analyzing a binary. It can be deemed necessary in different circumstances to hide sensitive parts of a program. However, deobfuscation by inverting the introduced program transformations is always only a matter of time. Nonetheless, virtualization obfuscators are a state of the art technique and can significantly slow down the process of reverse engineering. Sophisticated deobfuscation approaches for virtualized code exist. Many different techniques such as symbolic execution, dynamic taint analysis and binary instrumentation are employed to assist devirtualization. One common requirement of existing solutions is instruction tracing. The completeness of code coverage from instruction traces is questionable as soon as conditional branches occur in the control flow of the program. Therefore, the proposed approach utilizes solely symbolic execution and its path exploration abilities for deobfuscation of virtualization. Code coverage is maximized by prioritizing not yet executed regions of the virtualized code. A categorization strategy is necessary to divide the obfuscated areas in sections to explore and sections to avoid. This enables the discovery of new paths by guiding symbolic exploration. Given enough computational resources, all possible paths in the virtualization obfuscation are covered. The dispatch jumps are concretized in an iterative way to find and map all virtual opcodes. Additionally, control flow that occurs within the virtualized code is extracted without intervening context switches from native code and fetching of byte-code. The results of the deobfuscation are virtual graphs that contain these simplified representations of control flow. They allow an easy recognition of high-level structures such as loops within the virtual code and aid a reverse engineer in conducting further analysis of a virtualized binary. The automated recognition of such patterns requires a high code coverage. An extensive evaluation shows that sufficiently high coverage is achieved by the implemented approach and encourages different directions of future work. Furthermore, many interesting insights about virtualization obfuscation and symbolic execution have been gathered.