TL;DR
This paper introduces VirtSC, a novel technique that combines virtualization obfuscation (VO) with self-checksumming (SC) to protect software integrity. By integrating SC into a virtualized environment, VirtSC eliminates the need for architecture-specific binary patching, making SC more composable and resilient, while also improving its resistance to tampering.
What Problem Does This Paper Address?
Software developers face a constant battle against intellectual property theft and unauthorized modification of their applications. Man-at-the-end (MATE) attacks allow malicious users to tamper with software both statically (by altering the executable) and dynamically (by manipulating memory during execution). Self-checksumming (SC) is a technique that can detect such tampering by periodically hashing code segments and comparing them to expected values. However, traditional SC implementations require pre-computation of expected hashes and often involve architecture-dependent binary patching, limiting their composability with other protection mechanisms like obfuscation. Obfuscation, while effective at making code harder to understand, can break SC if not carefully integrated. This paper addresses the challenge of creating a robust, composable, and architecture-agnostic software protection scheme by synergistically combining virtualization obfuscation and self-checksumming.
Methods
The core of VirtSC lies in its innovative integration of Virtualization Obfuscation (VO) and Self-Checksumming (SC). The process begins by transforming a program's instructions into a custom, random Instruction Set Architecture (RISA). This RISA, along with an interpreter, replaces the original program. All program data and intermediate values are managed within a Virtual Memory (VM).
The novelty of VirtSC is in how SC is applied: instead of directly checksumming the original machine code, SC guards are injected into the virtualized program's Virtual Program Array (VPA). These guards compute hashes over the VPA itself, effectively protecting the obfuscated code. This approach has several key advantages:
- Architecture-Agnostic SC: Since SC operates on the VPA generated by the LLVM compiler framework, it doesn't require knowledge of the target architecture for hash computation or patching.
- Improved Composability: By applying SC after VO, the obfuscation process is less likely to break the integrity checks. The SC guards are designed to protect the VPA, which is the output of the VO process.
- No Binary Patching: The integration within LLVM eliminates the need for post-compilation binary modifications, a significant hurdle in traditional SC implementations.
The paper also discusses two modes for the VO interpreter: a "secure" mode that uses a switch statement for dispatching instructions (leading to potential path explosion for attackers but higher overhead) and an "optimized" mode that uses indirect threading for better performance.
Datasets
The authors evaluated their approach using a dataset comprising:
- A subset of 22 programs from the MiBench suite.
- Three open-source CLI games: tetris2, snake, and 2048. This resulted in a total of 25 programs for their experiments.
Key Insights and Ideas
- SC on the Obfuscated Code is Key: The most significant insight is that applying SC to the virtualized code (the VPA) rather than the original machine code is what enables seamless integration and removes architectural dependencies. This is a clever way to leverage the output of one protection mechanism as the input for another.
- VO as a Foundation for SC Resilience: Virtualization obfuscation inherently makes code harder to analyze. By layering SC on top of this, the SC guards become more resilient to attacks, as an attacker must first break the VO to even identify and target the SC mechanisms.
- Performance vs. Security Trade-off is Quantified: The paper meticulously measures the overhead of both the secure and optimized VO modes, both with and without SC. This provides concrete data for understanding the practical implications of their security enhancements.
- Function-Level Virtualization Simplifies Things: Using function-level virtualization simplifies the interpreter generation and avoids some of the complexities of module-level interpreters, like managing shared memory for return values.
Key Results
- Protection Coverage: The system achieved 100% instruction virtualization coverage for the tested programs. SC protection covered a median of 89% of the virtualized instructions.
- Performance Overhead (Secure Mode):
- VO alone incurred an average overhead of 89.34% (10% protection) to 1018.46% (100% protection).
- VO+SC in secure mode averaged 109.74% (10% protection) to 1055.51% (100% protection).
- Performance Overhead (Optimized Mode):
- VO alone averaged 48.27% (10% protection) to 458.42% (100% protection).
- VO+SC averaged 32.64% (10% protection) to 501.04% (100% protection).
- SC Overhead: The SC component itself contributed a relatively low overhead, especially in the optimized mode, where it sometimes even led to reduced overall overhead compared to VO alone for lower protection levels. For 100% protection in optimized mode, SC accounted for approximately 43% of the total overhead.
- Security Analysis: The paper presents an attack tree for SC and discusses various attacks against VO, concluding that VirtSC significantly raises the bar for attackers due to the combined defenses and the need to break VO first.
Limitations and Future Work
- Unsupported Instructions: The current implementation does not support certain Windows-specific instructions, and full Windows support is deferred to future work.
- VM Restrictions: The use of VM leads to potential memory leaks when exceptions occur, and certain LLVM instructions requiring constant operands cannot be fully virtualized.
- Cyclic Checks: The current SC implementation does not support cyclic checks, which could leave some SC guards unprotected. The authors suggest this could be addressed by not checking guards themselves, though this might reduce resilience.
- Future Work: The authors plan to implement cyclic checks for SC and further investigate optimizations for VO that do not compromise security. They also aim to improve the handling of VM memory management with exceptions.
Summary updated