Location Research Breakthrough Possible @S-Logix pro@slogix.in

Deep Learning-Driven Detection and Adaptive Mitigation of Distributed Denial-of-Service Attacks Against Nginx Web Servers Using 1D Convolutional Neural Networks

Description

Organizations deploy web servers to provide websites, web applications, APIs, and other online services. These services receive HTTP requests from clients and process incoming network traffic to deliver application functionality.

Distributed Denial-of-Service (DDoS) attacks attempt to disrupt service availability by generating excessive traffic from multiple sources or through distributed systems. When incoming traffic exceeds the capacity of a web server or its supporting resources, legitimate users may experience slow responses, connection failures, or temporary service unavailability.

Traditional security mechanisms may use predefined traffic thresholds, connection limits, or known attack patterns to identify suspicious activity. However, traffic characteristics can vary across attack types, traffic volumes, and legitimate usage patterns. Deep learning provides an additional approach by learning patterns from labelled network traffic records and classifying traffic according to its observed characteristics.

In this use case, an Nginx web server is deployed on Ubuntu within an isolated laboratory environment. Kali Linux is used as the controlled security-testing system. VirtualBox provides the virtualized environment in which the web server and testing system operate.

A public DDoS traffic dataset is used as the existing data source for the machine-learning stage. Normal and DDoS traffic records are selected and processed to extract the numerical features required for model training. The dataset is obtained from an existing public source rather than manually created for this project.

A One-Dimensional Convolutional Neural Network (1D CNN) is used to learn patterns in the processed network traffic features and classify traffic as normal or DDoS-related. The model is evaluated using held-out dataset records before being integrated into the laboratory traffic-analysis workflow.

During practical validation, network traffic associated with normal web-server activity and controlled security testing is captured and processed. The trained model evaluates the extracted features and produces a traffic classification result. The detection result is then used to trigger or recommend a controlled mitigation action, such as applying rate limits or a restrictive firewall rule within the laboratory.

The mitigation mechanism is evaluated separately to determine whether it reduces the impact of controlled test traffic while preserving legitimate access. The experiment also measures detection performance and inference time to assess the feasibility of the proposed workflow.

The complete detection and mitigation workflow is:

Public DDoS Traffic Dataset → Data Preprocessing → Traffic Feature Extraction → 1D CNN Training → Model Evaluation → Nginx Web Server on Ubuntu → Network Traffic Capture → Feature Extraction → DDoS Traffic Classification → Detection Decision → Controlled Mitigation → Mitigation Validation

Existing Security Problem

Service: Nginx Web Server on Ubuntu

Nginx is the target web-server service in this use case. It receives and processes HTTP requests from clients and provides web content or application access.

The Nginx service is deployed within an isolated laboratory environment so that legitimate traffic, controlled test traffic, and mitigation behavior can be observed without affecting external systems.

Existing Problem :

Web servers depend on available network bandwidth, connection capacity, CPU resources, memory, and supporting application resources to process incoming requests. A DDoS attack can generate a high volume of traffic that competes with legitimate client requests for these resources.

If excessive traffic is not identified and handled appropriately, the web server may experience degraded performance, increased response times, connection exhaustion, or temporary service unavailability.

Traditional threshold-based detection can identify traffic that exceeds configured limits, but fixed thresholds may not adequately distinguish all legitimate traffic surges from malicious activity. A detection approach that analyzes multiple traffic characteristics can provide additional information for identifying potential DDoS activity.

The security problem is:
Nginx Web Server on Ubuntu
→
Normal HTTP Request Activity
→
Incoming Network Traffic
→
Distributed Traffic Volume Increase
→
Potential Resource Exhaustion
→
Degraded Web-Service Availability
→
Legitimate Requests Affected
→
DDoS Detection and Mitigation Requirement

The proposed solution uses a 1D CNN trained on an existing public DDoS traffic dataset to classify network traffic based on extracted features. The model's output is evaluated against captured traffic and used within a controlled mitigation workflow. Detection performance and the effect of mitigation on legitimate access are measured during laboratory testing.

Attack

Specific Attack: Controlled Distributed Denial-of-Service Traffic Test Against an Nginx Web Server

The controlled attack scenario evaluates whether the proposed detection workflow can identify DDoS-related traffic patterns and support a mitigation response against the Nginx web server.

Testing is restricted to the isolated VirtualBox laboratory. The objective is to generate controlled traffic for evaluating detection and mitigation, not to disrupt public services or external systems.

The test traffic is captured and processed using the same feature representation expected by the trained model. The resulting prediction is compared with the known test scenario to evaluate whether the model identifies the traffic correctly.

Attack Behavior :
Authorized Laboratory Client
→
Nginx Web Server on Ubuntu
→
Normal HTTP Request Activity
→
Controlled High-Volume Traffic Test
→
Network Traffic Capture
→
Traffic Feature Extraction
→
1D CNN Analysis
→
DDoS Traffic Classification
→
Detection Decision
→
Controlled Mitigation Action
→
Legitimate Traffic Availability Check
→
Detection and Mitigation Validation

Security Concept

Deep Learning-Based DDoS Detection and Adaptive Traffic Mitigation

The primary security concept is deep learning-based network traffic classification combined with controlled DDoS mitigation.

The first objective is to establish a labelled traffic representation using an existing public DDoS traffic dataset. Normal and DDoS-related records are processed into numerical features suitable for the 1D CNN model.

The second objective is to evaluate whether the trained model can distinguish normal traffic from DDoS-related traffic. The model's predictions are assessed using held-out data and controlled laboratory traffic. Real-time performance is measured separately rather than assumed from offline classification results.

The third objective is to connect the detection result to a controlled mitigation mechanism. When the detection criteria are satisfied, the laboratory system can apply a predefined rate-limiting or firewall action. The resulting effect on server responsiveness and legitimate client access is then evaluated.

The assessment follows:
Public DDoS Traffic Data Review
→
Normal and DDoS Traffic Selection
→
Data Preprocessing
→
Traffic Feature Extraction
→
1D CNN Training
→
Model Performance Evaluation
→
Nginx Web Server Deployment
→
Controlled Traffic Testing
→
Network Traffic Capture
→
1D CNN Traffic Classification
→
Detection Decision
→
Controlled Mitigation
→
Service Availability Validation

Defensive Mechanism

The security concept defines the overall security strategy.

The following are the specific defensive mechanisms implemented in this use case.

Traffic Classification Using 1D CNN :

A 1D CNN model is trained using processed and labelled network traffic records to distinguish normal traffic from DDoS-related traffic.

Purpose: Classify network traffic using learned patterns in the selected traffic features.

Consistent Traffic Feature Extraction

The same feature definitions and compatible preprocessing steps are applied to training data and traffic captured during testing.

Purpose
  • Ensure that model input features are represented consistently during training and detection.

Network Traffic Monitoring

Traffic associated with the Nginx web server is captured and processed to provide the input required by the detection workflow.

Purpose
  • Provide network traffic evidence for DDoS analysis.

Detection-Triggered Mitigation

A predefined mitigation action is triggered or recommended when the detection criteria are satisfied. The action may apply a restricted firewall rule or rate limit to the relevant laboratory traffic.

Purpose
  • Reduce the impact of detected DDoS-related traffic on the web service.
  • Legitimate Traffic Protection
  • The effect of mitigation is evaluated by checking whether legitimate requests can still reach and use the Nginx web server.
  • Purpose : Assess whether mitigation reduces suspicious traffic without unnecessarily disrupting legitimate access.

Detection and Mitigation Evaluation

Model predictions, inference time, service responsiveness, and false-positive results are recorded during testing.

Purpose
  • Measure the effectiveness and limitations of the proposed detection and mitigation workflow.

Security Tools

Target Web Server: Nginx

Nginx provides the web-server service used to evaluate traffic detection and controlled mitigation.

Purpose
  • Host the laboratory web service.
  • Receive legitimate HTTP requests.
  • Provide a target for controlled traffic testing.
  • Support evaluation of service availability during mitigation.

Operating System: Ubuntu Linux

Ubuntu provides the environment for hosting Nginx and running the traffic-analysis and mitigation components.

Purpose
  • Host the Nginx web server.
  • Execute the detection workflow.
  • Support controlled firewall and traffic-management configuration.

Security Testing Platform: Kali Linux

Kali Linux provides the controlled testing environment used to generate legitimate requests and authorized test traffic against the laboratory server.

Purpose
  • Perform authorized network testing.
  • Generate controlled test requests.
  • Validate web-server r eachability and response behavior.

Virtualization Platform: VirtualBox

VirtualBox provides the isolated virtual environment used to host the Ubuntu server and Kali testing system.

Purpose
  • Create isolated virtual machines.
  • Establish controlled laboratory networking.
  • Restrict testing to the authorized environment.

Machine-Learning Environment: Python

Python provides the primary environment for data processing, model development, traffic classification, and result analysis.

Purpose
  • Implement the machine-learning workflow.
  • Process traffic features.
  • Generate model predictions.
  • Evaluate detection performance.

Deep Learning Framework: TensorFlow/Keras

TensorFlow/Keras is used to implement and train the 1D CNN model.

Purpose
  • Build the 1D CNN architecture.
  • Train the model using processed traffic features.
  • Generate traffic classification predictions.
  • Evaluate model performance.

Data Processing Tool: Pandas

Pandas is used to load, filter, clean, and organize the existing public traffic records.

Purpose
  • Process dataset records.
  • Select normal and DDoS-related traffic.
  • Prepare data for feature extraction.

Numerical Processing Tool: NumPy

NumPy supports numerical transformations and array operations required for preparing model inputs.

Purpose
  • Transform numerical features.
  • Prepare model input arrays.
  • Support efficient numerical processing.

Network Traffic Analysis Tool: Wireshark

Wireshark is used to inspect captured network traffic and validate the traffic generated during controlled laboratory testing.

Purpose
  • Inspect network communication.
  • Review captured traffic characteristics.
  • Support traffic-validation activities.

Network Traffic Capture Tool: tcpdump

tcpdump is used to capture network packets from the authorized laboratory interface when packet-level evidence is required.

Purpose
  • Capture laboratory network traffic.
  • Preserve packet-level evidence.
  • Support traffic-analysis validation.

Network Security Tool: Nmap

Nmap is used to identify the exposed services of the designated laboratory server.

Purpose
  • Discover the Nginx server's reachable services.
  • Validate the intended service exposure.
  • Record the laboratory network configuration.

Mitigation Tool: Linux Firewall and Traffic-Control Mechanisms

Linux firewall rules and appropriate traffic-control mechanisms are used to implement and evaluate controlled mitigation.

Purpose
  • Apply predefined traffic restrictions.
  • Restrict selected test traffic when required.
  • Evaluate the effect of mitigation on legitimate service access.

Data Source: Public DDoS Traffic Dataset

An existing public DDoS traffic dataset provides labelled network traffic records for model development and evaluation.

Purpose
  • Provide existing normal and DDoS-related traffic records.
  • Support supervised model training.
  • Provide held-out records for performance evaluation.

Visualization Tool: Matplotlib

Matplotlib is used to visualize model performance and traffic-classification results.

Purpose
  • Visualize training and evaluation metrics.
  • Compare classification results.
  • Present detection findings.

Process

STEP 01

Prepare the Isolated Laboratory Environment

  • Create an isolated cybersecurity laboratory using VirtualBox.
  • Configure Ubuntu as the web-server and machine-learning environment.
  • Configure Kali Linux as the controlled security-testing system.
  • Establish a private laboratory network between the virtual machines.
  • Verify that the Ubuntu server and Kali Linux can communicate through the intended network interface.
  • Ensure that the testing environment does not expose the intentionally tested service to the public internet.
  • Record the initial laboratory network configuration.
Tools: VirtualBox + Ubuntu Linux + Kali Linux
STEP 02

Deploy the Nginx Web Server

  • Install and configure Nginx on the Ubuntu virtual machine.
  • Start the Nginx service and verify that it is running correctly.
  • Create or configure a simple test webpage for validating legitimate HTTP requests.
  • Access the webpage locally and from the authorized Kali testing system.
  • Verify that the server responds correctly to normal requests.
  • Record the Nginx configuration and service status.
Tools: Nginx + Ubuntu Linux + cURL
STEP 03

Establish the Normal Web-Service Baseline

  • Access the Nginx web server using an authorized laboratory client.
  • Generate legitimate HTTP requests to the test webpage.
  • Observe the HTTP response codes and response times.
  • Capture representative normal network traffic.
  • Verify that legitimate requests can be processed successfully.
  • Record the baseline service behavior for comparison with controlled test traffic.
Tools: Nginx + cURL + Wireshark
STEP 04

Identify and Validate the Server's Network Exposure

  • Identify the Ubuntu server's laboratory IP address.
  • Perform controlled service discovery against the designated laboratory host.
  • Identify the Nginx service port and verify its reachability from Kali Linux.
  • Confirm that only the intended services are exposed within the laboratory network.
  • Record the results of the service discovery process.
  • Verify that the server is not unintentionally exposed through an external network interface.
Tools: Nmap + Kali Linux + Ubuntu Linux
STEP 05

Obtain the Public DDoS Traffic Dataset

  • Obtain an existing public DDoS traffic dataset for the machine-learning experiment.
  • Load the available traffic records into the Python environment.
  • Review the dataset fields, traffic labels, and available network flow characteristics.
  • Identify the features required for normal-versus-DDoS classification.
  • Preserve the original data before preprocessing.
  • Verify that the dataset contains suitable labelled records for the planned experiment.
Tools: Python + Pandas
STEP 06

Select Normal and DDoS Traffic Records

  • Review the available traffic labels and select records representing normal traffic and DDoS-related activity.
  • Separate the records according to the selected classification objective.
  • Check for missing labels, duplicate records, and inconsistencies.
  • Preserve the class labels required for supervised learning.
  • Separate the data into training, validation, and testing subsets.
  • Where feasible, avoid leakage between subsets by considering how related flows or capture sessions are distributed.
  • Record the selection criteria and the number of records retained.
Tools: Python + Pandas + NumPy
STEP 07

Preprocess the Traffic Data

  • Clean the selected traffic records before machine-learning processing.
  • Handle missing or invalid feature values.
  • Review numerical feature ranges and identify inconsistent records.
  • Remove irrelevant identifiers or fields that could introduce data leakage.
  • Apply appropriate transformations to the selected features.
  • Fit preprocessing operations using the training data and apply the same transformations to the validation and testing data.
  • Preserve the preprocessing configuration for later use.
Tools: Python + Pandas + NumPy
STEP 08

Extract and Prepare Traffic Features

  • Identify network traffic characteristics suitable for DDoS classification.
  • Depending on the available dataset fields, features may include packet counts, flow duration, byte counts, packet lengths, and packet-rate statistics.
  • Select the numerical features required by the 1D CNN.
  • Arrange the features into the input representation expected by the model.
  • Apply consistent feature ordering and any required numerical scaling.
  • Ensure that the input structure used during evaluation matches the structure used during training.
  • Preserve the feature definitions and processing configuration.
Tools: Python + Pandas + NumPy
STEP 09

Develop and Train the 1D CNN Model

  • Configure the 1D CNN architecture using TensorFlow/Keras.
  • Prepare the training features and corresponding traffic labels.
  • Train the model to classify normal and DDoS-related traffic.
  • Use the validation subset to monitor model performance and tune appropriate parameters.
  • Evaluate whether the model learns useful traffic patterns without relying on data leakage.
  • Preserve the trained model and its configuration.
  • Record the training parameters and evaluation results.
Tools: Python + TensorFlow/Keras + NumPy
STEP 10

Evaluate the Trained Detection Model

  • Evaluate the trained model using the held-out testing subset.
  • Generate traffic-classification predictions.
  • Calculate precision, recall, F1-score, and false-positive rate.
  • Review the confusion matrix to identify correct detections and classification errors.
  • Measure inference time to understand the computational cost of individual predictions or batches.
  • Examine whether performance differs between the normal and DDoS traffic classes.
  • Record the evaluation results before proceeding to laboratory validation.
Tools: Python + TensorFlow/Keras + Scikit-learn + Matplotlib
STEP 11

Establish the Laboratory Traffic-Monitoring Workflow

  • Configure traffic capture on the authorized laboratory network interface.
  • Generate legitimate requests to the Nginx web server.
  • Capture the corresponding network traffic.
  • Identify which captured traffic characteristics can be extracted consistently with the features used by the trained model.
  • Determine whether the required features are available directly from packets or require flow-level processing.
  • Configure the processing workflow to produce compatible model inputs.
  • Verify that normal laboratory traffic can be processed without feature-order or data-format errors.
Tools: tcpdump + Wireshark + Python + Ubuntu Linux
STEP 12

Validate Normal Traffic Classification

  • Generate legitimate HTTP requests against the Nginx web server.
  • Capture and process the associated network traffic.
  • Extract the features supported by the laboratory capture workflow.
  • Transform the features using the preprocessing configuration established during training.
  • Provide compatible features to the trained 1D CNN model.
  • Review the predicted traffic classes.
  • Record whether legitimate laboratory traffic is classified correctly or produces false-positive results.
Tools: Nginx + cURL + tcpdump + Python + TensorFlow/Keras
STEP 13

Perform Controlled DDoS Traffic Testing

  • Prepare a controlled traffic-generation test within the isolated laboratory.
  • Use only the designated Nginx server as the target.
  • Generate bounded test traffic using an authorized testing method, with conservative limits appropriate to the available virtual-machine resources.
  • Observe the server's response behavior and resource utilization.
  • Capture the resulting network traffic for analysis.
  • Keep the test duration and traffic volume within the laboratory's safe operating limits.
  • Preserve the captured traffic and test configuration for evaluation.
Tools: Kali Linux + Ubuntu Linux + Nginx + Wireshark
STEP 14

Capture and Extract Features from Test Traffic

  • Review the traffic captured during the controlled test.
  • Identify the available packet-level or flow-level characteristics required by the model.
  • Apply the same feature definitions used during model development wherever the captured data supports them.
  • Transform the captured traffic into the numerical input representation expected by the 1D CNN.
  • Check for missing features and incompatible data structures.
  • Record the feature-extraction limitations, particularly if the public dataset contains flow statistics that cannot be obtained directly from raw packets without additional processing.
  • Preserve the processed traffic features for classification.
Tools: tcpdump + Wireshark + Python + Pandas + NumPy
STEP 15

Perform DDoS Traffic Classification

  • Provide the processed test-traffic features to the trained 1D CNN model.
  • Generate traffic-classification predictions.
  • Record the model output and inference time.
  • Compare the predictions with the known controlled testing scenario.
  • Review whether the model identifies the tested traffic as DDoS-related or normal.
  • Record classification errors and cases where the result is inconclusive.
  • Do not assume that a high traffic volume alone proves a DDoS attack.
Tools: Python + TensorFlow/Keras + NumPy
STEP 16

Implement Controlled Mitigation

  • Configure a predefined mitigation mechanism for the isolated Nginx server.
  • Connect the detection decision to a controlled response procedure.
  • Apply a restricted firewall rule or rate-limiting configuration when the predefined detection criteria are satisfied.
  • Ensure that the response is restricted to the laboratory environment and that the mitigation mechanism does not unintentionally block unrelated systems.
  • Verify that the action is applied as intended.
  • Maintain a safe recovery procedure for removing the test restrictions after validation.
Tools: Ubuntu Linux + Linux Firewall + Nginx
STEP 17

Validate Mitigation and Legitimate Service Availability

  • Repeat the controlled test under the documented laboratory conditions.
  • Observe the detection result and the mitigation action.
  • Measure the server's response behavior before and after mitigation.
  • Send legitimate HTTP requests during the evaluation to determine whether the web service remains accessible.
  • Record the effect on test traffic and legitimate requests.
  • Check for false-positive mitigation actions and any unintended service disruption.
  • Document the effectiveness and limitations of the implemented response mechanism.
Tools: Nginx + cURL + Python + Linux Firewall + Matplotlib
STEP 18

Perform Final Detection and Mitigation Evaluation

  • Review the model's held-out testing results.
  • Review the predictions generated from captured laboratory traffic.
  • Compare normal and controlled test traffic classification results.
  • Review inference time and the practical requirements of the traffic-processing workflow.
  • Evaluate whether the mitigation mechanism responds correctly to the configured detection criteria.
  • Compare service behavior before and after mitigation.
  • Document false positives, missed detections, feature-extraction limitations, and resource constraints.
  • Preserve the model configuration, captured traffic evidence, evaluation metrics, and mitigation results.
  • Finalize the DDoS detection and mitigation assessment.
Tools: Python + TensorFlow/Keras + Scikit-learn + Nginx + Wireshark + Linux Firewall + Matplotlib

Outcome

An isolated cybersecurity laboratory is established using VirtualBox, Ubuntu Linux, and Kali Linux, providing a controlled environment for evaluating DDoS detection and mitigation against an Nginx web server.

The Nginx web server is deployed and validated within the laboratory, establishing a functioning web service for legitimate request processing and controlled traffic testing.

An existing public DDoS traffic dataset is processed to select labelled normal and DDoS-related traffic records, providing the data required for supervised deep-learning model development without manually creating the training dataset.

The selected traffic records are preprocessed and converted into numerical features compatible with a 1D CNN, establishing a consistent representation for model training and evaluation.

A 1D CNN model is trained using the selected labelled traffic records and evaluated against held-out data to measure classification performance, including precision, recall, F1-score, false-positive rate, and inference time.

Normal Nginx traffic and controlled laboratory test traffic are captured and processed to evaluate the practical compatibility of the traffic-analysis workflow with the trained model.

The trained model generates traffic-classification predictions for compatible captured traffic, allowing the experiment to assess whether the controlled test traffic is identified as DdoS-related.

A controlled mitigation mechanism is implemented using appropriate Linux firewall or rate-limiting controls, connecting the detection workflow to a testable response action within the isolated laboratory.

The effect of mitigation is evaluated by examining the handling of controlled test traffic and the availability of legitimate HTTP requests, providing evidence of both mitigation behavior and potential false-positive impact.

The complete workflow of public traffic-data processing, 1D CNN training, network traffic capture, DDoS classification, inference-time evaluation, controlled mitigation, service-availability validation, and final security assessment is demonstrated within the authorized laboratory environment.