You do (not) belong here: detecting DPI evasion attacks with context learning

Shitong Zhu, Shasha Li, Zhongjie Wang, Xun Chen, Zhiyun Qian, Srikanth V. Krishnamurthy, Kevin S. Chan, Ananthram Swami

TL;DR

This paper introduces CLAP, a novel, fully-automated, unsupervised machine learning system designed to detect and pinpoint Deep Packet Inspection (DPI) evasion attacks. By learning the "packet context" – the relationships between packet headers within a connection and across packets – from benign traffic, CLAP can identify subtle manipulations that trick DPI middleboxes.

What Problem Does This Paper Address?

Deep Packet Inspection (DPI) is a cornerstone of modern network security, used by middleboxes to inspect network traffic for malicious content. However, these DPI systems often have simplified protocol implementations compared to end-host systems. Attackers exploit these discrepancies by crafting specially manipulated packets that cause different behaviors in the DPI and the end-host. This allows malicious traffic to bypass detection. Manually creating rules to counter these increasingly sophisticated and automated evasion techniques is becoming infeasible. The challenge is to develop an automated, robust defense against these subtle, context-dependent attacks.

Methods

CLAP employs a multi-stage machine learning approach:

  • Inter-packet Context Learning: A Gated Recurrent Unit (GRU)-based Recurrent Neural Network (RNN) is trained on benign traffic to predict TCP state transitions. The learned "gate weights" from this RNN capture the relationships between consecutive packets in a connection.
  • Intra-packet Context Fusion: The inter-packet context (gate weights) is fused with intra-packet context (combinations of header field values within a single packet) to create a "context profile" for each packet. Amplification features are also added to highlight subtle context violations.
  • Joint Context Distribution Learning: An autoencoder is trained on these benign context profiles to learn their joint distribution. This autoencoder learns to reconstruct benign profiles with low error.
  • Verification: For unseen traffic, CLAP computes context profiles and their reconstruction errors. An "adversarial score" is calculated based on the trend of these errors (specifically, the mean error around the maximum error spike), which indicates the likelihood of an evasion attack. A threshold is then applied to classify connections as benign or adversarial.

Datasets

  • Training and Evaluation: The MAWI Traffic Archive, a large dataset of backbone network traffic captures, was used. Payloads were stripped for privacy, meaning the system focuses on header-based attacks.
  • Simulated Attacks: The authors implemented a simulator to inject 73 state-of-the-art DPI evasion attacks from prior research ([4, 10, 23]) into the MAWI dataset for testing.

Key Insights and Ideas

  • Context is King: The core idea is that DPI evasion attacks often violate the expected relationships between packet headers, both within a single packet and across a sequence of packets in a connection. Simply looking at individual packets or generic anomalies isn't enough.
  • Unsupervised Learning is Sufficient: CLAP demonstrates that it's possible to learn what "normal" looks like from benign traffic alone and effectively detect deviations, without needing pre-labeled attack data. This is crucial given the difficulty of obtaining comprehensive labeled attack datasets.
  • RNNs for Temporal Dependencies: Using RNNs (specifically GRUs) to model the sequential nature of network traffic and learn inter-packet relationships is a powerful approach for capturing stateful protocol behavior.
  • Autoencoders for Anomaly Detection: Autoencoders are well-suited for learning the distribution of complex data (like context profiles) and identifying outliers with high reconstruction errors.
  • Adversarial Score Design: The method of calculating an "adversarial score" by analyzing the trend of reconstruction errors (rather than just a single error value) is key to robustly identifying attacks that might cause temporary spikes.

Key Results

  • Detection Accuracy: CLAP achieved a high Area Under the Receiver Operating Characteristic Curve (AUC-ROC) of 0.963 and an Equal Error Rate (EER) of 0.061, significantly outperforming baseline methods.
  • Localization Accuracy: CLAP demonstrated strong localization capabilities, with a Top-5 accuracy of 94.6% and Top-3 accuracy of 91.0%, meaning it can pinpoint the approximate location of adversarial packets within a connection.
  • Performance: CLAP can process over 2,100 packets per second on a single CPU core, showing good efficiency for real-time deployment.
  • Effectiveness against Diverse Attacks: CLAP showed superior performance across various categories of evasion attacks, particularly those violating inter-packet context.

Limitations and Future Work

  • Feature Set: CLAP currently focuses on standard TCP/IP header fields. Future work aims to incorporate less common TCP/IP options and packet payloads, which are currently challenging due to their variable or unstructured nature.
  • Protocol Scope: The current work focuses on TCP/IP. The authors believe the framework can be extended to other stateful protocols like HTTP.
  • Performance Optimization: While efficient, CLAP's Python prototype can be further optimized through reimplementation in languages like C/C++ or by leveraging GPU acceleration.
  • Attacker Adaptation: The authors acknowledge the potential for attackers to develop adversarial examples specifically targeting ML models like CLAP. They believe their multi-stage pipeline makes this more challenging than for end-to-end models.
  • False Positives: While CLAP has low error rates, false alarms can still occur. The authors suggest tuning the adversarial score threshold and selectively inspecting high-scoring packets to manage this.

Summary updated

Abstract

As Deep Packet Inspection (DPI) middleboxes become increasingly popular, a spectrum of adversarial attacks have emerged with the goal of evading such middleboxes. Many of these attacks exploit discrepancies between the middlebox network protocol implementations, and the more rigorous/complete versions implemented at end hosts. These evasion attacks largely involve subtle manipulations of packets to cause different behaviours at DPI and end hosts, to cloak malicious network traffic that is otherwise detectable. With recent automated discovery, it has become prohibitively challenging to manually curate rules for detecting these manipulations. In this work, we propose CLAP, the first fully-automated, unsupervised ML solution to accurately detect and localize DPI evasion attacks. By learning what we call the packet context, which essentially captures inter-relationships across both (1) different packets in a connection; and (2) different header fields within each packet, from benign traffic traces only, CLAP can detect and pinpoint packets that violate the benign packet contexts (which are the ones that are specially crafted for evasion purposes). Our evaluations with 73 state-of-the-art DPI evasion attacks show that CLAP achieves an Area Under the Receiver Operating Characteristic Curve (AUCROC) of <u>0.963</u>, an Equal Error Rate (EER) of only <u>0.061</u> in detection, and an accuracy of <u>94.6%</u> in localization. These results suggest that CLAP can be a promising tool for thwarting DPI evasion attacks.
BibTeX
@inproceedings{zhu2020you,
  author = {Shitong Zhu and Shasha Li and Zhongjie Wang and Xun Chen and Zhiyun Qian and Srikanth V. Krishnamurthy and Kevin S. Chan and Ananthram Swami},
  title = {{You do (not) belong here: detecting DPI evasion attacks with context learning}},
  booktitle = {CoNEXT},
  year = {2020},
  doi = {10.1145/3386367.3431311},
}

Loading related content...

Figure