Abstract
In today’s interconnected world, network traffic is replete with adversarial attacks. As technology evolves, these attacks are also becoming increasingly sophisticated, making them even harder to detect. Fortunately, artificial intelligence (AI) and, specifically machine learning (ML), have shown great success in fast and accurate detection, classification, and even analysis of such threats. Accordingly, there is a growing body of literature addressing how subfields of AI/ML (e.g., natural language processing (NLP)) are getting leveraged to accurately detect evasive malicious patterns in network traffic. In this paper, we delve into the current advancements in ML-based network traffic classification using image visualization. Through a rigorous experimental methodology, we first explore the process of network traffic to image conversion. Subsequently, we investigate how machine learning techniques can effectively leverage image visualization to accurately classify evasive malicious traces within network traffic. Through the utilization of production-level tools and utilities in realistic experiments, our proposed solution achieves an impressive accuracy rate of 99.48% in detecting fileless malware, which is widely regarded as one of the most elusive classes of malicious software.
Introduction
Traditional malware typically resides on a computer's hard drive, allowing standard antivirus software to detect it via file-based signatures. However, fileless malware operates as a "ghost," residing entirely in a system's RAM and hijacking legitimate, whitelisted tools like PowerShell or WMI. Because it leaves no disk footprint, it is exceptionally difficult to detect. This research addresses the challenge by focusing on communication patterns. Even invisible malware must communicate with a Command and Control (C2) server. By transforming these communication traces into grayscale images, the researchers leverage Computer Vision to identify malicious patterns that traditional scanners miss.
Methodology: Traffic to Image Conversion
The researchers developed a multi-stage pipeline to convert raw network data into a visual format suitable for deep learning:
- Conversion: Network payloads (specifically Cobalt Strike beacons) were captured, decoded from Base64, and converted into ASCII values.
- Spatial Mapping: These values were mapped into a 1D array and reshaped into a 64x64 grayscale image. Each pixel's intensity (0–255) represents a specific byte in the network traffic.
- CNN Architecture: A custom Convolutional Neural Network (CNN) was designed with three convolutional layers, batch normalization, Maxpooling, and a dropout rate of 0.4 to prevent overfitting. A final Softmax layer classifies the image as Benign or Malicious.
Experimental Setup and Datasets
The study utilized a combination of production-level and simulated data:
- Malicious Data: 6,271 sessions of Cobalt Strike beacons, upsampled to 188,130 via a "header shuffling" technique to handle data scarcity.
- Benign Data: Over 3.6 million sessions of enterprise network traffic from Palo Alto Networks, undersampled to 567,620 sessions for balance.
- Evaluation Set: A separate test set included 859,885 benign request headers from top Alexa websites and 5,321 malicious samples from known APT profiles.
Key Insights: The "Texture" of Malware
A central finding of this research is that related malware families exhibit strong visual similarities when plotted as images. Distinct sections of binary code or network payloads translate into unique image textures.
By treating network communication as a visual pattern-recognition task, the CNN can automatically learn spatial hierarchies directly from raw bytes, bypassing the need for manual feature engineering (e.g., packet length or port numbers). Furthermore, the researchers demonstrated that shuffling HTTP header fields is a valid data augmentation strategy, as it creates functional variations without altering the malware's underlying signature.
Results and Performance
The proposed model achieved state-of-the-art performance:
- Accuracy: 99.48%
- False Positive Rate (FPR): 0.14%, crucial for minimizing alert fatigue in Security Operations Centers (SOCs).
- Recall (TPR): 92.38% on malicious samples.
- Efficiency: The model maintains low computational costs compared to methods requiring manual disassembly or complex feature extraction.
Conclusion and Future Directions
While highly effective, the approach faces limitations such as "temporal blindness"—the inability of standard CNNs to account for packet timing. Future work may involve combining CNNs with Recurrent Neural Networks (RNNs) or LSTMs to capture temporal dependencies. Additionally, the team plans to explore higher-dimensional representations, such as RGB-colored 3D images, to further enhance detection capabilities.
Summary updated