NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

BotGrep: Finding P2P Bots with Structured Graph Analysis

Shishir Nagaraja, Prateek Mittal, Chi-Yao Hong, Matthew Caesar, Nikita Borisov

Introduction

Early botnets relied on centralized command-and-control (C&C) servers, creating single points of failure that defenders could easily target. In response, botnet authors transitioned to decentralized peer-to-peer (P2P) architectures, such as those seen in the Storm and Kraken botnets. These structures are highly resilient to node churn and lack a central hub, making them difficult to dismantle. Furthermore, modern botnet traffic is frequently encrypted and uses randomized ports, rendering traditional Deep Packet Inspection (DPI) ineffective. BotGrep addresses this challenge by analyzing the structural properties of communication graphs—focusing on who is talking to whom rather than the content of the messages.

Methodology

BotGrep is a content-agnostic detection system that treats an ISP's network as a massive graph where nodes represent hosts and edges represent communication events. The core insight is that structured P2P networks must be "fast-mixing" to function efficiently. In graph theory, a fast-mixing graph allows a random walk to reach a uniform distribution much quicker than in the "slow-mixing" background of general Internet traffic.

Overview of the BotGrep inference system and the resulting separation of P2P nodes within a communication graph.

The BotGrep algorithm operates in three primary stages:

  1. Prefiltering: Short random walks identify candidate nodes that belong to tightly-knit, efficient structures.
  2. Clustering: Using a Bayesian approach adapted from social network security (SybilInfer), the system partitions the graph to isolate the most fast-mixing components.
  3. Validation: Subgraphs are tested for graph conductance and entropy to confirm they match the characteristics of a P2P overlay rather than legitimate small-world traffic.

To address privacy concerns across multiple ISPs, the authors proposed a distributed version using Oblivious Pseudo-Random Functions (OPRFs) and Paillier homomorphic encryption, allowing for global graph analysis without exposing private customer data.

Experimental Setup

The system was evaluated by embedding synthetic botnet topologies (Chord, Kademlia, de Bruijn, and LEET-Chord) into real-world traffic traces. These traces included NetFlow logs from the Abilene Internet2 ISP (104k nodes) and backbone traces from CAIDA, scaled up to 30 million nodes to test ISP-level scalability. Real-world visibility was further verified using traces from the Storm and Kraken botnets.

Results and Discussion

BotGrep demonstrated high efficacy, localizing 93-99% of infected hosts across various topologies. Crucially, the false-positive rate remained exceptionally low, typically under 0.6% and often as low as 0.1% in larger datasets.

Distribution of node mixing properties across the network, facilitating the identification of botnet clusters.

The algorithm proved resilient even with partial network visibility, maintaining effectiveness when only 40-60% of botnet links were visible. While the system can operate unsupervised, its performance is optimized when initialized with a small "seed" of known bots from a honeynet.

One significant limitation is the computational cost of the privacy-preserving homomorphic encryption layer, which currently requires substantial hardware resources for real-time ISP-scale deployment. However, the structural vulnerability of P2P botnets—their need for efficiency—remains a powerful lever for detection that is immune to traditional evasion techniques like encryption or port-hopping.

Summary updated

BibTeX
@inproceedings{nagaraja2010botgrep,
  author = {Shishir Nagaraja and Prateek Mittal and Chi-Yao Hong and Matthew Caesar and Nikita Borisov},
  title = {{BotGrep: Finding P2P Bots with Structured Graph Analysis}},
  booktitle = {USENIX Security},
  year = {2010},
}
Figure