ANDROID MALWARE DETECTION BASED ON MACHINE LEARNING ANALYSIS OF TRAFFIC FEATURES

Fei Wu, Xiangqian Wu, Yuan PeiInternational Journal of Applied Mathematics and Machine Learning 2017

Abstract

Traditional static analysis methods for Android malware detection often struggle against sophisticated techniques such as code obfuscation and dynamic code loading. This paper proposes a dynamic analysis framework that identifies malicious behavior by analyzing network traffic features. By utilizing the Information Gain algorithm for feature selection and an improved Naïve Bayes classifier—optimized with natural logarithms and Laplace calibration—the proposed method achieves a 93.6% detection accuracy. The results demonstrate that traffic-based analysis provides a robust alternative to privilege-based detection, offering high accuracy and reduced computational complexity.

Introduction

As the Android ecosystem continues to dominate the mobile market, it has become a primary target for malware developers. Traditional security measures rely heavily on static analysis, which involves scanning an application's source code for known malicious signatures. However, modern malware frequently employs code obfuscation and dynamic loading to hide its true intent, rendering static scanners ineffective.

To address these limitations, this research focuses on dynamic analysis, specifically the network traffic generated during an application's execution. Regardless of how well its code is hidden, most malware must eventually communicate with a remote server to exfiltrate data or receive commands from a Command and Control (C&C) infrastructure. By analyzing these communication patterns, it is possible to identify malicious intent through the "fingerprint" left in the network traffic.

Methodology

The researchers developed a multi-stage pipeline designed to transform raw network data into actionable intelligence.

1. Traffic Extraction

Applications were executed within a controlled Android simulator environment. During a 24-hour observation window, all incoming and outgoing packets were captured using tcpdump and stored as .pcap files. This longitudinal approach ensures that even malware with delayed triggers or infrequent communication patterns is captured.

2. Feature Selection via Information Gain

Raw network traffic contains a vast amount of data, much of which is redundant for classification purposes. The study employed the Information Gain (IG) algorithm to rank features based on their discriminative power. From an initial pool of traffic characteristics, the top 20 features were selected, including packet sizes, transmission intervals, and byte ratios. The study found that classification accuracy stabilizes after approximately 16 features, suggesting that a compact set of "network vitals" is sufficient for high-confidence detection.

3. The Improved Naïve Bayes Classifier

The core of the detection engine is a Naïve Bayes classifier enhanced with three specific optimizations:

  • Logarithmic Transformation: By applying natural logarithms, the model converts the multiplication of probabilities into addition. This prevents arithmetic underflow—a common issue where extremely small probabilities round to zero—and significantly reduces computational time.
  • Laplace Smoothing: This technique is used to handle the "zero-frequency problem," ensuring that the model does not return a zero probability when encountering a feature value not present in the training set.
  • Gaussian Distribution: To handle continuous variables (such as average bytes per second), the model assumes a normal distribution, allowing it to process numerical data more effectively than standard discrete models.

Experimental Setup and Datasets

The study utilized a balanced dataset of 702 samples to train and validate the model:

  • Malicious Samples (344): Sourced from the Android Malware Genome Project and VirusShare. The researchers focused on 13 prominent malware families, such as AnserverBot and DroidDream, which maintained active C&C servers during the study.
  • Benign Samples (358): Collected from various categories on Google Play to represent standard user behavior.

Validation was performed using a ten-fold cross-validation method to ensure the stability and generalizability of the results.

Key Insights and Results

The experimental results highlight the effectiveness of traffic-based features in distinguishing malware from legitimate applications:

  • The Significance of Byte Ratios: One of the most discriminative features identified was the Receive/Send byte ratio. While legitimate apps typically download more data than they upload (e.g., fetching updates or media), malware often exhibits a tighter ratio or higher upload frequency as it exfiltrates stolen data.
  • Periodic Communication: Malware families like Plankton often exhibit highly periodic "heartbeat" signals to check in with remote servers, a pattern that stands in stark contrast to the erratic, user-driven traffic of benign applications.
  • Performance Metrics: The improved Naïve Bayes model achieved an accuracy of 93.6% and an Area Under the Curve (AUC) of 0.961. These metrics indicate a high success rate in detection with a very low false-positive rate.

Conclusion

By shifting the focus from code signatures to network behavior, this research provides a powerful tool for detecting obfuscated Android malware. The improved Naïve Bayes classifier offers a computationally efficient solution that is well-suited for real-time monitoring. While the method requires an observation window to capture traffic, its ability to bypass code-level evasion techniques makes it a vital component of a modern, multi-layered mobile defense strategy. Future work will explore hybrid models that combine these traffic features with static analysis to provide even more comprehensive protection.

Summary updated

BibTeX
@article{wu2017android,
  author = {Fei Wu and Xiangqian Wu and Yuan Pei},
  title = {{ANDROID MALWARE DETECTION BASED ON MACHINE LEARNING ANALYSIS OF TRAFFIC FEATURES}},
  journal = {International Journal of Applied Mathematics and Machine Learning},
  year = {2017},
  doi = {10.18642/ijamml\_7100121838},
}
Figure