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

Explainable AI-Based Investigation of Distributed Denial-of-Service Attacks Against an Apache HTTP Server on Ubuntu Using HistGradientBoosting and SHAP

Description

Web servers provide websites, web applications, APIs, and other online services by processing HTTP requests received from clients. These requests generate network traffic with measurable characteristics, including flow duration, packet counts, byte counts, packet lengths, and traffic rates. Analyzing these characteristics can help security teams investigate abnormal network activity and identify potential Distributed Denial-of-Service (DDoS) attacks.

DDoS attacks attempt to disrupt service availability by generating excessive traffic from multiple sources or distributed systems. Such activity may consume network bandwidth, connection capacity, CPU resources, or other server resources, potentially affecting legitimate users. Identifying suspicious traffic is an important part of DDoS investigation, but a classification result alone does not explain why a particular traffic observation was considered malicious.

Traditional detection approaches may use fixed thresholds, predefined signatures, or known attack patterns. Machine-learning classifiers can analyze multiple traffic characteristics to distinguish normal traffic from DDoS-related activity. However, complex classification models may provide limited information about which features influenced a particular prediction.

Explainable Artificial Intelligence (XAI) addresses this limitation by providing explanations for machine-learning predictions. In this use case, HistGradientBoostingClassifier is used to classify network traffic, while SHAP (SHapley Additive exPlanations) is used to explain the features influencing the model's predictions.

An Apache HTTP Server is deployed on Ubuntu within an isolated laboratory environment. Kali Linux is used as the controlled security-testing system, and VirtualBox provides the virtualized environment for the application and testing systems.

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

The HistGradientBoostingClassifier model is trained using the selected labelled traffic records. After model evaluation, SHAP is applied to explain the classification results by identifying features that contribute to individual predictions and by summarizing influential features across the evaluated traffic population.

During practical validation, legitimate and controlled test traffic associated with the Apache web server is captured and analyzed. The trained classifier evaluates compatible traffic features, and SHAP explanations are generated to support the investigation of selected predictions. The resulting explanations are reviewed against the known laboratory test scenario to assess their usefulness and limitations.

The primary objective is to build a practical DDoS investigation workflow that combines traffic classification with interpretable model explanations. The project focuses on explaining detection decisions rather than automatically blocking traffic.

The complete explainable investigation workflow is:

Public DDoS Traffic Dataset → Data Preprocessing → Traffic Feature Extraction → HistGradientBoosting Training → Model Evaluation → Apache HTTP Server on Ubuntu → Network Traffic Capture → Feature Extraction → Traffic Classification → SHAP Explanation → Influential Feature Identification → Investigation Report → Controlled Laboratory Validation

Existing Security Problem

Service: Apache HTTP Server on Ubuntu

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

The service is deployed within an isolated laboratory environment to support legitimate traffic generation, controlled security testing, traffic capture, and investigation of model predictions.

Existing Problem :

A web server can experience availability problems when excessive network traffic consumes its available resources. DDoS-related traffic may exhibit characteristics that differ from legitimate usage, but distinguishing malicious activity from normal traffic can be difficult when traffic patterns overlap.

Machine-learning classifiers can help identify traffic patterns associated with known DDoS activity. However, investigators also need to understand which features influenced a prediction to review suspicious traffic, examine possible false positives, and assess whether the model's decision is supported by the observed traffic characteristics.

Without an explanation mechanism, a classifier's output may provide a label without sufficient information for investigating the reasons behind that prediction.

The security problem is:
Apache HTTP Server on Ubuntu
→
Normal HTTP Request Activity
→
Incoming Network Traffic
→
Potential DDoS Traffic
→
Machine-Learning Classification
→
Suspicious Traffic Prediction
→
Limited Explanation of the Prediction
→
Investigation and Interpretation Requirement

The proposed solution uses HistGradientBoostingClassifier to classify normal and DDoS-related traffic using features extracted from an existing public traffic dataset. SHAP is then applied to explain the model's predictions and identify the traffic features that influence individual classification results.

Attack

Specific Attack: Controlled Distributed Denial-of-Service Traffic Test Against an Apache HTTP Server

The controlled attack scenario evaluates whether the trained HistGradientBoostingClassifier can identify traffic associated with a controlled DDoS test and whether SHAP can provide useful explanations for the resulting predictions.

The test is performed only against the Apache HTTP Server deployed within the isolated laboratory. The objective is to generate controlled traffic for security testing, capture its characteristics, and investigate how the model classifies the resulting observations.

The model is trained using an existing public DDoS traffic dataset. The controlled laboratory traffic is subsequently analyzed using the trained model and a compatible feature-extraction workflow. SHAP explanations are generated for selected predictions to identify features contributing to the model's output.

The experiment does not assume that every controlled test request will be classified correctly. Detection results and explanations must be evaluated against the known testing scenario and the limitations of the available traffic features.

Attack Behavior :
Authorized Laboratory Client
→
Apache HTTP Server on Ubuntu
→
Normal HTTP Request Activity
→
Controlled High-Volume Traffic Test
→
Network Traffic Capture
→
Traffic Feature Extraction
→
HistGradientBoosting Classification
→
Potential DDoS Traffic Identification
→
SHAP-Based Prediction Explanation
→
Influential Feature Identification
→
Investigation of Classification Results
→
Controlled Attack Validation

Security Concept

Explainable AI-Based DDoS Traffic Classification and Investigation

The primary security concept is Explainable Artificial Intelligence combined with machine-learning-based network traffic classification.

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 HistGradientBoostingClassifier.

The second objective is to train and evaluate the classification model to determine how effectively it distinguishes normal traffic from DDoS-related traffic. The model is evaluated using held-out records and appropriate classification metrics.

The third objective is to explain the model's predictions using SHAP. Global explanations are used to examine features that influence predictions across a population of traffic records. Local explanations are used to investigate individual observations classified as normal or DdoS-related.

The resulting explanations help an investigator understand the model's reasoning in terms of its input features. They do not independently prove that an attack occurred or establish causation. The explanations must be interpreted alongside traffic evidence, ground-truth labels, and the limitations of the model.

The assessment follows:
Public DDoS Traffic Data Review
→
Normal and DDoS Traffic Selection
→
Data Preprocessing
→
Traffic Feature Extraction
→
HistGradientBoosting Model Training
→
Model Performance Evaluation
→
Apache HTTP Server Deployment
→
Controlled Traffic Testing
→
Network Traffic Capture
→
Traffic Classification
→
SHAP Explanation Generation
→
Influential Feature Identification
→
DDoS Investigation Report
→
Final Security Validation

Defensive Mechanism

The security concept defines the overall investigation strategy.

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

Traffic Classification Using HistGradientBoosting :

HistGradientBoostingClassifier learns patterns from labelled traffic features and classifies traffic observations as normal or DdoS-related.

Purpose: Classify network traffic using learned relationships between the selected traffic features and their labels.

Consistent Traffic Feature Extraction

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

Purpose
  • Ensure that model inputs remain consistent across training and investigation.

Global SHAP Explanation

Global SHAP analysis summarizes how traffic features influence the model's predictions across the evaluated dataset.

Purpose
  • Identify influential traffic features that help explain the model's overall classification behavior.

Local SHAP Explanation

Local SHAP analysis explains how individual input features contribute to a selected traffic observation's prediction.

Purpose
  • Support investigation of individual traffic observations classified as potentially malicious or normal.

Traffic Evidence Correlation

Model predictions and SHAP explanations are reviewed alongside captured traffic, available labels, and the known controlled testing scenario.

Purpose
  • Determine whether the classification and its explanation are consistent with the available security evidence.

Classification Performance Evaluation

The model is evaluated using appropriate classification metrics, including precision, recall, F1-score, and false-positive rate.

Purpose
  • Measure the classification performance and identify detection limitations that may affect investigation.

Security Tools

Target Web Server: Apache HTTP Server

Apache HTTP Server provides the web-server service used to evaluate network traffic classification and explainable investigation.

Purpose
  • Host the laboratory web service.
  • Receive legitimate HTTP requests.
  • Provide a target for controlled traffic testing.
  • Support validation of captured traffic.

Operating System: Ubuntu Linux

Ubuntu provides the environment for hosting Apache HTTP Server and executing the traffic-analysis workflow.

Purpose
  • Host the Apache web server.
  • Execute the Python investigation workflow.
  • Support local security experimentation.

Security Testing Platform: Kali Linux

Kali Linux provides the controlled testing environment used to generate authorized test traffic and inspect the target service.

Purpose
  • Perform authorized network testing.
  • Generate controlled HTTP requests.
  • Validate web-server reachability and response behavior.

Virtualization Platform: VirtualBox

VirtualBox provides the isolated virtual environment used to host Ubuntu and Kali Linux.

Purpose
  • Host 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 training, prediction generation, explanation analysis, and evaluation.

Purpose
  • Implement the machine-learning workflow.
  • Process network traffic features.
  • Generate classification predictions.
  • Analyze investigation results.

Machine-Learning Library: Scikit-learn

Scikit-learn provides the HistGradientBoostingClassifier implementation used for traffic classification.

Purpose
  • Configure and train the classification model.
  • Generate traffic predictions.
  • Evaluate classification performance.

Explainable AI Tool: SHAP

SHAP provides feature-contribution explanations for the trained classification model.

Purpose
  • Generate global feature-importance explanations.
  • Explain individual classification predictions.
  • Support investigation of model decisions.

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 model input features.

Numerical Processing Tool: NumPy

NumPy supports numerical transformations required for feature preparation and model processing.

Purpose
  • Perform numerical feature operations.
  • Prepare model inputs.
  • Support efficient numerical processing.

Network Traffic Analysis Tool: Wireshark

Wireshark is used to inspect captured network communication during controlled laboratory testing.

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

Network Traffic Capture Tool: tcpdump

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

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

Network Discovery Tool: Nmap

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

Purpose
  • Discover reachable services.
  • Validate the intended service exposure.
  • Record the laboratory network configuration.

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 classification performance and SHAP analysis results.

Purpose
  • Visualize classification metrics.
  • Present global feature-importance results.
  • Display individual prediction explanations.
  • Support investigation reporting.

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 private laboratory network communication between the virtual machines.
  • Verify that the Ubuntu server is reachable from Kali Linux through the intended network interface.
  • Ensure that all testing remains restricted to the authorized laboratory.
  • Record the initial network configuration.
Tools: VirtualBox + Ubuntu Linux + Kali Linux
STEP 02

Deploy the Apache HTTP Server

  • Install and configure Apache HTTP Server on the Ubuntu virtual machine.
  • Start the Apache service and verify that it is running correctly.
  • 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 service configuration and initial response behavior.
Tools: Apache HTTP Server + Ubuntu Linux + cURL
STEP 03

Establish the Normal Web-Service Baseline

  • Access the Apache 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 are processed successfully.
  • Record the baseline service behavior for comparison with controlled test traffic.
Tools: Apache HTTP Server + 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 Apache service port and verify its reachability from Kali Linux.
  • Confirm that only the intended services are exposed within the laboratory network.
  • Record the service-discovery results.
  • Verify that the web server is not unintentionally exposed to external networks.
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 available fields, traffic labels, and 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 and DDoS-related activity.
  • Separate the records according to the selected classification objective.
  • Check for missing labels, duplicate records, and inconsistent values.
  • Preserve the class labels required for supervised learning.
  • Divide the records into training, validation, and testing subsets.
  • Where feasible, reduce data leakage by separating related flows or capture sessions across the subsets.
  • 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 fields available in the dataset, features may include flow duration, packet counts, byte counts, packet lengths, and traffic-rate statistics.
  • Select the numerical features required by HistGradientBoostingClassifier.
  • Maintain consistent feature names, ordering, and data types.
  • Prepare the feature matrix and corresponding class labels.
  • Ensure that the model input features remain compatible with the later SHAP explanation workflow.
  • Preserve the feature definitions and preprocessing configuration.
Tools: Python + Pandas + NumPy
STEP 09

Train the HistGradientBoosting Classification Model

  • Configure HistGradientBoostingClassifier using Scikit-learn.
  • Provide the processed training features and corresponding traffic labels.
  • Train the model to classify normal and DDoS-related traffic.
  • Use the validation subset to assess performance and tune appropriate model parameters.
  • Review whether the model learns useful traffic patterns without relying on data leakage.
  • Preserve the trained model and its configuration.
  • Record the training parameters and validation results.
Tools: Python + Scikit-learn + NumPy
STEP 10

Evaluate the Trained Classification 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 classifications and errors.
  • Examine whether the model identifies both normal and DDoS-related traffic adequately.
  • Review classification errors and potential effects of class imbalance.
  • Record the evaluation results before proceeding to explainability analysis.
Tools: Python + Scikit-learn + Matplotlib
STEP 11

Configure the SHAP Explanation Workflow

  • Configure SHAP to explain predictions generated by the trained HistGradientBoostingClassifier.
  • Verify that the selected SHAP explainer supports the installed model implementation and library versions.
  • Select an appropriate explainer and representative background data where required.
  • Prepare the feature data in a format compatible with the selected explanation method.
  • Verify that the explanation output corresponds to the model's predictions.
  • If the selected explainer does not support the model directly, configure a compatible model-agnostic SHAP explainer and evaluate its computational requirements.
  • Preserve the explanation configuration for subsequent analysis.
Tools: Python + SHAP + Scikit-learn + Pandas
STEP 12

Generate Global Feature Explanations

  • Apply SHAP to a representative set of evaluated traffic records.
  • Calculate feature contributions using the selected explainer.
  • Aggregate the explanations to identify features that have a substantial influence on the model's predictions.
  • Generate global feature-importance visualizations.
  • Review whether the influential features are consistent with the available traffic characteristics and dataset labels.
  • Document the overall explanation results and their limitations.
  • Do not interpret feature importance as proof that a particular feature causes a DDoS attack.
Tools: Python + SHAP + Matplotlib
STEP 13

Generate Local Explanations for Selected Traffic Records

  • Select individual traffic records classified as normal or DdoS-related.
  • Generate SHAP explanations for the selected observations.
  • Review the contribution of each feature to the corresponding prediction.
  • Identify features that increase or decrease the model's output for the relevant class.
  • Compare the explanations for selected normal and DDoS-related observations.
  • Preserve the prediction, input features, and explanation results for investigation.
Tools: Python + SHAP + Pandas + Matplotlib
STEP 14

Establish the Laboratory Traffic-Monitoring Workflow

  • Configure traffic capture on the authorized laboratory network interface.
  • Generate legitimate requests to the Apache HTTP Server.
  • Capture the associated network traffic.
  • Identify the traffic characteristics that can be extracted consistently with the model's training features.
  • Determine whether the required features can be obtained 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 15

Perform Controlled Traffic Testing and Classification

  • Prepare a controlled traffic test within the isolated laboratory.
  • Use the designated Apache server as the only target.
  • Generate bounded test traffic using an authorized testing method and conservative limits appropriate to the available virtual-machine resources.
  • Observe the server's response behavior and capture the resulting network traffic.
  • Extract the traffic features supported by the laboratory capture workflow.
  • Apply the established preprocessing procedure and provide compatible features to the trained classifier.
  • Record the predictions and compare them with the known laboratory test scenario.
Tools: Kali Linux + Apache HTTP Server + tcpdump + Wireshark + Python + Scikit-learn
STEP 16

Explain the Laboratory Traffic Predictions

  • Select representative traffic observations from the controlled laboratory test.
  • Apply the established SHAP explanation workflow to the selected observations.
  • Review which features contribute to each model prediction.
  • Compare the explanations with those generated for representative normal and DDoS-related records from the public dataset.
  • Identify similarities and differences in the model's reasoning across the observations.
  • Record whether the explanations are consistent with the observed traffic characteristics.
  • Document any limitations caused by differences between the public dataset and the laboratory traffic.
Tools: Python + SHAP + Scikit-learn + Matplotlib
STEP 17

Correlate the Explanations with Security Evidence

  • Review the model predictions and their corresponding SHAP explanations.
  • Compare the explanations with the available dataset labels and known laboratory test conditions.
  • Identify the features that contributed to predictions classified as DdoS-related.
  • Examine false positives and missed detections to determine whether the explanations help identify possible classification weaknesses.
  • Review the captured traffic and server responses to support the investigation.
  • Prepare an investigation report containing the relevant predictions, influential features, and limitations.
  • Do not treat SHAP explanations alone as proof of malicious intent or attack causation.
Tools: Python + SHAP + Scikit-learn + Wireshark + Matplotlib
STEP 18

Perform Final Explainable AI Evaluation

  • Review the classification results obtained from the held-out testing data.
  • Review the global and local SHAP explanations.
  • Compare normal and DDoS-related traffic predictions and their associated feature contributions.
  • Evaluate the usefulness of the explanations for investigating individual traffic observations.
  • Review false positives, missed detections, and differences between public dataset traffic and captured laboratory traffic.
  • Record the model configuration, explanation configuration, performance metrics, and investigation findings.
  • Document residual limitations, including explainer compatibility, computational overhead, and the limitations of the selected features.
  • Finalize the explainable DDoS investigation assessment.
Tools: Python + Scikit-learn + SHAP + Pandas + NumPy + Matplotlib + Apache HTTP Server + Wireshark

Outcome

An isolated cybersecurity laboratory is established using VirtualBox, Ubuntu Linux, and Kali Linux, providing a controlled environment for investigating DDoS-related traffic against an Apache HTTP Server.

The Apache HTTP Server is deployed and validated within the laboratory, establishing a functioning web service for legitimate HTTP requests and controlled security testing.

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

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

A HistGradientBoostingClassifier model is trained and evaluated using held-out data. Classification metrics, including precision, recall, F1-score, and false-positive rate, are recorded to assess its ability to distinguish normal and DDoS-related traffic.

SHAP is integrated with the trained classification model using a compatible explanation method, enabling the analysis of feature contributions associated with the model's predictions.

Global SHAP explanations are generated to identify influential traffic features across the evaluated observations, providing an overview of the characteristics that affect the model's classification behavior.

Local SHAP explanations are generated for selected traffic observations, helping investigators examine why individual records received particular predictions and compare the model's reasoning across normal and DDoS-related traffic.

Captured laboratory traffic is processed and evaluated using the established classification and explanation workflow. The results are correlated with the known test conditions and available traffic evidence to examine false positives, missed detections, and explanation limitations.

The complete workflow of public traffic-data processing, HistGradientBoosting model training, classification evaluation, SHAP-based global and local explanations, controlled Apache server testing, traffic evidence correlation, and final security investigation is demonstrated within the authorized laboratory environment.