A Framework for Evaluating Mobile App Repackaging Detection Algorithms

Heqing Huang, Sencun Zhu, Peng Liu, Dinghao WuTRUST 2013

TL;DR

This paper introduces a novel framework to rigorously evaluate how well mobile app repackaging detection algorithms can withstand code obfuscation. By systematically applying various obfuscation techniques, the authors demonstrate that existing detectors, while effective against simple repackaging, can be easily fooled by sophisticated obfuscation, highlighting a critical gap in current security measures.

What Problem Does This Paper Address?

The Android app market is flooded with applications, and a significant problem is "app repackaging." This involves malicious actors stealing legitimate app code, often to embed malware, adware, or spyware, and then republishing them as their own to earn profit or spread malicious payloads. While various detection algorithms exist to identify these repackaged apps, their effectiveness against increasingly sophisticated obfuscation techniques used by attackers remains largely unproven. Attackers can easily manipulate the Dalvik bytecode (the code that runs on Android devices) to alter the app's appearance without changing its core functionality, making it difficult for static analysis-based detectors to identify similarities. This paper addresses the critical need for a standardized and comprehensive way to evaluate how resilient these detection algorithms are to various obfuscation methods, particularly those that aim to evade detection by altering code structure and semantics.

Methods

The core contribution of this paper is a novel evaluation framework designed to systematically assess the obfuscation resilience of repackaging detection algorithms. The framework consists of three main components:

  1. Dalvik Bytecode Pre-processor: This component takes an original Android app's .dex file and converts it into an Intermediate Representation (IR), specifically Java bytecode. This IR format is crucial because it allows for easier manipulation and obfuscation. The tool used here is Dare, which aims to preserve semantic information during conversion.
  2. IR Code Obfuscator: This is the heart of the framework, designed to mimic real-world repackaging scenarios. It applies a suite of obfuscation algorithms to the IR code. The framework supports two types of analysis:
  3. Broadness Analysis: Each obfuscation algorithm is applied individually to assess the detector's general strength and weakness against a wide range of techniques.
  4. Depth Analysis: Multiple obfuscation techniques are serialized and applied sequentially to simulate more complex, multi-layered attacks. This tests the detector's robustness against deeper code manipulation. The paper leverages existing Java bytecode obfuscation tools like SandMarks and KlassMaster, adapting them to the IR format.

  5. IR2Dex Repackager: After obfuscation, the modified IR code is converted back into a .dex file using the dx tool from the Android SDK. This ensures compatibility with most repackaging detection tools that expect .dex files as input.

The framework is designed to be semantic-preserving, meaning the obfuscated code should retain the original program's functionality, even if its structure is altered.

Datasets

The paper does not explicitly mention a specific dataset for training detection algorithms. However, for evaluation, they used 20 Android applications downloaded from the official Android Market. These applications were then subjected to various obfuscation techniques as part of the framework's testing.

Key Insights and Ideas

  • Obfuscation is a Major Threat to Static Detectors: The research strongly suggests that while many detection algorithms are effective against simple code modifications, they are highly vulnerable to sophisticated obfuscation techniques, particularly those that manipulate control flow and data structures.
  • Broadness vs. Depth Matters: Evaluating detectors against individual obfuscations (broadness) is important, but testing them against combinations of obfuscations (depth) provides a more realistic picture of their resilience, as attackers are likely to use multiple techniques.
  • Control Flow vs. Data Obfuscation: The case study on AndroGuard revealed that it is more resilient to data transformation obfuscations than control flow obfuscations. This is because control flow manipulation directly alters the program's structure, which is a key feature used by AndroGuard for similarity comparison.
  • Combining Obfuscation Categories is Powerful: The research indicates that serializing obfuscations from different categories (e.g., control flow and data transformations) can be more effective in evading detection than using multiple obfuscations from a single category.
  • Framework Stability is Achieved: The paper demonstrates that their proposed framework is stable and capable of producing obfuscated .dex files that are accepted by detection tools, even after complex obfuscation processes.

Key Results

  • Framework Stability: The framework achieved a total success rate of 92.5% in producing obfuscated .dex files for 20 Android applications using 36 obfuscation algorithms.
  • AndroGuard Case Study (Broadness Analysis):
    • The "Non-obfuscated" entry showed a similarity score of 1.00, indicating the conversion process by Dare and dx tool preserves semantic information well.
  • Obfuscation algorithms significantly reduced the similarity score, with some like "Class Encrypter" dropping it to 0.03.
  • Control flow obfuscations ("C" tagged) generally had a greater impact on reducing the similarity score compared to data transformations ("D" tagged).
  • AndroGuard Case Study (Depth Analysis):
    • Serializing multiple obfuscations consistently reduced the average similarity score to a point lower than any single obfuscation.
  • A combination of control flow obfuscations ([Method Merger → Method Madness ⇒ Interleave Methods]) resulted in an average similarity score of 0.33.
  • A mixed approach ([Objectify → Method Merger ⇒ Method Madness]) yielded an even lower score of 0.26, suggesting that combining different types of obfuscations is highly effective.
  • The time taken for serialization varied, but the overall process was successful in producing obfuscated .dex files accepted by AndroGuard.

Limitations and Future Work

  • Limitations:
    • Some obfuscation algorithms related to array manipulation could not be performed completely due to missing type information during the Dalvik-to-Java bytecode conversion.
  • The framework does not guarantee that the repackaged applications will be completely runnable, which is a requirement for actual publication in app markets. However, it focuses on producing valid Dalvik bytecode with preserved semantics for static analysis.
  • The case study was performed on a single detector (AndroGuard), and the results might not be universally applicable to all detectors.
  • Future Work:
    • Refine the framework to produce completely runnable apps for dynamic analysis-based repackaging detection.
  • Extend the framework to include more obfuscation tools and techniques as they become available.
  • Apply the framework to evaluate a wider range of repackaging detection algorithms to understand their diverse vulnerabilities.
  • Investigate the impact of different obfuscation categories on other types of detectors, such as those based on control flow graphs or system call analysis.
  • Further explore combinations of obfuscations to discover more powerful evasion strategies.

Summary updated

BibTeX
@inproceedings{huang2013framework,
  author = {Heqing Huang and Sencun Zhu and Peng Liu and Dinghao Wu},
  title = {{A Framework for Evaluating Mobile App Repackaging Detection Algorithms}},
  booktitle = {TRUST},
  year = {2013},
  doi = {10.1007/978-3-642-38908-5\_13},
}
Figure