PORTFILER: Port-Level Network Profiling for Self-Propagating Malware Detection

Talha Ongun, Oliver Spohngellert, Benjamin A. Miller, Simona Boboila, Alina Oprea, Tina Eliassi-Rad, Jason Hiser, Alastair Nottingham, Jack W. Davidson, Malathi Veeraraghavan

Abstract

Self-propagating malware (SPM), such as WannaCry and Mirai, spreads autonomously by scanning for vulnerable devices, often compromising large-scale networks within days. Detecting these "worms" in their early stages is challenging because they often utilize common ports to blend with legitimate traffic and can employ stealthy, low-volume scanning to evade detection. This paper introduces PORTFILER, an unsupervised machine learning system that profiles network traffic at the port level. By employing a novel ensemble of models trained on individual traffic features, PORTFILER achieves high precision and resilience against evasion tactics.

Introduction

The rapid spread of self-propagating malware remains a critical challenge for network security. Traditional detection methods, such as rule-based systems, are frequently bypassed by new variants, while supervised machine learning models are often hindered by a lack of labeled "ground truth" data. Furthermore, sophisticated attackers can manipulate scanning rates to avoid triggering volume-based alarms. There is a pressing need for robust, unsupervised detection mechanisms that can identify anomalous behavior even when it is designed to be stealthy.

Methodology

PORTFILER (PORT-Level Network Traffic ProFILER) is designed to operate on Zeek connection logs, focusing on specific ports (e.g., 22, 23, 80, 443, and 445) to build granular profiles of normal activity.

PORTFILER system architecture showing training and testing phases.

The system's architecture consists of three primary components:

  1. Port-Level Feature Extraction: PORTFILER extracts 35 distinct features from connection logs, including connection duration, byte counts, and the number of unique external IPs contacted.
  2. Unsupervised Ensemble Modeling: To prevent attackers from evading detection by manipulating a single metric (like volume), PORTFILER trains multiple unsupervised models—such as Kernel Density Estimation (KDE) or Isolation Forests—on individual features. These independent scores are then aggregated into a final anomaly score.
  3. Global Ranking and Normalization: To assist Security Operations Center (SOC) analysts, anomaly scores are normalized across different ports using a Complementary Cumulative Distribution Function (CCDF). This creates a prioritized, global ranking of suspicious events.
The ensemble model architecture, aggregating scores from individual feature models.

Evaluation

The effectiveness of PORTFILER was evaluated using a combination of real-world and synthetic datasets:

  • Real-World Traffic: Over 19 billion events from one week of anonymized Zeek logs across two large university networks.
  • Malicious Traces: Public Mirai botnet traces and reverse-engineered WannaCry variants. The researchers generated "stealthy" versions by varying thread counts and scan intervals.
  • Live Recreation: A controlled Mirai attack on an internal network with 142 vulnerable nodes.

Results and Discussion

PORTFILER demonstrated exceptional performance across several metrics:

  • High Precision: The system achieved a precision of over 0.94 within the top 100 ranked alerts for WannaCry detection.
  • Low False Positive Rate: A false positive rate below $8 \times 10^{-4}$ ensures that security teams are not overwhelmed by alert fatigue.
  • Evasion Resistance: While standard models often fail when scanning rates are significantly reduced (e.g., by 64x), PORTFILER’s weighted ensemble maintained a PR-AUC of 0.93.
  • Feature Significance: The "New IP" feature—counting unique external IPs contacted—proved highly effective, as random address probing is a fundamental characteristic of SPM propagation.

Conclusion

PORTFILER provides a robust, unsupervised approach to detecting self-propagating malware by decomposing network traffic into port-level feature ensembles. While the system requires periodic retraining to adapt to evolving network baselines, its ability to rank anomalies globally and resist stealthy evasion tactics makes it a valuable tool for modern Security Operations Centers. Future work will explore multi-port relationship features to better capture complex, distributed attacks.

Summary updated

BibTeX
@inproceedings{ongun2021portfiler,
  author = {Talha Ongun and Oliver Spohngellert and Benjamin A. Miller and Simona Boboila and Alina Oprea and Tina Eliassi-Rad and Jason Hiser and Alastair Nottingham and Jack W. Davidson and Malathi Veeraraghavan},
  title = {{PORTFILER: Port-Level Network Profiling for Self-Propagating Malware Detection}},
  booktitle = {CNS},
  year = {2021},
  doi = {10.1109/cns53000.2021.9705045},
}
Figure