[Paper Review] MaMaDroid: Detecting Android Malware by Building Markov Chains of Behavioral Models (Extended Version)
MaMaDroid is a static analysis-based Android malware detection system that models app behavior using Markov chains over abstracted API call sequences—grouped by family, package, or class—to improve robustness against API evolution. It achieves up to 0.99 F-measure on unseen malware and maintains 0.86 F-measure after one year and 0.75 after two years, outperforming state-of-the-art methods like DroidAPIMiner.
As Android has become increasingly popular, so has malware targeting it, thus pushing the research community to propose different detection techniques. However, the constant evolution of the Android ecosystem, and of malware itself, makes it hard to design robust tools that can operate for long periods of time without the need for modifications or costly re-training. Aiming to address this issue, we set to detect malware from a behavioral point of view, modeled as the sequence of abstracted API calls. We introduce MaMaDroid, a static-analysis based system that abstracts the API calls performed by an app to their class, package, or family, and builds a model from their sequences obtained from the call graph of an app as Markov chains. This ensures that the model is more resilient to API changes and the features set is of manageable size. We evaluate MaMaDroid using a dataset of 8.5K benign and 35.5K malicious apps collected over a period of six years, showing that it effectively detects malware (with up to 0.99 F-measure) and keeps its detection capabilities for long periods of time (up to 0.87 F-measure two years after training). We also show that MaMaDroid remarkably outperforms DroidAPIMiner, a state-of-the-art detection system that relies on the frequency of (raw) API calls. Aiming to assess whether MaMaDroid's effectiveness mainly stems from the API abstraction or from the sequencing modeling, we also evaluate a variant of it that uses frequency (instead of sequences), of abstracted API calls. We find that it is not as accurate, failing to capture maliciousness when trained on malware samples that include API calls that are equally or more frequently used by benign apps.
Motivation & Objective
- Address the challenge of maintaining effective malware detection in the face of evolving Android APIs and malware behavior.
- Overcome limitations of permission-based and frequency-based detection methods that suffer from false positives and require frequent retraining.
- Develop a behavioral modeling approach resilient to API changes by abstracting low-level API calls into higher-level families, packages, or classes.
- Design a system that maintains high detection accuracy over long periods without retraining, even as the Android ecosystem evolves.
- Evaluate the relative contribution of API abstraction versus sequence modeling in improving malware detection robustness.
Proposed method
- Abstract low-level API calls into higher-level abstractions—families (e.g., android, java), packages (e.g., java.io), or classes (e.g., java.lang.Throwable)—to reduce sensitivity to API deprecations and changes.
- Construct call graphs from static analysis of Android apps to extract sequences of abstracted API calls.
- Model the sequences of abstracted API calls as first-order Markov chains to capture behavioral transition patterns.
- Extract statistical features from the Markov chain transition matrices to represent app behavior.
- Train a binary classifier (e.g., SVM or Random Forest) on these features to distinguish between benign and malicious apps.
- Evaluate the system using a large, long-term dataset of 8.5K benign and 35.5K malicious apps collected from 2010 to 2016.
Experimental results
Research questions
- RQ1Can modeling sequences of abstracted API calls via Markov chains improve long-term malware detection robustness compared to frequency-based methods?
- RQ2How does MaMaDroid perform in detecting previously unseen malware samples, especially when trained on older datasets?
- RQ3To what extent does API abstraction contribute to resilience against Android framework evolution compared to raw API frequency analysis?
- RQ4How does MaMaDroid’s performance degrade over time compared to systems like DroidAPIMiner that rely on frequently used API calls?
- RQ5Is the combination of abstraction and sequence modeling more effective than abstraction alone or frequency-based modeling?
Key findings
- MaMaDroid achieves a peak F-measure of 0.99 when detecting malware on datasets from the same training period.
- The system maintains strong detection performance over time, with an F-measure of 0.86 after one year and 0.75 after two years post-training.
- MaMaDroid significantly outperforms DroidAPIMiner, a state-of-the-art frequency-based system, both in accuracy and long-term robustness.
- A variant of MaMaDroid using only frequency of abstracted API calls (FAM) performs better than DroidAPIMiner but is less accurate than the full Markov chain model.
- The study confirms that sequence modeling via Markov chains is essential for high detection accuracy, especially when malicious and benign apps use similar API frequencies.
- API abstraction alone is insufficient for robust detection; it is the combination of abstraction and sequence modeling that enables resilience to API evolution and high detection performance.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.