Introduction
Detecting malicious activity within network traffic is a classic "needle in a haystack" challenge. Traditional machine learning approaches often struggle with the inherent structure and variable length of network data, such as HTTP requests. This paper introduces a hierarchical Multiple Instance Learning (MIL) framework designed to identify infected computers by analyzing the nested structure of HTTP traffic—ranging from individual characters and tokens to full URLs and aggregate user behavior.
The Nested MIL Framework
The core innovation of this research is the "Nested MIL" model. Unlike "flat" models that treat URLs as simple strings or require manual feature engineering, this approach provides a "structural prior" by mirroring the natural hierarchy of the data.
The model processes data through several stages:
- Token Level: Strings are converted into fixed-size vectors using trigram histograms with modulo hashing.
- URL Level: Tokens are grouped into functional blocks (hostname, path, query), and the model learns specific embeddings for these parts.
- Domain and User Level: Multiple requests to a specific domain are aggregated, and finally, all domain traffic for a single user is combined into a final representation.
A key technical feature is Dual Aggregation, which utilizes both Mean and Max pooling. Mean pooling is effective for detecting shifts in traffic distributions (typical of adware), while Max pooling identifies specific "smoking gun" malicious requests (typical of Command & Control traffic).
Experimental Results and Generalization
The authors evaluated the model using a massive corporate dataset from Cisco CTA and the public CSIC 2010 benchmark. To test real-world robustness, they employed a "Grill Test" protocol, where entire malware families or domains were hidden during training to simulate the detection of zero-day threats.
As shown in the performance curves, the Nested MIL model (MIL-URL) significantly outperforms baselines like Random Forests and eXpose (a CNN-based model). On the "single computer" level, which aggregates all traffic for a user, the model achieves nearly 95% precision even at high recall levels. This demonstrates that while individual URLs might be ambiguous, the aggregate behavior of an infected host is highly distinctive.
Explainability and Actionable Intelligence
One of the primary advantages of this hierarchical approach is its inherent explainability. Because the entire hierarchy is differentiable, analysts can "backtrack" from a positive classification to identify the specific tokens or URLs that contributed most to the score. This allows the model to automatically extract Indicators of Compromise (IOCs), providing actionable intelligence for security operations centers.
Conclusion
By respecting the structural hierarchy of network data, Nested MIL offers a more efficient and generalizable solution for malware detection than traditional methods. While the increasing use of HTTPS presents a challenge for network-perimeter visibility, the model's efficiency makes it a strong candidate for deployment at the endpoint, where traffic can be inspected before encryption or after decryption.
Reference: Pevný, T., & Dedič, M. (2020). Nested Multiple Instance Learning in Modelling of HTTP network traffic. arXiv:2002.04059v1.
Summary updated