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

Transformer-Based Detection of SSH Reconnaissance and Intrusion Attacks Against Ubuntu OpenSSH Server

Description

Network services exposed through network interfaces are frequently targeted by reconnaissance and intrusion activities. Attackers may first identify accessible services and communication endpoints before attempting unauthorized access or other malicious activity.

OpenSSH Server provides secure remote-access functionality through the SSH protocol and is commonly deployed on Linux systems. Because SSH is a network-accessible service, its traffic can contain observable patterns associated with normal remote administration, reconnaissance, repeated connection attempts, and intrusion-related activity.

Traditional network intrusion detection approaches may rely on fixed signatures, manually defined rules, or predefined traffic characteristics. Such approaches may have difficulty identifying complex traffic patterns when the relationship between multiple network features is not represented effectively.

In this use case, an Ubuntu Linux virtual machine is configured with an OpenSSH Server as the controlled target service. A separate Kali Linux virtual machine is used as the authorized security-testing environment. Both systems operate inside an isolated VirtualBox laboratory.

A public network intrusion dataset is used for machine-learning model development. The dataset contains normal network traffic and multiple categories of malicious network activity. The network-flow information is processed to construct the feature representation required for Transformer-based intrusion classification.

The Transformer algorithm is trained to identify relationships between network-traffic features and intrusion classifications. The trained model is evaluated using independent testing data before being used in the controlled laboratory environment.

After model validation, legitimate SSH activity and controlled reconnaissance or intrusion-related traffic are generated against the Ubuntu OpenSSH Server.

The resulting network traffic is captured and processed using the same feature-processing workflow used during model development. The Transformer model then analyzes the observed traffic and generates an intrusion classification.

The predicted classification is compared with the known controlled attack activity to determine whether the Transformer-based detection workflow successfully identifies SSH reconnaissance and intrusion behavior.

The complete security-validation workflow is:
Public Network Intrusion Dataset
→
Network Traffic Preprocessing
→
Feature Engineering
→
Transformer Model Training
→
Model Validation
→
Ubuntu OpenSSH Server
→
Legitimate SSH Activity
→
Controlled SSH Reconnaissance and Intrusion Testing
→
Network Traffic Capture
→
Feature Extraction
→
Transformer Prediction
→
Intrusion Detection
→
Detection Validation

Existing Security Problem

Service: Ubuntu OpenSSH Server

Ubuntu OpenSSH Server is the specific network service targeted in this use case.

OpenSSH Server provides SSH-based remote access to the Ubuntu laboratory system. The service operates through the SSH protocol and provides a controlled target for observing legitimate and security-testing network activity.

The service is deployed only inside the isolated cybersecurity laboratory and is not exposed to production users or external systems.

Existing Problem :

An OpenSSH Server may receive different types of network activity, including legitimate administrative connections, service discovery, repeated connection attempts, and intrusion-related traffic.

Network reconnaissance may identify the SSH service before an attacker attempts further activity. Repeated or abnormal SSH connection patterns can therefore represent useful indicators for network intrusion detection.

When network traffic is analyzed without considering relationships between multiple traffic features, some abnormal patterns may not be identified effectively.

The security problem is:
Ubuntu OpenSSH Server
→
Incoming Network Connections
→
SSH Network Traffic
→
Legitimate and Abnormal Traffic Patterns
→
Reconnaissance Activity
→
Intrusion-Related Traffic
→
Complex Network Feature Relationships
→
Potential Detection Difficulty
→
Delayed Intrusion Identification
→
Unauthorized Access Risk

The proposed solution introduces public network-traffic processing, Transformer-based feature learning, model validation, controlled SSH reconnaissance and intrusion testing, runtime traffic capture, Transformer-based classification, and final detection validation.

Attack

Specific Attack: SSH Reconnaissance and Intrusion Attack

The controlled attack scenario evaluates whether network activity associated with reconnaissance and intrusion attempts against the Ubuntu OpenSSH Server can be identified by the trained Transformer model.

The attack is performed only against the authorized Ubuntu laboratory server from the Kali Linux security-testing environment.

The reconnaissance stage is used to generate controlled network activity associated with identifying the SSH service and its availability. The subsequent intrusion-testing stage generates authorized abnormal SSH activity against the same laboratory service.

The objective is to determine whether the network-traffic characteristics generated during the controlled activity can be distinguished from legitimate SSH communication by the Transformer-based intrusion-detection workflow.

Attack Behavior :
Controlled Kali Linux Testing Environment
→
Target Identification
→
SSH Service Discovery
→
Controlled SSH Reconnaissance
→
Network Connection Generation
→
Controlled Intrusion Testing
→
SSH Traffic Generation
→
Network Traffic Capture
→
Traffic Feature Extraction
→
Transformer-Based Analysis
→
Intrusion Classification
→
Detection Result
→
Attack Validation

Security Concept

Transformer-Based Network Intrusion Classification

The primary security concept is machine-learning-based network intrusion classification using a Transformer architecture.

The network-traffic dataset is first converted into structured feature representations. The Transformer model learns relationships between the network-traffic features and the corresponding traffic classifications during the training stage.

The trained model is subsequently applied to traffic generated within the controlled OpenSSH laboratory environment.

The runtime network traffic is captured, processed into the required feature representation, and provided to the trained Transformer model.

The assessment follows:
Public Network Intrusion Dataset
→
Network Traffic Preprocessing
→
Feature Engineering
→
Network Feature Representation
→
Transformer Model Training
→
Model Validation
→
Ubuntu OpenSSH Server
→
Legitimate SSH Traffic
→
Controlled SSH Reconnaissance
→
Controlled Intrusion Testing
→
Runtime Network Traffic Capture
→
Feature Extraction
→
Transformer Classification
→
Intrusion Detection
→
Security Validation

Defensive Mechanism

The security concept defines the overall security strategy.

The following are the specific defensive mechanisms implemented.

Network Traffic Feature Monitoring :

Network traffic associated with the OpenSSH Server is monitored through structured traffic features that represent connection and communication behavior.

Purpose: Identify network-traffic characteristics associated with normal and abnormal SSH activity.

Transformer-Based Traffic Classification

The Transformer model analyzes the processed network-traffic representation and learns relationships between traffic features and intrusion classifications.

Purpose
  • Classify network traffic according to learned intrusion characteristics.

SSH Reconnaissance Detection

Controlled reconnaissance activity against the OpenSSH Server is captured and analyzed to determine whether the resulting network behavior can be distinguished from legitimate SSH communication.

Purpose
  • Identify reconnaissance-related network activity targeting the SSH service.

Intrusion Behavior Identification

The trained Transformer model evaluates network traffic associated with controlled intrusion testing and determines whether the observed behavior corresponds to an intrusion category.

Purpose
  • Identify intrusion-related SSH traffic from observed network behavior.

Runtime Traffic Analysis

Network traffic generated during the controlled laboratory attack is processed using the same feature-processing workflow used during model training.

Purpose
  • Apply the trained intrusion-detection model to runtime network traffic.

Post-Detection Security Validation

The Transformer classification result is correlated with the known attack activity and captured network evidence.

Purpose
  • Confirm the correctness and practical relevance of the intrusion-detection result.

Security Tools

Primary Target Network Service: OpenSSH Server

OpenSSH Server provides the controlled SSH service running on the Ubuntu laboratory system.

Purpose
  • Provide the target network service.
  • Generate legitimate SSH traffic.
  • Provide the controlled target for reconnaissance and intrusion testing.

Machine-Learning Algorithm: Transformer

The Transformer is used to learn relationships between network-traffic features and intrusion classifications.

Purpose
  • Learn network-traffic patterns.
  • Classify normal and intrusion-related traffic.
  • Generate runtime intrusion predictions.

Network Intrusion Dataset: Public Network Intrusion Dataset

A public network intrusion dataset containing normal and malicious network-traffic observations is used for model development and evaluation.

Purpose
  • Provide network-traffic observations for training.
  • Provide labelled traffic for model evaluation.
  • Support supervised intrusion-classification research.

Machine-Learning Platform: Python

Python is used to implement dataset processing, feature preparation, Transformer training, prediction, and evaluation.

Purpose
  • Process network-traffic data.
  • Execute the Transformer training workflow.
  • Perform runtime classification and evaluation.

Machine-Learning Framework: PyTorch

PyTorch is used to implement and train the Transformer-based model.

Purpose
  • Construct the Transformer model.
  • Train the network-traffic classifier.
  • Generate runtime model predictions.

Data Processing Library: Pandas

Pandas is used to load, clean, organize, and transform the network-traffic dataset.

Purpose
  • Process network-flow records.
  • Organize traffic features and labels.
  • Prepare structured data for machine-learning processing.

Numerical Processing Library: NumPy

NumPy is used for numerical transformations and preparation of network-feature arrays.

Purpose
  • Perform numerical processing.
  • Prepare model input arrays.
  • Support feature transformation operations.

Network Traffic Capture Tool: Wireshark

Wireshark is used to capture and inspect network traffic generated between the Kali testing system and the Ubuntu OpenSSH Server.

Purpose
  • Capture laboratory network traffic.
  • Inspect SSH communication characteristics.
  • Provide traffic evidence for detection validation.

Network Traffic Capture Tool: tcpdump

tcpdump is used to capture network packets directly from the Ubuntu laboratory interface.

Purpose
  • Capture runtime network packets.
  • Provide packet-level traffic evidence.
  • Support controlled attack validation.

Security Testing Platform: Kali Linux

Kali Linux is used as the controlled security-testing platform for generating authorized reconnaissance and intrusion activity against the Ubuntu OpenSSH Server.

Purpose
  • Perform controlled reconnaissance testing.
  • Generate authorized SSH intrusion activity.
  • Validate the intrusion-detection workflow.

Application Platform: Ubuntu Linux

Ubuntu Linux hosts the OpenSSH Server and provides the controlled target environment.

Purpose
  • Host the target SSH service.
  • Generate legitimate SSH activity.
  • Provide the controlled environment for intrusion testing.

Virtualization Platform: VirtualBox

VirtualBox is used to create isolated Ubuntu and Kali Linux virtual machines.

Purpose
  • Create the cybersecurity laboratory.
  • Separate the target and testing environments.
  • Provide controlled network connectivity between the virtual machines.

Process

STEP 01

Prepare the Isolated Network Intrusion Detection Environment

  • Create the cybersecurity laboratory using VirtualBox.
  • Configure an Ubuntu Linux virtual machine as the target environment.
  • Configure a Kali Linux virtual machine as the controlled security-testing environment.
  • Establish isolated network connectivity between the two virtual machines.
  • Ensure that the OpenSSH Server is accessible only within the authorized laboratory network.
  • Verify that the laboratory does not expose the target service to production or external systems.
  • Prepare the environment for controlled network-traffic generation and capture.
Tools: VirtualBox + Ubuntu Linux + Kali Linux
STEP 02

Deploy the Ubuntu OpenSSH Server

  • Install and configure the OpenSSH Server on the Ubuntu target system.
  • Verify that the SSH daemon is operational.
  • Confirm that the service is listening on the expected SSH port.
  • Create a dedicated disposable laboratory account for authorized testing.
  • Configure the service according to the controlled laboratory requirements.
  • Verify legitimate SSH connectivity from the Kali testing system.
  • Record the normal SSH service configuration before attack testing.
Tools: Ubuntu Linux + OpenSSH Server
STEP 03

Establish the Legitimate SSH Traffic Baseline

  • Generate legitimate SSH connections between Kali Linux and the Ubuntu OpenSSH Server.
  • Perform normal login and session activity using the authorized laboratory account.
  • Observe connection establishment and termination behavior.
  • Capture the legitimate SSH traffic.
  • Record the normal network-flow characteristics.
  • Repeat legitimate activity to obtain representative baseline observations.
  • Preserve the baseline traffic for comparison with controlled attack traffic.
  • Verify that the baseline does not contain attack activity.
Tools: Kali Linux + OpenSSH + Wireshark + tcpdump
STEP 04

Prepare the Public Network Intrusion Dataset

  • Obtain the selected public network intrusion dataset.
  • Load the dataset into the Python processing environment.
  • Inspect the available network-flow records.
  • Identify normal and intrusion-related traffic observations.
  • Review the available traffic features and classification labels.
  • Check for missing or unusable values.
  • Remove unsuitable records where necessary without manually creating replacement training data.
  • Prepare the dataset for machine-learning processing.
Tools: Python + Pandas + NumPy
STEP 05

Perform Network Traffic Data Preprocessing

  • Clean the selected network-traffic records.
  • Handle missing and inconsistent values.
  • Remove irrelevant fields that are not required for the selected model.
  • Convert categorical information into an appropriate numerical representation where required.
  • Normalize or scale numerical features according to the Transformer implementation.
  • Separate the relevant features from the classification labels.
  • Prepare the training, validation, and testing portions.
  • Ensure that testing records remain independent from model training.
Tools: Python + Pandas + NumPy
STEP 06

Construct the Transformer Input Representation

  • Select the network-traffic features required by the Transformer model.
  • Convert the processed traffic features into structured numerical input.
  • Arrange the feature representation according to the model architecture.
  • Associate each traffic representation with its corresponding classification label.
  • Prepare the input sequences or structured feature groups required by the Transformer implementation.
  • Verify that the training and testing data use the same feature structure.
  • Preserve the final representation configuration.
  • Prepare the data for Transformer training.
Tools: Python + NumPy + PyTorch
STEP 07

Train the Transformer Intrusion-Detection Model

  • Initialize the Transformer architecture.
  • Provide the prepared network-traffic representations to the model.
  • Train the model using the selected public network intrusion dataset.
  • Allow the model to learn relationships between network features and intrusion classifications.
  • Monitor training performance.
  • Validate the model using the validation portion of the dataset.
  • Adjust training parameters where required.
  • Preserve the trained model for independent evaluation and runtime testing.
Tools: PyTorch + Python
STEP 08

Evaluate the Trained Transformer Model

  • Evaluate the trained Transformer against the independent testing data.
  • Calculate classification accuracy.
  • Calculate precision for intrusion classification.
  • Calculate recall for intrusion classification.
  • Calculate F1-score.
  • Review the confusion matrix.
  • Identify correctly classified normal and intrusion observations.
  • Identify false-positive and false-negative classifications.
  • Record the final model-performance measurements before runtime attack testing.
Tools: PyTorch + Scikit-learn + Python
STEP 09

Prepare Runtime Network Traffic Monitoring

  • Configure the Ubuntu and Kali laboratory interfaces for controlled traffic capture.
  • Identify the network interface carrying the SSH communication.
  • Configure packet capture using tcpdump and Wireshark.
  • Establish the runtime traffic-processing workflow.
  • Define the process for converting captured traffic into the same feature structure used during model training.
  • Verify that legitimate SSH traffic can be captured.
  • Prepare the Transformer model for runtime prediction.
  • Confirm that runtime processing uses the same feature definitions used during model development.
Tools: tcpdump + Wireshark + Python + PyTorch
STEP 10

Validate Normal OpenSSH Activity

  • Generate legitimate SSH sessions against the Ubuntu OpenSSH Server.
  • Capture the resulting network traffic.
  • Extract the required network-flow characteristics.
  • Apply the same preprocessing procedure used during model training.
  • Convert the traffic into the Transformer input representation.
  • Provide the processed representation to the trained Transformer model.
  • Generate the classification result.
  • Confirm that legitimate SSH activity is appropriately distinguished from intrusion-related traffic.
Tools: OpenSSH + tcpdump + Wireshark + Python + Transformer
STEP 11

Prepare the Controlled SSH Reconnaissance Test

  • Prepare the Kali Linux security-testing environment.
  • Identify the authorized Ubuntu OpenSSH Server as the laboratory target.
  • Generate controlled reconnaissance activity against the SSH service.
  • Restrict the activity to the isolated laboratory network.
  • Record the start time of the reconnaissance activity.
  • Capture the resulting network traffic.
  • Ensure that the reconnaissance activity does not affect external systems.
  • Preserve the captured traffic for later detection validation.
Tools: Kali Linux + OpenSSH + tcpdump + Wireshark
STEP 12

Execute the Controlled SSH Reconnaissance Activity

  • Perform the authorized reconnaissance activity from Kali Linux against the Ubuntu OpenSSH Server.
  • Allow the controlled traffic to reach the target service.
  • Capture the generated network packets.
  • Record the attack timestamp.
  • Observe the resulting SSH-related network behavior.
  • Verify that the target is the intended laboratory OpenSSH Server.
  • Preserve the traffic capture as attack evidence.
  • Stop the reconnaissance activity after sufficient controlled traffic has been generated.
Tools: Kali Linux + tcpdump + Wireshark + OpenSSH
STEP 13

Prepare the Controlled SSH Intrusion Test

  • Prepare the second stage of the authorized security test.
  • Use only the disposable laboratory account and controlled authentication environment.
  • Generate controlled abnormal SSH connection activity.
  • Ensure that no real credentials or unauthorized systems are involved.
  • Record the expected attack behavior.
  • Start network traffic capture before the test begins.
  • Record the attack start timestamp.
  • Confirm that the activity remains restricted to the Ubuntu/Kali laboratory.
Tools: Kali Linux + OpenSSH + tcpdump
STEP 14

Execute the Controlled SSH Intrusion Activity

  • Perform the authorized SSH intrusion-testing activity from Kali Linux against the Ubuntu OpenSSH Server.
  • Generate the controlled abnormal connection behavior.
  • Allow the traffic to reach the laboratory SSH service.
  • Capture the complete network activity.
  • Record connection attempts and corresponding timestamps.
  • Observe the resulting traffic characteristics.
  • Stop the activity after the required controlled observations are obtained.
  • Preserve the traffic capture for Transformer-based detection.
Tools: Kali Linux + OpenSSH + Wireshark + tcpdump
STEP 15

Extract Runtime Network Features

  • Process the captured legitimate and controlled attack traffic.
  • Identify the network flows associated with the tested SSH activity.
  • Extract the same traffic characteristics used during model training.
  • Clean and transform the runtime observations.
  • Apply the same preprocessing procedure used for the public dataset.
  • Convert the runtime observations into the Transformer input representation.
  • Verify feature consistency between training and runtime data.
  • Preserve the processed runtime features as detection evidence.
Tools: Python + Pandas + NumPy + Wireshark
STEP 16

Perform Transformer-Based Runtime Classification

  • Provide the processed runtime network features to the trained Transformer model.
  • Generate predictions for the captured SSH traffic.
  • Identify whether each traffic observation is classified as normal or intrusion-related.
  • Record the model predictions.
  • Associate the predictions with the corresponding traffic timestamps.
  • Compare the prediction with the known controlled attack timeline.
  • Preserve the classification output for security validation.
  • Identify the traffic observations associated with detected intrusion activity.
Tools: PyTorch + Python + Transformer
STEP 17

Validate the Controlled Intrusion Detection

  • Compare the Transformer predictions with the known controlled reconnaissance and intrusion activities.
  • Review whether the model correctly identified the attack-related traffic.
  • Compare the results with the legitimate SSH baseline.
  • Identify true-positive intrusion detections
  • Review false-positive normal traffic classifications.
  • Review false-negative attack classifications.
  • Correlate packet-capture timestamps with Transformer predictions.
  • Review the traffic features associated with the detected activity.
  • Preserve the complete detection evidence.
Tools: Python + PyTorch + Wireshark + tcpdump
STEP 18

Perform Final Network Intrusion Detection Validation

  • Repeat legitimate SSH activity against the Ubuntu OpenSSH Server.
  • Repeat the controlled reconnaissance and intrusion tests using fresh laboratory traffic.
  • Capture the complete network activity.
  • Process the new traffic using the same feature-extraction workflow.
  • Apply the trained Transformer model to the fresh observations.
  • Compare the new detection results with the known attack timeline.
  • Review the model-performance measurements obtained from the public dataset and controlled laboratory testing.
  • Confirm that legitimate SSH traffic and controlled intrusion traffic are appropriately differentiated.
  • Confirm that all testing remains isolated from real users, external systems, and production services.
  • Document the complete dataset-processing, Transformer training, network-traffic capture, controlled attack simulation, runtime classification, intrusion detection, and final validation results.
Tools: Python + PyTorch + OpenSSH + Kali Linux + Ubuntu Linux + Wireshark + tcpdump

Outcome

A controlled Ubuntu Linux cybersecurity environment is successfully established with OpenSSH Server operating as the specific network target for intrusion-detection research.

A public network intrusion dataset is processed to provide normal and intrusion-related network observations for Transformer model development without manually creating the machine-learning training dataset.

The selected network-traffic features are cleaned, transformed, and converted into a structured representation suitable for Transformer-based classification.

A Transformer-based network intrusion-detection model is trained to learn relationships between network-traffic characteristics and intrusion classifications.

The trained Transformer model is evaluated using independent testing data, with classification performance measured using accuracy, precision, recall, F1-score, and confusion-matrix analysis.

A legitimate OpenSSH traffic baseline is established within the Ubuntu/Kali laboratory, providing reference traffic for comparison against controlled reconnaissance and intrusion activity.

Controlled SSH reconnaissance activity is generated from Kali Linux against the authorized Ubuntu OpenSSH Server, producing network traffic that can be captured and analyzed without targeting external or production systems.

Controlled SSH intrusion-testing activity is subsequently generated against the same OpenSSH Server, allowing the research workflow to evaluate whether the Transformer model can distinguish intrusion-related traffic from legitimate SSH communication.

The captured runtime network traffic is processed using the same feature-extraction and preprocessing workflow used during model development and is subsequently classified by the trained Transformer model.

The complete network intrusion-detection workflow comprising public-dataset processing, traffic preprocessing, Transformer training, model validation, Ubuntu OpenSSH deployment, legitimate SSH baselining, controlled reconnaissance, controlled intrusion testing, runtime traffic capture, feature extraction, Transformer classification, intrusion detection, and final security validation is successfully demonstrated.