Abstract
Deep PackGen is a novel framework that leverages Deep Reinforcement Learning (DRL) to automatically generate adversarial network packets designed to evade AI-powered security systems. Unlike previous flow-based adversarial methods that are difficult to translate into functional traffic, Deep PackGen modifies raw packets while maintaining protocol "playability." By restricting the agent to valid networking actions and automatically recalculating checksums, the framework produces functional malicious traffic that achieves a 66.4% success rate in evading modern Network Intrusion Detection Systems (NIDS).
Introduction
As Cybersecurity Operations Centers (CSOCs) increasingly adopt Machine Learning (ML) for Network Intrusion Detection Systems (NIDS), attackers are developing sophisticated methods to bypass these defenses. However, existing research into adversarial attacks on NIDS faces two significant challenges: the Reverse-Engineering Gap and the Playability Problem.
Most current attacks perturb high-level "flow-based" features (e.g., inter-arrival times), which are mathematically sound but nearly impossible to reconstruct into valid, functional network packets. Furthermore, many packet-level attempts result in "unplayable" traffic—packets with corrupted headers or invalid checksums that real-world routers would immediately drop. Deep PackGen addresses these issues by creating a system that learns to modify raw packets within strict networking constraints.
The Deep PackGen Framework
The authors propose a comprehensive methodological framework designed to bridge the gap between theoretical evasion and practical exploitation. The pipeline spans from raw data ingestion to the generation and testing of adversarial samples.
The process begins with Data Set Creation, where raw PCAP files are processed into transformed and labeled datasets. This is followed by Packet Classification Model Development, where various ML models are trained to serve as both surrogates for the attacker and targets for testing. The core of the system is the Adversarial Sample Generation phase, which consists of a Training Phase to develop the DRL agent and a Testing Phase to evaluate its performance against independent models.
Deep Reinforcement Learning for Packet Perturbation
The heart of Deep PackGen is a DRL agent utilizing the Double Deep Q-Learning (DDQN) algorithm. The agent treats the modification of a malicious packet as a sequential decision-making process.
In this environment, the "state" is represented by the raw bytes of a malicious packet. The agent selects "actions" from a restricted space of valid perturbations to ensure playability:
- Modifying Time-to-Live (TTL) values.
- Adjusting TCP window sizes.
- Toggling fragmentation flags.
- Appending "dead bytes" (padding) to the payload.
Crucially, the system automatically updates IP and TCP checksums after any modification, ensuring the packet remains valid for network transmission. To enhance robustness, the agent is trained against a Surrogate Ensemble of diverse classifiers (e.g., Logistic Regression, Decision Trees, MLPs), forcing it to find perturbations that fool multiple types of AI simultaneously.
Experimental Setup and Datasets
The framework was evaluated using two modern benchmark datasets to reflect realistic network traffic patterns:
- CICIDS-2017: Used for primary training of the DRL agents and surrogate models, containing a mix of benign traffic and common attacks (DoS, DDoS, Port Scans, etc.).
- CICIDS-2018: Used to test the transferability of the learned evasion strategies across different network environments.
Instead of using pre-calculated statistical features, Deep PackGen operates on normalized decimal values of raw bytes from PCAP files, allowing the AI to analyze the packet in the same format as a deep-learning-based NIDS.
Results and Key Insights
Deep PackGen demonstrated significant efficacy in generating evasive traffic:
- High Success Rate: The framework achieved an average Adversarial Success Rate (ASR) of 66.4% across various models and attack types.
- Model Vulnerability: Tree-based models (Decision Trees and Random Forests) were particularly susceptible, with evasion rates often exceeding 95%.
- Proven Transferability: Agents trained on 2017 data maintained a 39.8% success rate when tested on 2018 data, indicating that the learned strategies are not merely overfitting to a single dataset.
- Evasion via Distribution Shifting: Analysis revealed that over 45% of successful adversarial samples were "Out-of-Distribution" (OOD). The DRL agent often pushes malicious packets into territory where the classifier has no prior experience, leading it to default to a "benign" classification.
Conclusion and Future Work
Deep PackGen proves that adversarial AI in cybersecurity is as much a protocol problem as it is a mathematical one. By incorporating domain knowledge like checksum recalculation into the DRL environment, the authors successfully generated functional, "playable" adversarial packets.
Future research will focus on expanding the framework to include more diverse attack types and additional protocols like UDP, ICMP, or HTTP. Furthermore, the adversarial samples generated by this framework can be used for adversarial training, helping to "vaccinate" NIDS against such cloaked attacks in the future.
Summary updated