Network Security Modeling using NetFlow Data: Detecting Botnet attacks in IP Traffic

Ganesh Subramaniam, Huan Chen, Ravi Varadhan, Robert ArchibaldarXiv 2021

Abstract

This paper introduces a host-centric statistical framework for identifying botnet Command & Control (C2) servers within large-scale carrier-grade NetFlow traffic. Traditional security models often struggle with "device-centric" analysis, where malicious signals are drowned out by legitimate user activity. By aggregating traffic patterns from the perspective of external hosts, the researchers amplify the detectable "heartbeat" of botnet communication. The study evaluates two modeling approaches: a Random Forest (RF) classifier utilizing hand-crafted domain features and a 1D Convolutional Neural Network (CNN) operating on raw time-series data. Results indicate that the Random Forest model significantly outperforms the deep learning approach, achieving a True Positive rate of 0.80, and highlights that the "low and slow" nature of C2 traffic serves as a primary identifying signature.

Introduction: The Challenge of the Invisible Botnet

Botnets—networks of compromised "zombie" devices controlled by a central Command & Control (C2) server—are the primary engines behind modern DDoS attacks, spam campaigns, and large-scale data exfiltration. Detecting these networks is notoriously difficult due to the sheer volume of traffic in carrier-grade networks (often terabytes per day) and the extreme class imbalance, where malicious hosts are outnumbered by benign ones by several orders of magnitude.

Traditionally, intrusion detection systems have focused on a device-centric approach, monitoring individual internal devices for signs of infection. However, an infected device might only send a tiny fraction of malicious traffic amidst a sea of legitimate web browsing and streaming, making the malicious "signature" incredibly weak and prone to being missed by automated systems.

Methodology: Shifting to a Host-Centric View

The core innovation of this research is the shift from device-centric to host-centric analysis. Instead of asking "Is this device infected?", the researchers ask "Is this external host acting as a C2 server?"

Figure 1: Comparison between traditional device-centric analysis (left) and the proposed host-centric/C2-centric analysis (right).

By aggregating all interactions an external host has across many internal devices, the malicious patterns become much more apparent. The researchers developed a Statistical Intrusion Detection System (SIDS) to test this theory using two distinct modeling paths:

  1. Random Forest (RF) with Feature Engineering: This model utilized nearly 40 "hand-crafted" features based on cybersecurity expertise. These included flow size metrics (bytes, packets), beaconing features (measuring the periodicity of communications), and Run Length Encoding of packet sizes to catch repetitive, automated commands.
  2. 1D Temporal Convolutional Neural Network (CNN): This model was fed raw multivariate time-series data (counts of bytes, packets, and flows) aggregated into 5-minute bins. The goal was to determine if deep learning could autonomously discover the patterns that experts manually engineered for the RF model.

To handle the massive class imbalance, the authors employed a "balanced random forest" approach, ensuring each decision tree was trained on a representative sample of rare malicious instances.

Key Insights: "Low and Slow" as a Signature

A critical finding of the study is that C2 traffic is often intentionally slow and spread out to avoid triggering traditional threshold-based alarms. Ironically, this attempt to remain stealthy creates a highly predictable, non-human pattern when viewed over time.

Figure 6: Comparison of traffic duration patterns between a malicious C2 bot (left) and normal user traffic (right).

As shown in the temporal analysis, normal user traffic is "bursty" and irregular, reflecting the unpredictable nature of human web browsing. In contrast, C2 traffic exhibits a consistent, low-duration "heartbeat" or beaconing pattern. The Random Forest model identified "average packet rate" (avePktRate) as the most critical feature; interestingly, as the packet rate increases, the probability of the host being a botnet C2 decreases, confirming that these malicious actors prefer to stay "low and slow."

Results and Performance

The Random Forest model significantly outperformed the 1D CNN across all primary metrics:

  • Random Forest: Achieved a True Positive (TP) rate of 0.80 with a False Positive (FP) rate of only 0.027.
  • 1D CNN: Achieved a lower TP rate of 0.63 and a higher FP rate of 0.044.

When validated against real-world threat intelligence blacklists, the RF model's predictions showed a much higher correlation with known malicious actors than the CNN. This suggests that in the specialized field of cybersecurity, where data is noisy and imbalanced, human-defined features like "packet size run-length" still provide a critical edge over automated deep learning architectures.

Conclusion

By re-framing the botnet detection problem as a host-centric classification task, this research demonstrates that C2 servers can be identified even within massive, carrier-grade datasets. The success of the Random Forest model underscores the continued importance of domain expertise in feature engineering. While deep learning holds promise, the interpretable nature of statistical models allows security analysts to understand why a host is flagged, providing actionable intelligence in the ongoing fight against botnet-driven cybercrime.

Summary updated

BibTeX
@misc{subramaniam2021network,
  author = {Ganesh Subramaniam and Huan Chen and Ravi Varadhan and Robert Archibald},
  title = {{Network Security Modeling using NetFlow Data: Detecting Botnet attacks in IP Traffic}},
  year = {2021},
  eprint = {2108.08924},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2108.08924},
}
Figure