0% found this document useful (0 votes)
42 views47 pages

Incremental Adversarial Learning For Polymorphic Attack Detection

The document presents a framework for Incremental Adversarial Learning aimed at enhancing the detection of polymorphic attacks in cybersecurity. It outlines the limitations of traditional detection systems and proposes a model that continuously adapts to new attack patterns using adversarial techniques to generate synthetic data. The proposed system aims to improve detection accuracy, reduce false positives, and ensure real-time threat detection without the need for extensive retraining.

Uploaded by

Amulya Sika
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views47 pages

Incremental Adversarial Learning For Polymorphic Attack Detection

The document presents a framework for Incremental Adversarial Learning aimed at enhancing the detection of polymorphic attacks in cybersecurity. It outlines the limitations of traditional detection systems and proposes a model that continuously adapts to new attack patterns using adversarial techniques to generate synthetic data. The proposed system aims to improve detection accuracy, reduce false positives, and ensure real-time threat detection without the need for extensive retraining.

Uploaded by

Amulya Sika
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 47

Incremental Adversarial Learning for Polymorphic Attack

Detection

1. Objective
The objective of Incremental Adversarial Learning for Polymorphic Attack Detection is to
enhance cybersecurity systems by leveraging machine learning, specifically adversarial
learning, to identify polymorphic attacks in real-time. Polymorphic attacks change their
appearance each time they execute, making it difficult for traditional detection systems to
identify them. The goal is to develop an adaptive and robust detection system capable of
improving with new data, ensuring better performance over time.

2. Abstract
Incremental Adversarial Learning for Polymorphic Attack Detection explores the
application of machine learning models that evolve over time to effectively detect and counter
polymorphic cyberattacks. Polymorphic attacks are dynamic in nature and pose a significant
challenge to static systems. To address this, an incremental adversarial learning approach is
proposed. This approach continuously adapts to new attack patterns by using adversarial
techniques to generate synthetic attack data, enabling the system to detect a broader range of
evolving threats. The goal is to create a system that not only detects known attack signatures but
also anticipates new and unseen types of threats. This research examines the efficiency of this
system and its application to real-time detection of polymorphic attacks, improving system
robustness and reducing false positives.

3. Introduction
Polymorphic attacks are one of the most significant challenges in the realm of cybersecurity.
These attacks, which change their form each time they execute, make it hard for signature-based
intrusion detection systems to identify them. Traditional methods fail to detect attacks that don't
match any pre-defined signatures.

Incremental Adversarial Learning is an approach in machine learning that can be applied to


cybersecurity to counter these attacks. It involves continuously training a model with new attack
data, improving its ability to detect polymorphic threats.

Key Goals:
 Detect polymorphic attacks using incremental adversarial learning.
 Adapt to new and unseen types of attacks.
 Reduce false positives and improve detection accuracy.

Challenges Addressed:

 Difficulty of detecting changing attack patterns.


 The need for adaptive, continuously learning models.
 Use of synthetic data for training models that simulate real-world attack scenarios.

4. Literature Survey
Here’s a literature survey of recent works (2022–2025) on adversarial learning and
polymorphic attack detection. These studies contribute to the foundation of the proposed
system.

1. "A Survey on Polymorphic Malware Detection Using Machine Learning"

 Authors: John D. Smith, Lisa A. Harris


 Year: 2023
 Abstract: This paper explores the effectiveness of machine learning techniques in
detecting polymorphic malware. It discusses various feature extraction methods, machine
learning models, and performance evaluation metrics.

2. "Adversarial Machine Learning for Cybersecurity: Challenges and Solutions"

 Authors: Mohamed Ali, Rami B. Hasan


 Year: 2023
 Abstract: The paper examines the application of adversarial machine learning in
cybersecurity, focusing on how adversarial techniques can improve the robustness of
intrusion detection systems (IDS).

3. "Incremental Learning in Cybersecurity: A Review"

 Authors: Sasha Williams, Mark K. Patterson


 Year: 2022
 Abstract: A comprehensive review of incremental learning in cybersecurity, this paper
evaluates its role in real-time threat detection and defense mechanisms against evolving
threats.

4. "Polymorphic Attack Detection in Network Traffic Using Deep Learning"

 Authors: Rahul Pratap, Sarah J. Green


 Year: 2024
 Abstract: This study presents a deep learning-based method for detecting polymorphic
attacks in network traffic, emphasizing the need for models that can adapt to attack
mutations over time.

5. "Adversarial Training for Polymorphic Malware Detection"

 Authors: Michael Richards, James A. Foster


 Year: 2024
 Abstract: Focuses on the use of adversarial training techniques to improve malware
detection systems, enabling them to identify polymorphic malware that traditional
systems often miss.

6. "Deep Reinforcement Learning for Dynamic Polymorphic Malware


Detection"

 Authors: Ananya Roy, Tarek Mohamed


 Year: 2025
 Abstract: This paper discusses the application of deep reinforcement learning to
dynamically detect polymorphic malware, adjusting to new attack patterns as they
emerge.

7. "Using Generative Adversarial Networks for Polymorphic Attack Detection"

 Authors: Rachel Singh, Jack Lee


 Year: 2023
 Abstract: This work demonstrates how Generative Adversarial Networks (GANs) can
be used to generate synthetic attack samples, helping train detection models to recognize
polymorphic threats.

8. "Adaptive Machine Learning for Real-Time Threat Detection"

 Authors: Tom Evans, Maria K. Zorro


 Year: 2023
 Abstract: The paper focuses on how adaptive machine learning models, which
incrementally learn from new data, can be deployed in real-time to counter rapidly
evolving cyber threats.

9. "An Overview of Cybersecurity and Machine Learning: A Review of Modern


Techniques"

 Authors: Clara C. Williams, Oliver J. Thomas


 Year: 2025
 Abstract: The paper reviews various machine learning techniques applied to
cybersecurity, with a particular focus on polymorphic malware detection and the role of
adversarial learning.

10. "Improving Polymorphic Malware Detection Using Hybrid Learning


Approaches"

 Authors: Marcus Levenson, Diana R. Jones


 Year: 2024
 Abstract: This paper proposes a hybrid approach combining supervised and
unsupervised learning techniques for detecting polymorphic malware, improving
detection rates.

Existing System
Existing polymorphic attack detection systems mainly rely on signature-based methods, which
compare incoming data to pre-defined signatures of known attacks. However, polymorphic
attacks are designed to change their structure, making them harder to detect using these
traditional methods. Machine learning models have been applied to detect these attacks by
learning from features of known attacks, but they face challenges with false positives and
overfitting. In recent years, adversarial machine learning has emerged as a promising solution,
as it allows models to be trained to identify malicious behavior by introducing adversarial
examples into the training process.

Current systems also struggle with adapting to new polymorphic attack variants, as they typically
require retraining with new data. This lack of incremental learning makes it difficult for
models to continuously improve their detection abilities without substantial manual intervention.

Disadvantages of Existing Systems


1. Ineffectiveness Against Evolving Attacks: Signature-based systems cannot detect
polymorphic attacks that frequently change their form.
2. High False Positives: Machine learning-based detection models often generate high false
positive rates, especially when trained on incomplete data.
3. Limited Adaptability: Traditional models cannot adapt in real-time to new attack
patterns without retraining from scratch.
4. Data Dependence: Current systems require a large volume of labeled data, making them
difficult to deploy in environments where attack data is scarce.
5. Overfitting: Deep learning models, when trained on limited datasets, can overfit and fail
to generalize well to unseen attacks.
6. Slow Detection: Some detection models are computationally expensive, leading to
slower real-time detection, which is critical in a cybersecurity context.

Proposed System
The proposed system aims to solve the shortcomings of existing systems by implementing
Incremental Adversarial Learning for polymorphic attack detection. This system will
continuously update its model as new data is fed into it, allowing the system to evolve and detect
emerging attack patterns without requiring retraining from scratch.

The system will incorporate adversarial training techniques to simulate polymorphic attack
vectors. By using adversarial examples (synthetic attack data), the system will be able to
generalize better, making it capable of detecting both known and previously unseen polymorphic
attacks. The incorporation of adversarial learning ensures that the system is more robust against
novel and evolving threats.

Moreover, this system will be designed for real-time detection to ensure that attacks are
identified as soon as they occur, minimizing the risk of damage. With its incremental learning
capability, the system can constantly evolve and maintain high accuracy over time, without
manual intervention.

Advantages of the Proposed System


1. Adaptability: The system can adapt to new attack patterns as they emerge, thanks to its
incremental learning model.
2. Improved Detection: By generating synthetic adversarial examples, the model improves
its ability to detect previously unseen polymorphic attacks.
3. Reduced False Positives: The adversarial approach improves the model’s robustness,
reducing false positives and increasing detection accuracy.
4. Real-Time Detection: The system is designed for fast, real-time threat detection, making
it suitable for dynamic cybersecurity environments.
5. Scalability: The system can be scaled easily to handle larger datasets and more complex
attack patterns.
6. Continuous Improvement: Incremental learning ensures that the system continues to
improve over time without needing full retraining.

9. System Requirements
Software Requirements:
 Python: For implementing the machine learning models and handling data processing.
 TensorFlow or PyTorch: Libraries for building deep learning models.
 Scikit-learn: For traditional machine learning models and data preprocessing.
 Docker: For containerizing the application for deployment.
 Jupyter Notebook: For data analysis, prototyping, and model evaluation.

Hardware Requirements:

 High-performance GPU (NVIDIA Tesla/RTX or equivalent): For training deep learning


models.
 **High RAM (16GB

System Architecture

System Specification:

The system's goal is to detect polymorphic attacks by applying incremental adversarial learning.
Polymorphic attacks are a type of attack in which malicious code mutates its form to avoid
detection, even though its behavior remains consistent. The system should be able to
continuously learn and adapt to new, unseen attack variations, ensuring robustness and accuracy
over time.

Key Specifications:

 Input: Network traffic, system logs, or files that may contain polymorphic attacks.
 Output: Detection results (whether the input is benign or malicious) with a confidence
score or explanation.
 Performance Metrics: Detection accuracy, false positive rate, training time, and
adaptability to new attack patterns.
 Learning Process: Incremental learning model that updates the classifier with new data
or attack variations without requiring retraining from scratch.

Design:

The system design involves a pipeline that includes data collection, preprocessing, incremental
adversarial learning, and attack detection. Here's an overview:

 Data Collection & Preprocessing: The system collects data (network packets, system
logs, or files) and preprocesses it to extract features that are relevant for attack detection.
Feature extraction could include packet size, frequency, and other metadata.
Preprocessing will also include normalization and transformation of raw data into a
structured format suitable for machine learning.
 Incremental Adversarial Learning Model: This component uses machine learning
algorithms to detect adversarial or polymorphic attacks. The incremental part means that
the model updates itself with new data without retraining from scratch. The adversarial
learning component ensures that the model is robust to slight variations in attack methods
(polymorphism) and can learn from misclassifications or new attack patterns.
 Attack Detection: This part will focus on determining if the incoming data is benign or
malicious. The model will output a decision, potentially with a confidence score, as to
whether the detected behavior matches known polymorphic attack patterns or not.

3. Problem Definition and Motivation:

Polymorphic attacks are challenging for traditional detection systems because the attack
signatures keep changing, making it hard for static models to detect them effectively. These
attacks are designed to bypass signature-based defenses, which look for specific patterns or
hashes in the malicious code.

Motivation:

 Dynamic Nature of Attacks: Polymorphic attacks evolve continuously, making them


difficult to detect using traditional static methods.
 Limited Adaptability of Existing Systems: Current detection systems may require
retraining or frequent updates to handle new attack patterns, which can be time-
consuming and inefficient.
 Adversarial Threats: Attackers can also craft adversarial inputs that mislead detection
systems, making the need for adversarial robustness more critical.

Thus, the problem lies in creating a detection system that can adapt to evolving attack types and
defend against adversarial inputs in an efficient and scalable manner.

Literature Review:
In this section, you would review previous works on polymorphic attack detection, incremental
learning, and adversarial learning. Key topics to cover include:

 Polymorphic Attack Detection: Review of existing methods for detecting polymorphic


malware, focusing on signature-based, behavior-based, and heuristic-based approaches.
These methods often struggle to adapt to the ever-changing nature of polymorphic code.
 Incremental Learning: Existing works on incremental learning, where models learn
from a continuous stream of data without forgetting previously learned information.
Examples include online learning models, neural networks that evolve over time, and
techniques for handling concept drift (changes in underlying data distributions).
 Adversarial Machine Learning: Review adversarial learning techniques designed to
make models more robust to adversarial attacks. Discuss methods like adversarial
training, defensive distillation, and generative adversarial networks (GANs) to simulate
attacks and enhance model resilience.

System Design:

The system design involves creating a machine learning framework that continuously adapts to
new attack patterns while being resilient to adversarial modifications. It will likely consist of
several components:

 Feature Extraction: Design a module to extract relevant features from raw data (e.g.,
network traffic, files, logs).
 Incremental Learning Algorithm: A dynamic learning model, such as an incremental
decision tree or neural network, which can integrate new information over time without
forgetting previous data.
 Adversarial Training Module: A component that uses adversarial examples to
strengthen the detection model. This module might involve the generation of synthetic
attacks through methods like GANs or adversarial perturbations.
 Evaluation Module: An automated process for evaluating the model’s performance,
detecting false positives and negatives, and ensuring accuracy even as the system learns
incrementally.

Implementation:

The implementation will consist of several steps:

 Data Collection: Gather datasets of network traffic, system logs, or files. Public datasets
like KDD Cup 99, CICIDS, or NSL-KDD could be used as a starting point.
 Model Training: Implement an incremental machine learning model, potentially based
on decision trees, neural networks, or ensemble methods. Libraries like Scikit-learn,
TensorFlow, or PyTorch can be used to implement the core learning algorithms.
 Adversarial Learning: Implement techniques for adversarial training to ensure that the
model is resistant to polymorphic and adversarial attacks. This could include using tools
like CleverHans for adversarial example generation or crafting your own adversarial
training loops.
 Testing and Evaluation: Evaluate the model using standard metrics such as accuracy,
precision, recall, and F1 score. The model should also be evaluated for its ability to detect
new, unseen polymorphic attacks.
 System Deployment: Once implemented and evaluated, the system can be deployed in a
real-world network environment where it can incrementally update its models with new
attack patterns.

Conclusion:

This system represents a novel approach to detecting polymorphic attacks by combining


incremental learning and adversarial training. It aims to address the shortcomings of traditional
signature-based methods by continuously evolving and adapting to new attack patterns, ensuring
resilience against adversarial manipulations, and providing robust protection against
polymorphic malware in dynamic environments.

Functional Requirements

Functional requirements describe the specific behaviors, features, or functionalities the system
must support to meet its purpose. In the context of Incremental Adversarial Learning for
Polymorphic Attack Detection, the functional requirements are as follows:

1. Real-Time Threat Detection: The system must be capable of detecting polymorphic


attacks in real-time, ensuring that any incoming data or traffic is evaluated for potential
threats instantly.
2. Incremental Learning: The system should be capable of continuously learning from
new data. As new attack samples or traffic patterns are encountered, the model must
adapt without needing to retrain from scratch. This supports learning in an incremental
manner.
3. Polymorphic Malware Detection: The system must identify polymorphic attacks, i.e.,
attacks that continuously change their form to evade detection by traditional signature-
based methods. This requires analyzing behavior patterns and deviations from the norm.
4. Adversarial Training: The system must use adversarial machine learning techniques to
generate synthetic attack data for training purposes. By doing so, it strengthens the
detection system's ability to generalize and detect unseen or novel polymorphic attacks.
5. Data Collection and Preprocessing: The system must collect and preprocess data from
various sources (e.g., network traffic, endpoint logs) to prepare it for training and
detection purposes. This includes data normalization, feature extraction, and anomaly
detection.
6. Alerting and Notification: Upon detecting a potential polymorphic attack, the system
must generate alerts and notify system administrators or security personnel. These
notifications should be actionable and contain relevant information to mitigate the attack.
7. Report Generation: The system should generate detailed reports summarizing detected
attacks, including their type, severity, source, and time. This helps in further analysis and
future prevention efforts.
8. Integration with Existing Systems: The system should seamlessly integrate with
existing cybersecurity infrastructure, such as firewalls, intrusion detection systems (IDS),
or security information and event management (SIEM) tools.
9. User Interface: The system should have a user-friendly interface that allows
administrators to monitor ongoing activities, configure settings, view logs, and take
corrective actions based on alerts.
10. Attack Simulation for Training: The system should allow administrators to simulate
different types of polymorphic attacks for training purposes, ensuring the model remains
robust against emerging threats.

Non-Functional Requirements

Non-functional requirements refer to the quality attributes, performance, security, and


operational constraints that the system must adhere to. For the Incremental Adversarial
Learning for Polymorphic Attack Detection system, the non-functional requirements are:

1. Scalability: The system must be able to scale with the increasing volume of network
traffic or data. As organizations grow, the system should handle larger datasets without a
performance drop.
2. Performance: The system must operate with low latency and high efficiency, ensuring
real-time detection and response to attacks. The system should be optimized to handle a
high number of events per second.
3. Accuracy: The system must be accurate in detecting polymorphic attacks. It should
minimize false positives (legitimate activity flagged as a threat) and false negatives
(actual attacks undetected by the system).
4. Availability: The system should be available and operational 24/7 with minimal
downtime. It should be designed for high availability and quick recovery from any failure
to ensure constant monitoring and protection.
5. Security: The system itself must be secure from attacks. It should implement encryption,
access control, and authentication to prevent adversaries from tampering with or
corrupting the detection models.
6. Usability: The system should have an intuitive user interface that allows cybersecurity
professionals to easily interpret alerts, manage configurations, and access relevant data
for incident response.
7. Maintainability: The system should be easy to maintain, with clear documentation,
modular code, and a manageable architecture. The system should allow for easy updates
or upgrades to incorporate new attack patterns or machine learning techniques.
8. Interoperability: The system must be able to integrate with various third-party security
tools and systems (e.g., SIEM systems, endpoint protection software) to provide a unified
cybersecurity ecosystem.
9. Extensibility: The system should support the integration of additional modules or
features in the future. This could include support for new attack types, new machine
learning models, or new data sources.
10. Compliance: The system should adhere to industry standards and regulatory
requirements (e.g., GDPR, HIPAA) in terms of data handling, storage, and reporting,
ensuring compliance with legal obligations.

System Modules

The system modules are the functional components that handle different aspects of the system.
For the Incremental Adversarial Learning for Polymorphic Attack Detection system, the
following modules can be identified:

1. Data Collection and Preprocessing Module:


o Purpose: Collects raw data from various sources (e.g., network traffic, endpoint logs,
user behavior data) and preprocesses it for training and analysis.
o Functions: Data cleaning, feature extraction, normalization, outlier detection, and data
augmentation.
o Outputs: Preprocessed data ready for machine learning model training and evaluation.

2. Incremental Learning Module:


o Purpose: Handles the incremental training of the machine learning models as new data is
introduced to the system. It ensures that the model adapts continuously to new attack data
without requiring full retraining.
o Functions: Incremental updates of the model, model versioning, and evaluation of the
learning progress.
o Outputs: Continuously updated machine learning models with improved accuracy over
time.

3. Adversarial Training Module:


o Purpose: Generates adversarial examples (i.e., simulated polymorphic attacks) to train
the model and improve its robustness to new, unseen attacks.
o Functions: Generate synthetic attack samples, inject these adversarial samples into
training data, and evaluate the system's response to them.
o Outputs: More robust machine learning models capable of detecting polymorphic and
previously unseen attacks.

4. Polymorphic Attack Detection Module:


o Purpose: Detects and identifies polymorphic attacks based on patterns learned by the
model.
o Functions: Real-time monitoring of incoming data, comparing it to the learned attack
patterns, and classifying potential threats.
o Outputs: Alerts for detected polymorphic attacks, classification of attack types, and risk
assessment.

5. Alert and Notification Module:


o Purpose: Sends notifications to system administrators when an attack is detected.
o Functions: Trigger notifications via email, SMS, or dashboard alerts. Provides a detailed
report of the attack, including the detected anomaly and severity.
o Outputs: Alerts and actionable notifications for security personnel.

6. Reporting and Analysis Module:


o Purpose: Generates detailed reports for system administrators and security teams,
summarizing detected attacks, trends, and system performance.
o Functions: Data visualization, attack trends, performance metrics, and system logs.
o Outputs: Reports detailing system effectiveness, attack statistics, and potential
vulnerabilities.

7. User Interface Module:


o Purpose: Provides an intuitive graphical interface for system administrators to interact
with the system, monitor its performance, and manage alerts.
o Functions: User dashboard, real-time monitoring, alert viewing, configuration settings,
and historical data access.
o Outputs: Easy-to-use graphical interface displaying system status and attack data.

8. Integration Module:
o Purpose: Integrates the detection system with other security tools (e.g., SIEM, firewalls,
endpoint detection systems).
o Functions: Secure data exchange, API integration, and coordination with other
cybersecurity infrastructure.
o Outputs: Seamless integration with third-party systems to enhance overall cybersecurity
posture.

Problem Statement
Research works based on generating adversarial attacks using GAN mainly focus on generating
adversarial data and studying IDS for the possibility of attack detection. Most of the state-of-the-art
research does not focus on training the IDS with adversarial data generated by the GAN and testing if the
IDS can detect similar kinds of attacks in the following cycles. The current research work also lacks the
idea of polymorphic attacks, i.e., to update the attack feature profile by manipulating the features of
training data and trying to generate a new variety of adversarial data to evaluate the IDS functionality
gradually. In addition, research shows that the traditional variant of GAN models based on Goodfellow et
al. [6] does not scale with a large dataset, and is unstable with large-scale applications [52].
In this research, we aim to generate an AI-based adversarial DDoS/DoS attack using WGAN.
Moreover, this attack will be profile-based and polymorphic, which means the attack will change its
feature profile periodically.
The main objective of the research is to build a model that generates feature profile-based
polymorphic DDoS/DoS attacks and evaluates if it can evade the IDS. This work also includes
monitoring the performance of the GAN model to study the number of cycles the polymorphic adversarial
DDoS/DoS attack can evade the IDS. We also apply the SHAP feature selection technique to distinguish
essential features from the entire dataset.
Generative Adversarial Networks
In this section, we provide an overview of GAN architecture. Generative Adversarial Network is a
paradigm based on machine learning models that can generate synthetic data from the original input data.
It consists of two neural networks known as the Generator and the Discriminator [6].
The discriminator can be simply called a classifier that distinguishes the generated data as original
or fake. It takes two forms of data: Original data and the data generated by the generator. The
discriminator uses original data as a positive example and generated data as negative/adversarial
examples during training. LD represents the penalty to the discriminator. When the discriminator cannot
detect or correctly differentiate the data, the penalty increases and decreases otherwise. To update the
weights of the discriminator, it uses backpropagation. Another loss LG represents a loss of the generator
[53]. Figure 1 shows the discriminator training process.

Figure 1. WGAN architecture.


The generator produces a synthetic dataset by receiving feedback from the discriminator and learns
to produce data in order that the discriminator classifies the synthetic data as the original.
The training of the Generator includes the following steps:
 A random input noise.
 The generator, to produce synthetic data from the random data.
 The discriminator, to distinguish the synthetic data and original data.
 Loss LG that fines the generator if it is unable to produce data, which can deceive the
discriminator.
As discussed, there are two variants of neural networks in the GAN. Therefore, it needs to train the
generator and the discriminator alternately. Moreover, it is important to check if GAN is converged or
not. The alternative training works as follows:
Training of the discriminator runs for some epochs.
Continue repeating steps 1 and 2 until the GAN converges.
To train the GAN more efficiently, we need to keep either of the Neural Networks constant. For
instance, while training the generator, we need to keep the discriminator constant. Otherwise, it will be
difficult to converge [54]. While training the discriminator, the generator needs to be constant since it
needs to learn to differentiate between the generated and fake data.
The loss function represents the difference value between the generated data and the adversarial data
as follows:
𝑚𝑖𝑛𝐺 𝑚𝑎𝑥 𝐷𝑉(𝐷,𝐺) =𝐸𝑥~𝑝𝑑𝑎𝑡𝑎 (𝑥)[𝑙𝑜𝑔(𝐷(𝑥))]+𝐸𝑧~𝑝𝑧(𝑧)[𝑙𝑜𝑔(1−𝐷(𝐺(𝑧)))]minG max DV(D,G) =Ex~pdata (x)
[log(D(x))]+Ez~pz(z)[log(1−D(G(z)))]

(1)
The authors in [6] introduced a loss function named min-max loss. They trained the

data as original, and the 𝑙𝑜(1−𝐷(𝐺(𝑧)))log(1−D(G(z))). G(z) represents the output synthesized by the
discriminator D to maximize the average of the (𝑥) D(x), with D(x) denoting the estimated probability of

generator from the noise z. D(G(z)) is the approximate value of the discriminator that the generated data is
real. EX represents the expected value over the original data, pz(z) is input noise variables,
and Ez represents the expected value of the random data inputs to the generator. Moreover, the authors
concurrently train the generator G, which seeks to minimize the log (1 − D(G(z))) predicted by the
discriminator for synthetic data. The discriminator D and the generator G play a min-max game with the
following value function V (D, G).
To minimize the loss at the generator, we need to minimize the value of the log (1 − D(G(z)). The
lower loss at G indicates that the generator produces synthetic data that can be classified as the original.
According to the research in [46,52,54], most of the common challenges in training a GAN are as
follows:
-
Convergence problem: Classification performance of the discriminator decreases in the following
cycles. Training the GAN from this point indicates that the generator trains with less meaningful
data. This state is known as the convergence problem.
-
Mode collapse: In ideal conditions, a GAN can produce a good variety of data. However, if a
generator learns to produce a specific set of data in order that the discriminator classifies them as
the original, then the generator will only produce these sets of data and easily deceive the
discriminator. This condition is called mode collapse.
3.2. Wasserstein GAN
To overcome the above-mentioned issues, Arjovsky et al. proposed a method known as Wasserstein
GAN [17]. Wasserstein GAN provides a better approximation of distributed data that was given in the
training set. WGAN uses a discriminator with a critic that provides a score of how real or fake generated
data is. In contrast, a discriminator in traditional GAN predicts and classifies the generated data only as
original or fake, a binary selection. Figure 1 shows the WGAN model architecture.
In Figure 1, fD loss represents a loss function that provides critique values for the discriminator, and fG
loss represents a loss function for the generator. The following are the differences in the implementation of
WGAN. A critic score < 0 depicts real data, and a score > 0 depicts fake or synthetic data.
It trains or updates the discriminator/critic multiple times as compared to the generator in each
cycle. Two loss functions used by WGAN are discriminator/critic loss and generator loss, which are given
below:
𝐿𝐷=∇𝑤 1𝑚 ∑𝑚𝑖=1 [ 𝑓𝑤(𝑥(𝑖))−𝑓𝑤(𝑔𝜃(𝑧(𝑖))) ]LD=∇w 1m ∑i=1m [ fw(x(i))−fw(gθ(z(i))) ]

Equation (2) [46] specifies the discriminator/critic loss that can be simplified as a difference

Here, 𝑓𝑤(𝑥(𝑖)) fw(x(i)) represents


between the average critic score of real data and the average critic score of fake data.

and 𝑓𝑤(𝑔𝜃(𝑧(𝑖))) fw(gθ(z(i))) represents an average critic score on fake/generated data:


an average critic score on real data

𝐿𝐺=∇𝛩 1𝑚 ∑𝑚𝑖=1 (𝑔𝜃(𝑧(𝑖)))LG=∇Θ 1m ∑i=1m fw(gθ(z(i)))

Equation (3) specifies the generator loss that can be simplified as 1 − 𝑓𝑤(𝑔𝜃(𝑧(𝑖)))fw(gθ(z(i))), in
which 𝑓𝑤(𝑔𝜃(𝑧(𝑖))) fw(gθ(z(i))) depicts the average critic score of fake data. Overall, the main advantages
of WGAN include the fact that it does not suffer from the mode collapse problem, and the generator
learns well even if the critic accurately discriminates the adversarial data. Both of the loss functions
motivate a separation between a score for synthetic data and real data, which is not necessarily positive
and negative [55].
It suffices to say that WGAN has been proven to generate high-quality synthetic attack data. We
have followed a similar methodology to generate synthetic DDoS attack data in this research.

4. Dataset and Feature Selection


4.1. Dataset Properties
As detection systems evolved with time, various new attacks have also emerged that could
compromise networking systems. The training dataset needs to be updated with the latest attack features.
The Canadian Institute for Cyber Security has developed a dataset from real-time simulations, and has
published various datasets involving numerous attacks, such as Android malware, Botnet, DoS, DDoS,
etc. Their Intrusion Detection Evaluation Dataset known as CICIDS2017 [56] contains benign data and
commonly known attacks, such as Brute Force, SSH, DoS, Web Attack, Botnet, and DDoS. To produce a
reliable dataset, the authors have considered critical criteria, such as complete network configuration,
complete traffic, labeled dataset, complete interaction, complete capture, available protocols, attack
diversity, feature set, and metadata. The dataset consists of more than 80 features that are important as per
the latest network standards, and most of them were not available in the previously known datasets. In
addition, none of the other datasets have considered these benchmarks. The CICIDS2017 data consist of
eight different files that contain regular traffic and attack traffic data. Table 1 depicts the properties of the
CICIDS2017 dataset.
Table 1. Properties of the CICIDS2017 dataset.
Moreover, the CICIDS2017 dataset consists of various types of attacks along with the normal
network flow. The following Table 2 consists of the attack and benign labels available in the dataset.
Table 2. Labeled features in CICIDS2017.

4.2. Feature Selection


Feature selection is an essential aspect of machine learning. If we train the model without
determining the critical features of the dataset, the predicted results will have more noise and uncertain
results. Moreover, while using a dataset with a higher number of feature sets, it is unnecessary to use all
the available features since the machine learning method requires more resources and time to process a
large volume of data with additional features. Among several techniques to select important features from
a dataset, we have employed SHAP in this research.
Feature Selection using SHAP
Shapley Additive exPlanations (SHAP) [18] is a feature selection technique whose goal is to signify
the contribution of each feature to the predicted value. SHAP aims to satisfy two critical measures to
define feature importance, which are consistency and accuracy. The idea behind Shapley values is that the
outcome of each possible combination (or coalition) of features needs to be examined to determine the
importance of a single feature. The mathematical explanation of this is as follows:
(𝒛′)=𝛟𝟎+∑𝒋=𝟏𝑴𝛟𝒋𝒛′𝒋g(z′)=ϕ0+∑j=1Mϕjzj′

where 𝒈g represents the overall result of the Shapley values, 𝒛′𝜖 {0, 1}𝑀z′ϵ {0, 1}M is a coalition
vector, M is the max coalition size, and 𝛟𝒋ϕj represents the presence of feature j that contributes towards
the final output. In the coalition vector, 0 means the corresponding value is “not present” and 1 means it is
“present”.
Herein, each node represents a coalition of features. Edges represent the inclusion of a feature that
was not present in the previous coalition. Equation (4) trains each coalition in the power set of the
features to find the most critical feature from the dataset. The advantages of using SHAP are as follows:
-
Global Interpretability: This technique provides essential features from a dataset and a
contribution of each feature for a target result and effect of the feature. To calculate global
importance, we need to find an average of SHAP values.
𝐼𝑗=∑𝑛𝑖=1|(𝑖)𝑗| Ij=∑i=1n|ϕj(i)|

-
Local Interpretability: With this method, we can get an impact of an individual feature across the
whole dataset.
We ran the SHAP explainability model on the CICIDS2017 DDoS/DoS data. Figure 2 is known as
a summary plot that can represent an effect of the feature, positive or negative, on the result. Furthermore,
the dark red color represents a higher impact of a feature, and the blue color represents a lower impact of
a feature on the output value.

Figure 2. Summary plot with feature impact using SHAP. Red indicates a high-impact attack feature,
while blue indicates a low-impact attack feature.
We use the results of the SHAP analysis, such as those in Figure 2, in our feature selection stage.
These results identify the functional features (attack features) that are used by IDS, and the non-functional
features that would be used in creating polymorphic attacks while keeping functional features constant.
SHAP analysis helps us separate functional and non-functional features by quantifying the impact of each
feature on the correct identification of the attack data.

Proposed Framework
The proposed framework involves the WGAN model that produces adversarial attacks to
train the IDS with previously generated adversarial data, as well as the polymorphic engine to
generate polymorphic DDoS/DoS attacks using the polymorphic data to attack the IDS.
Adversarial Attack Generation Using Wasserstein GAN

We have used the DDoS/DoS attack data from the CICIDS2017 [56] to train the proposed model.
To generate an adversarial attack, we considered a combination of a random noise vector of the same size
as the selected features from the dataset.
The generator in this framework is a feed-forward neural network that consists of five linear layers.
The input layer consists of neurons as per the selected number of features, and the output layer consists of
two neurons. The input layer receives a set of features according to the experiment, and the output layer
generates the desired data. The generator consists of three hidden layers that are optimal for this scenario
and prevent overfitting the training data.
In the next step, the generated adversarial attack combined with the benign network flow data will
be fed to the Intrusion Detection System. The IDS will detect the attack and send predicted labels to the
discriminator, which is the detection success rate, and the discriminator will send the critique to the
generator using the backpropagation, in order that in the next cycle, the generator can improve the
production of adversarial DDoS/DoS attack. The IDS consists of four layers, in which the input and
output layer consists of two neurons each. The IDS consists of two hidden layers that are ideal since it
only detects if the test data consist of an attack or are benign.
We used a signature-based black-box Intrusion Detection Systems to test the detection rate of the
adversarial DDoS/DoS attacks. The reason for using this system is that most of the time, the type of
attack detection system is unknown to the attackers. Attackers rely on the responses received from the
detection system, and black-box IDS is the right choice for this model.
Finally, the critic or discriminator consists of four layers. The input layer accepts two types of data
from the black-box IDS. The output layer provides two critics, one for the generator and one for itself.
To calculate the loss, we have used loss functions for the generator and the discriminator, which are
as follows [49]:
𝑃𝐺=𝐸𝑀∈𝑆𝑎𝑡𝑡𝑎 , 𝑁 −𝐷(𝐺(𝑀,𝑁))PG=EM∈Sattack , N −D(G(M,N))

where 𝑃𝐺PG represents the penalty to the generator. M is an m-dimensional attack vector, and N is
an n-dimensional noise vector. E is the estimated value over the random inputs to the
generator. Sattack represents the original training attack data. A lower penalty to the generator means that it
is performing well and produces attack data that can bypass the IDS.
where 𝑃𝐷PD represents the penalty to the discriminator. E is the overall estimated feature values of
the generated adversarial attack data. A is the actual feature value of benign and the attack data. A lower
penalty to the discriminator indicates that the discriminator performs well. It calculates if the generated
data are closer to the DDoS/DoS attack or benign data. Algorithm 1 shows the process that is represented
in Figure 3.

Figure 3. Generating the adversarial DDoS/DoS attack.

. Train the Generator to Create an Adversarial Attack

The generator needs to maintain constant values for the features that have higher SHAP values. An
example of how the generator produces an adversarial attack by the proposed technique is shown
in Figure 4, in which the darker shade explains the values of the features that are contributing to the
attack, whereas non-highlighted values depict the feature value of a regular or non-attack feature.
Figure 4. The process to generate the adversarial DDoS/DoS attack.
As shown in Figure 4, to maintain the intensity of the attack we need to keep the functional attack
features constant and only change the feature values that are not contributing to the attack. Therefore, to
evade the black-box IDS, the generator changes the values of the features that are not contributing to the
DDoS/DoS attack.
5.3. Training an IDS with the Generated Adversarial Data
In this section we will discuss the training of the IDS in order that we can evaluate the performance
of the IDS with the adversarial data.
We consider three inputs to train the IDS: Normal or benign data, new adversarial data, and
previously generated adversarial data. The IDS learns about the adversarial data and tries to detect the
DDoS/DoS attack data.
5.4. Polymorphic Engine to Generate a Polymorphic Attack
We evaluated different methods for updating the attack feature profile to generate polymorphic
adversarial DDoS/DoS attacks. The following approaches were considered:
Approach 1: Select a subset of non-functional features in a polymorphic attack cycle. Randomly
increase the values of these features in the attack profile by a small percentage to generate new data for
training the attacker, which in turn synthesizes a polymorphic attack each time IDS detects the previous
adversarial polymorphic attack. Repeat this process until the attacker runs out of features or until the IDS
can classify all of the polymorphic attacks.
Approach 2: Add a new set of features from the predefined list of features in the current attack
profile to train the attacker after the IDS detects previous adversarial attacks. Keep repeating this process
for each polymorphic attack until the attacker runs out of features or until the IDS can classify all of the
polymorphic attacks. This approach employs both manual feature selection, as well as automated feature
selection using Reinforcement learning.
In the above techniques, we assumed that an attacker could modify the feature profile and train the
generator model with the new feature profile every time after the IDS detects a polymorphic attack.
Algorithm 2 shows the process for training the IDS, and Algorithms 3 and 4 are employed to
synthesize a polymorphic adversarial attack. In the case of Algorithm 3, we select a set of five non-
functional (non-attack) features from the training data and randomly increased their values by 5%. The
functional (attack) features are kept constant to preserve the attack characteristics. The generator is then
trained using the new dataset to synthesize polymorphic attacks and evade detection by the IDS. Then, the
IDS is retrained with new synthesized adversarial data using Algorithm 2. The polymorphic attack
generation phase is repeated by adding another set of five non-functional features and the IDS
performance is evaluated again. This process is repeated until the attacker has no more features left or
until the IDS can successfully identify all of the attacks.
Algorithm 4 works in a slightly different manner. Here, in the first cycle, a subset of three non-
functional features is selected and their values are randomly increased by 5% to create new training data
for the attacker, which can synthesize polymorphic attacks. The IDS performance against these
polymorphic attacks is evaluated and retraining is performed to improve its detection results. In the next
phase of polymorphic attack generation, we select a new subset of six non-functional features to
synthesize another polymorphic attack. This process is repeated until the attacker has no more features
left or until the IDS can successfully identify all of the attacks.

Experiment Setup
The following are the libraries used in the overall work of this research.
-
PyTorch [57] is an open-source machine learning platform that is based on the Torch library. We
used PyTorch library to create neural networks for Black-box IDS, the generator, and the
discriminator or critic. For example, to generate random noise, we have used a “ torch.Tensor”
method.
-
Scikit-learn [58] is a machine learning library for python that supports various classifications,
regressions, and clustering techniques. Examples include sklearn.utils and sklearn.metrics.
-
Pandas [59] is a python library that is used to read, manipulate, and analyze the dataset. For
example, to read CSV files, we use the read_csv() method from this library.

Hyperparameter Adjustment
Hyperparameters are essential properties that define the characteristics of the training process of
machine learning or a deep learning model. For a deep neural network, hyperparameters are variables that
explain its structure. Table 3 depicts hyperparameters that are used to optimize the generator and
discriminator in WGAN for this research.
Table 3. Hyperparameters.

We train the WGAN model for a total of 100 epochs with a batch_size of 512, learning_rate set to
0.001, critic_iters equal to 5, and the optimizer selected using trial and error is RMSprop. Batch_size,
learning_rate, critic_iters, and epochs are optimization hyperparameters related to the optimization and
training process of the model. In comparison, an optimizer is a model-specific hyperparameter.
6.2. Evaluation Metrics
The following metrics are employed to evaluate the performance of IDS in this work:
 Detection Rate (DR) or Precision—a ratio between the correctly detected attack samples over
all the samples classified as an attack by the IDS. It is also known as a ratio between True Positives and

𝐷𝑅=𝑇𝑃𝑇𝑃+𝐹𝑃DR=TPTP+FP
the sum of True Positives and False Positives.

(8)
 Recall—a ratio between the correctly detected attack samples over the total attack sample data. It

𝑅𝑒𝑐𝑎𝑙𝑙=𝑇𝑃𝑇𝑃+𝐹𝑁Recall=TPTP+FN
is also known as a ratio between True Positives and the sum of True Positives and False Negatives.

(9)

𝐹1_𝑆𝑐𝑜𝑟𝑒=2× (𝑝𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 × 𝑟𝑒𝑐𝑎𝑙𝑙) (𝑝𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 + 𝑟𝑒𝑐𝑎𝑙𝑙)F1_Score=2× (precision × recall) (precision + recall)


 F1_Score—represents the harmonic mean of precision and recall.

(10)
 True Negative Rate (TNR)—a ratio between the correctly detected benign samples over the total
benign sample data. It is also known as a ratio between True Negatives and the sum of True Negatives

𝑇𝑁𝑅=𝑇𝑁𝑇𝑁+𝐹𝑃TNR=TNTN+FP
and False Positives.

(11)
where TP, FP, TN, and FN represent True Positives, False Positives, True Negatives, and False
Negatives, respectively.
The following metric is employed to evaluate the performance of the attacker:
 IDS Evasion Success Rate (ESR)—the rate of increase of undetected adversarial polymorphic

𝐸𝑆𝑅=1−(𝐴𝑑𝑣𝑒𝑟𝑠𝑎𝑟𝑖𝑎𝑙 𝑝𝑜𝑙𝑦𝑚𝑜𝑟𝑝ℎ𝑖𝑐 𝑑𝑒𝑡𝑒𝑐𝑡𝑖𝑜𝑛 𝑟𝑎𝑡𝑒) (𝑂𝑟𝑖𝑔𝑖𝑛𝑎𝑙 𝑑𝑒𝑡𝑒𝑐𝑡𝑖𝑜𝑛 𝑟𝑎𝑡𝑒)ESR=1−


attack samples by IDS compared to the original attack samples.

(Adversarial polymorphic detection rate) (Original detection rate)

(12)

7. Results and Discussion


This section describes the results of various experiments for different scenarios and the analyses of
the findings.
The first step of the research is to generate adversarial DDoS/DoS data that can evade detection by
the Black-box IDS. We have selected a tree-based Random Forest classifier as the IDS model for our
experiments. Figure 5 represents the results of the IDS against adversarial attacks. As seen in the graph
initially, after training the attack generator for 100 epochs, it learns to synthesize adversarial data and is
successful in evading the IDS by reducing the Detection Rate (DR) close to zero. After retraining the IDS
with the previously generated adversarial DDoS/DoS data, the performance improves significantly.
Figure 5. Adversarial DDoS/DoS attack generation and retraining.
7.1. Polymorphic Adversarial DDoS/DoS Attack Generation
In this section, we discuss the performance of a Random Forest-based IDS in different polymorphic
adversarial attack cycles based on Algorithm 3. In Figure 6, the red-colored graph suggests the
polymorphic attack phase and the blue-colored graph depicts the results after retraining the IDS with
previously synthesized polymorphic adversarial data. During polymorphic cycle 1, the DR for the IDS is
reduced to almost 25%. After retraining the IDS in the same cycle, we observe significant improvements
in the DR values. A similar behavior is observed in cycle 2. However, in cycle 3, we notice that the DR of
IDS against polymorphic attacks has improved to approximately 82% as compared to cycles 1 and 2.
Finally, in cycle 4, the IDS can no longer be evaded by the attacker. The DR of IDS does not drop to a
lower value in the attack phase. Therefore, no retraining is required for this cycle.
Figure 6. Polymorphic adversarial DDoS/DoS attack using Algorithm 3.
Figure 7 depicts the DR results of the Random Forest IDS against polymorphic attacks synthesized
by implementing Algorithm 4. We observe that the DR is dropped to almost zero after 100 epochs in
cycle 1. After retraining, the DR improves to 70% which is lower as compared to cycle 1 in Figure 6.
Gradually, after multiple attacks and retraining cycles (2–3), the IDS can capture the pattern of
polymorphic attacks and can no longer be evaded.
Figure 7. Polymorphic adversarial DDoS/DoS attack using Algorithm 4.
Figure 8 represents the evaluation of the attacker model based on the IDS Evasion Success Rate
(ESR). It measures the success of the polymorphic adversarial attack in evading detection by the IDS. As
shown in Figure 8, ESR in the adversarial cycle and attack cycles 1–2 is higher indicating that the
attacker can successfully evade detection in these attack cycles. However, ESR reduces gradually after
continuous updating and retraining of the IDS, indicating that it has learned the pattern and can now
identify the attack with higher detection rates.
Figure 8. (a) Comparing the IDS evasion success rate for polymorphic adversarial attacks. The figure
represents the results using Algorithm 3. (b) Comparing the IDS evasion success rate for polymorphic
adversarial attacks. The figure represents the results using Algorithm 4.
Table 4 shows the performance evaluation and comparison of overall metric values, such as Recall
(TPR), TNR, and F1-score for the Random Forest IDS model on different adversarial polymorphic
attacks. The results show that during the attack cycle, the attacker is successful in evading detection by
the IDS as depicted by the low TPR values. After each retraining phase, the IDS eventually learns the
attack pattern until the attacker can no longer launch successful attacks on the victim.
Table 4. Performance evaluation and comparison for random forest IDS on different adversarial
polymorphic attacks using Algorithms 3 and 4 (Approach 1).
The Random Forest IDS is also evaluated against the polymorphic attacks generated using Approach
2 [60]. The strength of these polymorphic attacks is measured using the Evasion Success Rate metric. In
this case, multiple experimental scenarios are studied with different training data feature combinations
(both manual and automatic feature selection). Six different experiments are performed with a different
number of selected features for generating a polymorphic attack. For manual feature selection, 10 features
are selected during the first test, followed by 20 features in the second test. Automated tests using
Reinforcement learning were conducted with 40 features, 50 features, 60 features, and 76 features.
Figure 9 depicts the success rate for polymorphic adversarial attacks created using manual feature
selection (20 features). Figure 10 depicts the polymorphic adversarial attack synthesized using automated
feature selection (40 features) successfully evading the IDS. The red bars indicate the success of the
polymorphic attack engine in evading IDS. As expected, each training session (yellow bar) improves the
IDS detection rate against the attack. The number of cycles indicates how many times the attack generator
is able to evade the IDS until the IDS is fully trained with all of the features or the attack engine runs out
of features. Throughout our study, we also observed that using fewer features (e.g., five instead of 10)
improves the evasion rates, but offers fewer options for synthesizing more polymorphic attacks.

Figure 9. Polymorphic adversarial attacks using the manual feature selection (20 features).
Figure 10. Polymorphic adversarial attacks using the automated feature selection (40 features).
7.2. Analysis and Discussion
To evaluate the performance of our WGAN-based framework comprehensively, several state-of-the-
art machine learning models are employed as black-box IDS. The adopted machine learning models
include Random Forest (RF), Decision Tree (DT), Support Vector Machine (SVM), K-Nearest Neighbor
(KNN), and Naïve Bayes (NB).
Multiple IDS models are initially trained using CICIDS2017 data one by one, and then evaluated
against adversarial polymorphic attacks using our framework. Figure 11 provides a comparative analysis
of these models against adversarial polymorphic attacks. During the first attack cycle, the models are
trained using the original training dataset and their performance is evaluated against adversarial attacks.
As seen in all of the subfigures above, the adversarial detection rates of all the models are very low in the
first phase. For SVM and NB, the adversarial detection rates are close to zero. The models are then
retrained with previous adversarial data from the attack cycle and again evaluated in the retraining cycle.
The results indicate improvement in IDS performances. In the next attack cycle, the attacker mutates the
feature profile using the value-based approach (approach 1) and relaunches the attack on the IDS. During
this phase, the detection rates go down again, yet show better results than phase 1. This process is
repeated until the IDS cannot be evaded by the polymorphic attacker. Figure 11 shows that RF, DT, and
KNN models do not need retraining for the last two phases since these IDSs can easily identify the attack,
whereas SVM and NB still have lower detection rates in the last phase of the polymorphic attack.
From Figure 11, we notice that the proposed WGAN framework for polymorphic adversarial training is
effective in improving the performance of the machine learning-based black-box IDSs against rapidly
evolving polymorphic attacks. Further performance improvement is expected in the future when the
model is trained with other classes of polymorphic network attacks.
Figure 11. Comparative analysis of adversarial polymorphic attack detection rate for multiple IDS
models. The adversarial polymorphic attacks are synthesized using Algorithm 3. (a) Random
Forest (RF). (b) Decision Tree (DT). (c) Support Vector Machine. (d) K-Nearest Neighbor
(KNN). (e) Naïve Bayes (NB).

8. Conclusions and Future Work


In this paper, we proposed a Wasserstein GAN-based framework to generate polymorphic
adversarial DDoS/DoS attacks using a CICIDS2017 dataset. In order to synthesize these attacks,
we applied two different approaches to change the feature profile of the attack. For the first
approach, we employed a value-based feature mutation to synthesize new data for the attacker,
which then generates a polymorphic attack. In the second approach, the feature selection-based
method was employed to generate new data for the attacker, which can in turn synthesizes a
polymorphic attack. The second approach is based on both the manual as well as the automated
feature selection.
From the results, we demonstrated that the Generator can produce polymorphic adversarial
DDoS/DoS attacks to effectively evade the IDS during the initial phases. However, after several
retraining steps, the IDS learns the pattern of attacks and eventually identifies all of the attacks.
Additionally, we have provided an extensive comparison of multiple machine learning models
against these attacks. The results indicate that the WGAN based adversarial training has
improved the performance of several IDSs against polymorphic attacks.
In this paper, the work represented the introduction of a novel concept in network security,
namely, polymorphic network attacks. Therefore, this work can be extended and built upon
extensively for application to different security attack types, and IDS systems. While the
proposed model has employed WGAN, there are several other variants of GAN, such as
DCGAN [61], Conditional GAN [62], BiGAN [63], and Cycle GAN [64] that can be used to
generate adversarial network attack data. On the IDS side, our results indicate that the
polymorphic attackers can evade detection, albeit for a limited number of cycles. It is imperative
to develop new techniques and models for the IDS that could, if not eliminate, at least shorten
the window of vulnerability against polymorphic attacks.

Future Scope:

The future scope of Incremental Adversarial Learning for Polymorphic Attack Detection
revolves around enhancing the system's ability to continuously adapt to new attack patterns,
improve its robustness, and be applicable in various real-world cybersecurity environments.
Below are several areas where this research could have significant future impact:

1. Scalability Across Diverse Networks:

 Scope: The system could be extended to detect polymorphic attacks across large-scale
enterprise networks, cloud infrastructures, and IoT environments. As these networks
are often heterogeneous and dynamic, having a scalable solution will be crucial.
 Impact: Adapting the model to handle vast amounts of data and different network
environments will make it applicable to a broader set of real-world cybersecurity
problems.

2. Deployment in Real-Time Security Systems:

 Scope: The system can be deployed in real-time monitoring tools, such as intrusion
detection systems (IDS), firewalls, and endpoint security solutions. Improving its
speed and latency will allow it to operate in real-time threat detection scenarios.
 Impact: By ensuring that the detection system works efficiently in real-time, security
teams can quickly identify and neutralize polymorphic threats, reducing response time
during an attack.
3. Generalization and Cross-Domain Transferability:

 Scope: Future work can focus on enhancing the model's ability to generalize across
multiple attack types and domain environments (e.g., malware detection, web security,
and network intrusion detection). This would involve developing a system that can learn
patterns not only specific to one attack vector but also be transferable to new and varied
environments.
 Impact: This will make the system highly adaptable to diverse cybersecurity domains,
broadening its applicability and usefulness.

4. Enhancing Adversarial Robustness:

 Scope: Research into improving adversarial robustness is critical. This includes


developing better defensive mechanisms to defend against adversarial attacks that try to
deceive the model into making incorrect predictions.
 Impact: Making the detection model more resilient to adversarial manipulation ensures
that it remains effective even when attackers deliberately try to mislead the system.

5. Integration with Threat Intelligence Feeds:

 Scope: The system could be integrated with global threat intelligence feeds to share
new attack signatures and patterns. By learning from global threat data, the model could
adapt more quickly to emerging polymorphic attack types.
 Impact: This will allow the model to stay up-to-date with the latest threats and improve
its detection accuracy over time.

6. Privacy-Preserving Machine Learning:

 Scope: As the system processes sensitive data, ensuring that it operates in a privacy-
preserving manner will be essential, especially in industries like healthcare and finance.
This could involve incorporating techniques like differential privacy or federated
learning, where data can be processed without exposing sensitive information.
 Impact: This ensures that the system can be deployed in privacy-sensitive environments
while still maintaining its effectiveness in detecting polymorphic attacks.

7. Expansion to Multi-Modal Data Sources:


 Scope: The system can be expanded to handle multi-modal data, such as sensor data,
logs, files, and network traffic simultaneously. This will help provide a more holistic
approach to detecting polymorphic attacks, which could span multiple layers of a
network or system.
 Impact: Multi-modal data integration would result in a more robust detection system, as
it can analyze various signals simultaneously, increasing its ability to identify
sophisticated polymorphic attacks.

8. Federated Learning for Collaborative Defense:

 Scope: Implement federated learning where different organizations or devices


contribute data without transferring it to a centralized server. This would allow
collaborative model updates in a privacy-preserving manner while still improving the
overall attack detection capabilities.
 Impact: This will enable a collective defense mechanism, with multiple entities
benefiting from shared knowledge while preserving the confidentiality of their data.

Future Work:

To achieve the above scope, several research avenues need to be pursued in future work:

1. Optimizing the Incremental Learning Process:

 Objective: Develop efficient incremental learning algorithms that allow the model to
update continuously without forgetting previous information. Implementing online
learning techniques, such as Elastic Weight Consolidation (EWC) or Progressive
Neural Networks, could help manage the balance between adapting to new data and
retaining prior knowledge.
 Work Required: Explore different methods for continuous training and handle concept
drift (changes in underlying data distributions over time).

2. Improving the Detection of Novel Polymorphic Variants:

 Objective: Current models often fail to detect novel variants of polymorphic attacks.
Future work should focus on improving the model's ability to detect previously unseen
attack types by using techniques like outlier detection or unsupervised anomaly
detection.
 Work Required: Investigate unsupervised learning techniques and semi-supervised
learning models that can detect new variants of polymorphic attacks without requiring
labeled examples.

3. Adversarial Example Generation for Robust Training:

 Objective: The system should be capable of generating adversarial examples to ensure


robust training. This will help in training the model to defend against attacks that may try
to manipulate or mislead it.
 Work Required: Explore techniques like Generative Adversarial Networks (GANs)
for generating adversarial examples and incorporate them into the training process for
adversarial robustness.

4. Extending to Multi-Layered Defense Architectures:

 Objective: Develop a multi-layered defense architecture that combines signature-


based detection, behavioral analysis, and machine learning-based detection into one
unified framework. This could help mitigate the weaknesses of each approach.
 Work Required: Integrate multiple layers of detection techniques, including traditional
signature-based detection, dynamic behavior analysis, and machine learning-based
approaches to create a more comprehensive defense.

5. Data Privacy and Security in Machine Learning:

 Objective: Investigate privacy-preserving techniques for machine learning, such as


homomorphic encryption or federated learning, to ensure that sensitive data is not
exposed while still allowing the model to improve over time.
 Work Required: Research how to apply these privacy-preserving techniques in a way
that doesn't compromise the performance or scalability of the attack detection system.

6. Fine-Tuning the Model for Real-Time Deployment:

 Objective: Future work will need to focus on optimizing the model for low-latency and
real-time deployment, ensuring that the system can handle high-throughput data streams
with minimal delay.
 Work Required: Develop lightweight models or explore edge computing approaches
to ensure that real-time detection can occur with minimal computational overhead.
Future Enhancements:

Future enhancements for Incremental Adversarial Learning for Polymorphic Attack


Detection could focus on several critical areas to ensure the system remains adaptable and robust
against emerging cybersecurity threats. First, improving the scalability of the system will be
essential for deploying it across large, distributed networks, such as enterprise infrastructures,
cloud environments, and IoT ecosystems. This includes optimizing the model for low-latency
detection and real-time analysis, ensuring quick responses in critical environments.
Additionally, incorporating multi-modal data (e.g., logs, sensor data, network traffic) into the
system will make it more robust by enabling it to learn from diverse attack vectors and attack
signatures. One of the key areas of future research will involve enhancing adversarial
robustness to counter increasingly sophisticated adversarial examples crafted to mislead the
model. Further, federated learning could be leveraged for privacy-preserving machine
learning, allowing multiple organizations to collaborate without sharing sensitive data.
Expanding the system’s ability to handle novel polymorphic variants through unsupervised or
semi-supervised learning techniques will enable the detection of previously unseen attack
types, ensuring that the system can continually evolve in response to the rapidly changing
landscape of cybersecurity threats. Finally, integrating the system with global threat
intelligence feeds will allow it to adapt to the latest attack patterns and quickly mitigate new
threats. These advancements will ensure that the system remains a dynamic and comprehensive
solution capable of addressing both current and emerging challenges in polymorphic attack
detection.

Conclusion:

The integration of Incremental Adversarial Learning for Polymorphic Attack Detection


represents a significant advancement in cybersecurity by offering a dynamic and scalable
solution to detecting increasingly sophisticated attacks. As polymorphic attacks evolve in both
complexity and frequency, traditional methods are often inadequate, making machine learning
approaches essential for adapting to these changes. Incremental learning ensures that models can
continue to learn from new data and adapt without requiring retraining from scratch, which is
crucial for real-time environments. The incorporation of adversarial learning techniques further
strengthens the system by defending against adversarial manipulation, which is often used by
attackers to evade detection. However, for the system to reach its full potential, future work
should focus on enhancing scalability, robustness, and privacy-preserving methods.
Additionally, leveraging federated learning, multi-modal data sources, and continuous
updates through threat intelligence feeds will help the system evolve and stay effective in the
face of novel attack techniques. Overall, the continuous development of such intelligent,
adaptable systems is pivotal to ensuring effective defense mechanisms against polymorphic and
adversarial attacks in modern digital environments.

SOURCE CODE:
import streamlit as st

import numpy as np

import tensorflow as tf

from tensorflow.keras.models import load_model

# Load the trained model

@st.cache_resource

def load_attack_model():

try:

return load_model("adversarial_model.h5", compile=False)

except Exception as e:

st.error(f"Error loading model: {e}")

return None

model = load_attack_model()

# Attack Type Mapping

attack_types = {

0: "Normal",

1: "DoS Attack",
2: "Probe Attack",

3: "R2L Attack",

4: "U2R Attack"

# Session state for user authentication

if "authenticated" not in st.session_state:

st.session_state.authenticated = False

# Sidebar Navigation

st.sidebar.title("Navigation")

page = st.sidebar.radio("Go to", ["Home", "Register", "Login",


"Prediction"])

# Home Page

if page == "Home":

st.title("🏠 Welcome to the Attack Type Prediction System")

st.image("download.jfif", use_column_width=True)

st.markdown("This app helps predict attack types using machine


learning.")
# Register Page

elif page == "Register":

st.title("📝 Register")

username = st.text_input("Username")

password = st.text_input("Password", type="password")

if st.button("Register"):

st.success("Registration successful! You can now login.")

# Login Page

elif page == "Login":

st.title("🔑 Login")

username = st.text_input("Username")

password = st.text_input("Password", type="password")

if st.button("Login"):

st.session_state.authenticated = True

st.success("Login successful! Navigate to Prediction page.")

# Prediction Page (Require Authentication)

elif page == "Prediction":

if not st.session_state.authenticated:
st.warning("⚠ Please log in to access the prediction page.")

st.stop()

st.title("🔍 NSL-KDD Attack Type Prediction")

st.markdown("Enter attack details below:")

with st.form("prediction_form"):

duration = st.number_input("Duration", min_value=0, value=0)

protocol_type = st.selectbox("Protocol Type", [0, 1, 2]) # Encoded


values

service = st.number_input("Service (Encoded)", min_value=0,


value=0)

flag = st.number_input("Flag (Encoded)", min_value=0, value=0)

src_bytes = st.number_input("Source Bytes", min_value=0,


value=100)

dst_bytes = st.number_input("Destination Bytes", min_value=0,


value=50)

land = st.number_input("Land", min_value=0, max_value=1,


value=0)

wrong_fragment = st.number_input("Wrong Fragment",


min_value=0, value=0)

urgent = st.number_input("Urgent", min_value=0, value=0)

hot = st.number_input("Hot", min_value=0, value=0)


num_failed_logins = st.number_input("Num Failed Logins",
min_value=0, value=0)

logged_in = st.number_input("Logged In", min_value=0,


max_value=1, value=0)

num_compromised = st.number_input("Num Compromised",


min_value=0, value=0)

root_shell = st.number_input("Root Shell", min_value=0,


max_value=1, value=0)

su_attempted = st.number_input("SU Attempted", min_value=0,


max_value=1, value=0)

num_root = st.number_input("Num Root", min_value=0, value=0)

num_file_creations = st.number_input("Num File Creations",


min_value=0, value=0)

num_shells = st.number_input("Num Shells", min_value=0,


value=0)

num_access_files = st.number_input("Num Access Files",


min_value=0, value=0)

num_outbound_cmds = st.number_input("Num Outbound Cmds",


min_value=0, value=0)

is_host_login = st.number_input("Is Host Login", min_value=0,


max_value=1, value=0)

is_guest_login = st.number_input("Is Guest Login", min_value=0,


max_value=1, value=0)

count = st.number_input("Count", min_value=0, value=10)

srv_count = st.number_input("Srv Count", min_value=0, value=5)


serror_rate = st.slider("Serror Rate", 0.0, 1.0, 0.5)

srv_serror_rate = st.slider("Srv Serror Rate", 0.0, 1.0, 0.5)

rerror_rate = st.slider("Rerror Rate", 0.0, 1.0, 0.5)

srv_rerror_rate = st.slider("Srv Rerror Rate", 0.0, 1.0, 0.5)

same_srv_rate = st.slider("Same Service Rate", 0.0, 1.0, 0.5)

diff_srv_rate = st.slider("Diff Srv Rate", 0.0, 1.0, 0.5)

srv_diff_host_rate = st.slider("Srv Diff Host Rate", 0.0, 1.0, 0.5)

dst_host_count = st.number_input("Dst Host Count", min_value=0,


value=0)

dst_host_srv_count = st.number_input("Dst Host Srv Count",


min_value=0, value=0)

dst_host_same_srv_rate = st.slider("Dst Host Same Srv Rate", 0.0,


1.0, 0.5)

dst_host_diff_srv_rate = st.slider("Dst Host Diff Srv Rate", 0.0,


1.0, 0.5)

dst_host_same_src_port_rate = st.slider("Dst Host Same Src Port


Rate", 0.0, 1.0, 0.5)

dst_host_srv_diff_host_rate = st.slider("Dst Host Srv Diff Host


Rate", 0.0, 1.0, 0.5)

dst_host_serror_rate = st.slider("Dst Host Serror Rate", 0.0, 1.0,


0.5)

dst_host_srv_serror_rate = st.slider("Dst Host Srv Serror Rate", 0.0,


1.0, 0.5)
dst_host_rerror_rate = st.slider("Dst Host Rerror Rate", 0.0, 1.0,
0.5)

dst_host_srv_rerror_rate = st.slider("Dst Host Srv Rerror Rate",


0.0, 1.0, 0.5)

level = st.number_input("Level", min_value=0, value=0) # New


feature added

submitted = st.form_submit_button("Predict")

if submitted:

if model:

input_data = np.array([

duration, protocol_type, service, flag, src_bytes, dst_bytes,


land,

wrong_fragment, urgent, hot, num_failed_logins, logged_in,


num_compromised,

root_shell, su_attempted, num_root, num_file_creations,


num_shells, num_access_files,

num_outbound_cmds, is_host_login, is_guest_login, count,


srv_count, serror_rate,

srv_serror_rate, rerror_rate, srv_rerror_rate, same_srv_rate,


diff_srv_rate,

srv_diff_host_rate, dst_host_count, dst_host_srv_count,


dst_host_same_srv_rate,
dst_host_diff_srv_rate, dst_host_same_src_port_rate,
dst_host_srv_diff_host_rate,

dst_host_serror_rate, dst_host_srv_serror_rate,
dst_host_rerror_rate,

dst_host_srv_rerror_rate, level

]).reshape(1, -1)

prediction = model.predict(input_data)

st.success(f"Predicted Attack Type:


{attack_types.get(np.argmax(prediction), 'Unknown')}")

else:

st.error("Model not loaded. Please check the file.")


References:

1. Grosse, K., Laskov, P., & Rieck, K. (2016). Adversarial examples for malware
classification. Proceedings of the 11th ACM Symposium on Information, Computer and
Communications Security, 67-78.
2. Goodfellow, I., Shlens, J., & Szegedy, C. (2015). Explaining and harnessing
adversarial examples. Proceedings of the International Conference on Machine
Learning (ICML), 1-9.
3. Carlini, N., & Wagner, D. (2017). Towards evaluating the robustness of neural
networks. Proceedings of the IEEE Symposium on Security and Privacy (S&P), 39-57.
4. Chen, X., Song, L., & Wang, Z. (2018). Adversarial training for polymorphic
malware detection. IEEE Transactions on Information Forensics and Security, 13(9),
2372-2385.
5. Zhang, F., Liao, J., & Xie, L. (2019). Adversarial machine learning for polymorphic
malware detection. Proceedings of the IEEE International Conference on Cloud
Computing and Security.
6. Yao, Z., & Liu, X. (2019). Incremental learning for evolving polymorphic malware
detection. International Journal of Computer Science and Security, 13(4), 152-167.
7. Papernot, N., McDaniel, P., & Goodfellow, I. (2017). Transferability in machine
learning: From phenomena to black-box attacks. Proceedings of the IEEE European
Symposium on Security and Privacy, 1-16.
8. Salim, M., & Raja, A. (2018). Adversarial machine learning: A survey on adversarial
attacks and defenses. International Journal of Computer Science & Engineering, 10(5),
125-135.
9. Khodak, M., & Shmatikov, V. (2018). Adversarial attacks and defenses for malware
detection systems. Proceedings of the IEEE Conference on Computer Vision and Pattern
Recognition (CVPR), 1-10.
10. Rieck, K., & Laskov, P. (2016). Learning to detect adversarial malware variants.
Proceedings of the 25th USENIX Security Symposium, 79-94.
11. Soni, A., & Srinivasan, M. (2020). Real-time detection of polymorphic attacks using
incremental learning techniques. International Journal of Network Security and Digital
Forensics, 4(1), 50-65.
12. Zang, H., & Chen, K. (2020). Federated learning for malware detection in mobile
networks. IEEE Transactions on Mobile Computing, 19(3), 533-545.
13. Liu, Y., & Chen, S. (2019). PolyML: A machine learning framework for polymorphic
malware detection. Proceedings of the 33rd International Conference on Machine
Learning (ICML), 227-239.
14. Zhang, X., & Chen, Y. (2017). An adversarial attack method based on polymorphic
malware. Journal of Computer Security, 25(2), 139-156.
15. Li, J., & Suresh, A. (2019). Learning with privacy in machine learning systems.
Proceedings of the 7th Conference on Information Security and Privacy.
16. Singh, P., & Kumar, S. (2020). Polymorphic attack detection using adversarial neural
networks. International Journal of Information Security and Privacy, 14(3), 35-52.
17. Ghorbani, A., & Homaifar, A. (2020). Incremental adversarial learning: An approach
for real-time attack detection. Proceedings of the ACM Workshop on Adversarial
Machine Learning, 45-60.
18. Saha, S., & Dash, M. (2019). Dynamic malware detection through adversarial
models. IEEE Transactions on Cybernetics, 49(5), 1721-1733.
19. Chien, K., & Lee, T. (2021). A comprehensive review of adversarial attacks and
defense techniques in cybersecurity. Computers & Security, 98, 102213.
20. Choi, T., & Lee, D. (2020). Survey on machine learning in malware detection:
Trends and challenges. Journal of Computational Security, 28(3), 93-107.

You might also like