PhishCluster: Real-Time, Density-Based Discovery of Malicious URL Campaigns from Semantic Embeddings
Abstract
1. Introduction
- Related Attacks: Two or more malicious URLs are considered “related” if they exhibit both semantic proximity (their vector embeddings satisfy ) and temporal locality (they appear in the stream within a shared time window). This proximity indicates a shared intent (e.g., a specific phishing kit) or common infrastructure (e.g., a DGA seed), distinguishing them from unrelated attacks that may merely share generic keywords.
- Campaign Group: We define a campaign not as a simple spherical cluster, but as a density-connected set of related attacks. Formally, a campaign is a collection of micro-clusters that form a continuous high-density region in the semantic space, separated from other regions by low-density noise. This definition allows a “group” to assume arbitrary shapes and varying densities, reflecting the organic, non-convex evolution of an attack over time.
- Velocity and Scale: Malicious URLs are discovered at rates of thousands per minute, contributing to a continuous, potentially infinite data stream that must be processed without performance degradation. The system must operate under strict memory and time constraints, processing each data point in a single pass [11,12]. High accuracy is often achieved by offline forensic clustering, but these methods are too slow for “fast-flux” campaigns that may last only minutes. Conversely, fast streaming methods often sacrifice accuracy, leading to high false positive rates and “alert fatigue.” A viable solution must bridge this gap, offering high-fidelity discovery at line speed.
- Complex Campaign Structure: Malicious campaigns are not uniform, spherical clusters. They often exhibit arbitrary shapes, possess varying densities, and evolve over time as attackers alter their tactics. This complexity renders traditional partitioning-based clustering methods like K-means, which are biased towards convex shapes, unsuitable for this domain [13,14].
- The Curse of Dimensionality: Modern URL embeddings are high-dimensional (e.g., 384 dimensions), a characteristic that poses a significant challenge to traditional clustering algorithms. In high-dimensional spaces, the concept of distance and density can become less meaningful as all pairs of points tend to become almost equidistant [15,16].
- Concept Drift: The threat landscape is non-stationary [2]. New campaigns constantly emerge, existing ones change their characteristics, and old ones become inactive. A successful discovery system must be adaptive, capable of tracking this “concept drift” by gracefully incorporating new patterns and aging out obsolete ones.
- The design of an ANN-accelerated online clustering algorithm. We propose, for the first time, the use of a large-scale vector index to fundamentally accelerate the core neighborhood search operation in a streaming clustering context, overcoming the primary performance bottleneck of traditional methods.
- A hybrid online–offline architecture that decouples real-time data summarization from on-demand, high-quality campaign generation. This architecture uses compact micro-cluster summaries for efficient online maintenance and leverages the power of the Hierarchical Density-Based Spatial Clustering of Applications with Noise (HDBSCAN) algorithm in the offline phase to accurately model campaigns of varying density and arbitrary shape.
- A comprehensive experimental evaluation on a synthetic billion-point dataset. We demonstrate that PhishCluster achieves a state-of-the-art performance, outperforming established streaming clustering baselines in terms of throughput, latency, and the accuracy of campaign discovery.
2. Related Work
2.1. Approaches to Malicious URL Detection and Campaign Discovery
2.2. From Syntactic to Semantic URL Analysis
2.3. Large-Scale Approximate Nearest Neighbor Search
2.4. Density-Based Clustering for Data Streams
2.5. Advanced Density-Based Clustering (The DBSCAN Family)
2.6. The Challenge of High Dimensionality
3. The PhishCluster Architecture and Algorithm
3.1. System Overview
- Input Stream: The system consumes a stream of enriched data objects from an ingestion pipeline. Each object contains a high-dimensional vector embedding of a URL and its associated metadata.
- ANN Index: A large-scale, disk-aware ANN index (e.g., based on DiskANN [3]) serves as the system’s long-term memory and algorithmic accelerator. It stores the centroids of active campaign summaries and provides sub-linear time neighborhood queries.
- PhishCluster Online Maintenance Module: This is the heart of the real-time system. For each incoming URL embedding, this module performs an ANN-accelerated search to find the most relevant existing campaign summary, decides whether to merge the new point or create a new summary, and applies a temporal decay to age out old data. Crucially, the output of this online phase is not a final static clustering, but a dynamic, real-time state of Campaign Micro-Clusters (CMCs) held in memory. This continuous summary captures the evolving “shape” of the threat landscape without requiring the heavy computation of finalizing cluster boundaries.
- Campaign Micro-Cluster (CMC) Store: A persistent, in-memory key value store that holds the current state of all campaign summaries (CMCs). This store is continuously updated by the online module.
- PhishCluster On-Demand Generation Module: This module is invoked by an analyst or a scheduled process. It takes a snapshot of the active CMCs from the store—effectively decoupling the analysis from the ingestion rate—and performs a high-quality hierarchical clustering on their centroids to generate a structured representation of the current campaign landscape.
3.2. The Campaign Micro-Cluster (CMC) Data Structure
- N: The weight of the cluster, representing the decayed count of points it contains.
- : The D-dimensional linear sum of the member vectors. The centroid of the CMC is calculated as .
- : The D-dimensional squared sum of the member vectors. This allows for the efficient calculation of the cluster’s variance and radius.
- : The creation timestamp of the CMC.
- : The timestamp of the last data point merged into the CMC.
- status: A label, either “potential” or “active”. A “potential” CMC is newly formed and has not yet accumulated enough evidence to be considered a stable campaign. An “active” CMC has surpassed a weight threshold and is considered a stable cluster.
3.3. Online Maintenance: ANN-Accelerated Micro-Clustering
- Temporal Decay Application: The first step is to apply a temporal decay function to all existing CMCs in the store. The weight N of each CMC is updated according to its last update time : , where is a decay constant that controls the half-life of a point’s influence. Any CMC whose weight N falls below a pruning threshold is removed from the store and the ANN index. This step ensures that the system adapts to concept drift by forgetting old, inactive campaigns. In practice, this mechanism allows the system to autonomously handle concept drift; as a campaign stops emitting URLs, its CMC weight decays asymptotically to zero, effectively “forgetting” the obsolete concept without manual intervention.
- Find Nearest Neighboring CMCs: This is the critical acceleration step. The algorithm queries the underlying ANN index to find the k nearest active CMC centroids to the new point’s vector . This replaces the computationally expensive linear scan over all CMCs, which would be the bottleneck in a traditional implementation, with a highly efficient, sub-linear time search [3].
- Attempt Merge with Active CMCs: The algorithm iterates through the k nearest active neighbors returned by the ANN query. For each candidate CMC, it calculates a hypothetical new radius that would result from merging point p. If this new radius is less than or equal to a predefined threshold , the point p is merged into that CMC. The CMC’s statistics () are updated, its centroid is updated in the ANN index, and the process for point p terminates.
- Attempt Merge with Potential CMCs: If no suitable active CMC was found, the algorithm performs a similar neighborhood search and merge attempt against the set of “potential” CMCs (this set is typically small enough for a linear scan or a separate, smaller in-memory index). If a merge is successful, the “potential” CMC’s statistics are updated. If its new weight N now exceeds a promotion threshold , its status is changed to “active”, and its centroid is inserted into the main ANN index.
- Create New Potential CMC: If point p could not be merged into any existing CMC (neither active nor potential), it is considered the seed of a new, nascent campaign. A new CMC is created with “status=potential”, containing only the point p, and is added to the CMC store.
3.4. On-Demand Campaign Generation: Hierarchical Clustering of Summaries
- Input Selection: The process begins by retrieving all CMCs from the store that currently have “status=active”. These represent the stable, significant micro-clusters in the data stream.
- Construct Centroid Matrix: A data matrix is constructed where each row corresponds to the centroid vector, , of one of the selected active CMCs.
- Execute HDBSCAN: The HDBSCAN algorithm is applied to this matrix of centroids. This step is the key to achieving high-quality results. Because HDBSCAN is operating on the centroids of a few thousand CMCs instead of billions of raw data points, the computation is extremely fast and can be performed on-demand in seconds. HDBSCAN’s ability to handle varying densities and automatically determine the number of clusters allows it to correctly identify the complex structure of the campaign landscape, merging multiple related CMCs into a single campaign or separating CMCs that are close but belong to distinct density patterns.
- Label Propagation and Output: HDBSCAN outputs a set of cluster labels, assigning each CMC centroid to a specific campaign or labeling it as noise. These campaign labels are then propagated back: all the individual URLs that were summarized into a given CMC are now considered part of the campaign to which that CMC was assigned. CMCs labeled as noise by HDBSCAN represent small, dense pockets of URLs that do not belong to any larger, stable campaign and can be flagged for individual review. The final output is a structured list of discovered campaigns enriched with summary statistics (e.g., campaign size, duration, centroid, representative URLs) for analyst consumption.
4. Experimental Evaluation
4.1. Experimental Setup
- DenStream, a faithful implementation of the classic streaming density-based clustering algorithm. Partition-based stream algorithms were excluded as they enforce spherical cluster shapes, which are unsuitable for the arbitrary geometries of malicious campaigns.
- Batch-HDBSCAN, a naive baseline that runs the full HDBSCAN algorithm on all raw data points that arrived in a 60 s window.
- PhishCluster-NoANN, an ablation of our system where the ANN-accelerated query is replaced with a brute force linear scan.
4.2. System Throughput and Scalability
4.3. Clustering Quality and Adaptability
4.4. Hyperparameter Sensitivity
4.5. Scalability with Increasing Campaign Count
4.6. Memory Footprint and Stability
4.7. Comparative Evaluation with PhishTransformer
- Latency vs. Depth: PhishTransformer excels in forensic scenarios where latency is acceptable. However, its dependence on live web scraping creates a significant bottleneck (often >500 ms per URL due to network RTT and rendering), rendering it unsuitable for filtering traffic at the ISP backbone level (millions of requests per second). PhishCluster, achieving a nearly identical accuracy (98.9%) using only the vector embedding, operates with sub-millisecond latency, making it viable for inline blocking.
- Discovery vs. Classification: PhishTransformer is an instance-centric classifier; it outputs a binary label (Safe/Phish) based on training data. It cannot identify if two phishing URLs belong to the same attacker. PhishCluster is campaign-centric; it not only detects the threat but automatically groups semantically related URLs into clusters. This allows security analysts to identify and block entire campaigns (e.g., “PayPal Scam Kit v4”) rather than chasing individual URLs.
- Maintenance: As a supervised model, PhishTransformer requires periodic retraining with labeled datasets to recognize new attack patterns. PhishCluster, being unsupervised, adapts to concept drift via its temporal decay and density mechanisms, requiring no labeled retraining to discover novel campaign geometries.
4.8. Ablation Study: Component Importance Analysis
5. Discussion
5.1. Interpretation of Findings
5.2. Failure Mode Analysis
- Semantic Collisions (False Positives): In dense regions of the vector space, legitimate URLs may be semantically indistinguishable from phishing attempts (e.g., a legitimate login page vs. a high-fidelity clone). PhishCluster may incorrectly group these into a malicious campaign if the embedding model does not capture subtle distinguishing features.
- Low-Density “Slow-Drip” Campaigns (False Negatives): Attacks that deliberately use very low arrival rates (e.g., 1 URL/min) may fail to form a dense enough micro-cluster to survive the temporal decay function. These “low-and-slow” attacks may be pruned before they can be aggregated into a campaign.
- Embedding Blind Spots: The system is fundamentally bounded by the quality of the upstream embedding model. If a new obfuscation technique (e.g., using zero-width characters) does not significantly alter the semantic vector produced by the Transformer, PhishCluster will fail to distinguish it as a new pattern.
5.3. Deployment Challenges and Practical Considerations
- Index Maintenance: While the ANN index is robust, it can degrade over time as thousands of micro-clusters are created and deleted. Periodic index rebuilding or “vacuuming” is required to maintain query latency, which may require a brief maintenance window or a dual-index switching strategy.
- Embedding Model Drift: PhishCluster relies on a static vector space defined by the embedding model. If the threat landscape shifts to languages or obfuscations not well represented by the model, the system requires retrained embeddings. This necessitates re-indexing all active micro-clusters into the new vector space.
- Cold Start: When initializing the system, the ANN index is empty. An initial “warm-up” period using historical data is recommended to pre-populate the index with known campaign centroids, preventing the fragmentation that can occur when the first few points of a campaign arrive without a valid nearest neighbor.
5.4. The Role of Embedding Quality
5.5. Limitations and Hyperparameter Sensitivity
5.6. Limitations of Synthetic Evaluation
5.7. Generalizability
6. Conclusions and Future Work
- Adaptive Hyperparameter Tuning: Future work could explore a meta-learning framework that monitors the statistical properties of the incoming data stream and dynamically adjusts key parameters to maintain optimal performance in a non-stationary environment.
- Hybrid Data Clustering: An extension could incorporate the rich structured metadata available from the ingestion pipeline. This would involve modifying the offline clustering stage to use a hybrid distance metric that considers both semantic and attribute similarity, similar to the approach for hybrid queries in ANN systems [8].
- Distributed PhishCluster: Future research could explore a distributed version of PhishCluster, investigating strategies for intelligent data partitioning and federated query and clustering execution. This could also enable privacy-preserving analysis, where multiple organizations could collaboratively build a global campaign model without sharing their raw, sensitive URL data.
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Reimers, N.; Gurevych, I. Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing, Hong Kong, China, 3–7 November 2019; pp. 3973–3983. [Google Scholar]
- Zhang, Z.; Jin, C.; Tang, L.; Liu, X.; Jin, X. Fast, Approximate Vector Queries on Very Large Unstructured Datasets. In Proceedings of the 20th USENIX Symposium on Networked Systems Design and Implementation, Boston, MA, USA, 17–19 April 2023. [Google Scholar]
- Subramanya, S.J.; Devvrit, F.; Kadekodi, R.; Simhadri, H.V.; Krishnaswamy, R. DiskANN: Fast Accurate Billion-point Nearest Neighbor Search on a Single Node. In Proceedings of the Advances in Neural Information Processing Systems 32 (NeurIPS 2019), Vancouver, BC, Canada, 8–14 December 2019. [Google Scholar]
- Singh, A.; Subramanya, S.J. FreshDiskANN: A Fast and Accurate Graph-Based ANN Index for Streaming Similarity Search. arXiv 2021, arXiv:2105.09613. [Google Scholar]
- Malkov, Y.A.; Yashunin, D.A. Efficient and Robust Approximate Nearest Neighbor Search Using Hierarchical Navigable Small World Graphs. IEEE Trans. Pattern Anal. Mach. Intell. 2020, 42, 824–838. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Xu, H.; Manohar, M.D.; Chramouli, B.; Wen, R. In-Place Updates of a Graph Index for Streaming Approximate Nearest Neighbor Search. arXiv 2025, arXiv:2502.13826. [Google Scholar] [CrossRef] [Scilit]
- Li, C.; Andersen, D.G. Improving Approximate Nearest Neighbor Search through Learned Adaptive Early Termination. In Proceedings of the 2020 ACM International Conference on Management of Data, Portland, OR, USA, 14–19 June 2020. [Google Scholar]
- Wang, M.; Wang, Y.; Lv, L.; Yue, Q.; Xu, X.; Ni, J. An Efficient and Robust Framework for Approximate Nearest Neighbor Search with Attribute Constraint. In Proceedings of the Advances in Neural Information Processing Systems 36 (NeurIPS 2023), New Orleans, LA, USA, 10–16 December 2023. [Google Scholar]
- Jégou, H.; Douze, M.; Schmid, C. Product Quantization for Nearest Neighbor Search. IEEE Trans. Pattern Anal. Mach. Intell. 2011, 33, 117–128. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Mohoney, J.; Tang, M.; Sarda, D.; Chowdhury, S.R.; Ilyas, I.F.; Rekatsinas, T. Quake: Adaptive Indexing for Vector Search. arXiv 2025, arXiv:2506.03437. [Google Scholar] [CrossRef] [Scilit]
- Guo, R.; Sun, P.; Lindgren, E.; Geng, Q.; Simcha, D.; Chern, F.; Kumar, S. Accelerating Large-Scale Inference with Anisotropic Vector Quantization. In Proceedings of the 37th International Conference on Machine Learning, Virtual Event, 13–18 July 2020. [Google Scholar]
- Chen, Q.; Zhao, B.; Wang, H.; Li, M.; Liu, C.; Li, Z.; Yang, M.; Wang, J. SPANN: Highly-efficient Billion-scale Approximate Nearest Neighbor Search. In Proceedings of the Advances in Neural Information Processing Systems 34 (NeurIPS 2021), Online, 6–14 December 2021. [Google Scholar]
- Cao, F.; Ester, M.; Qian, W.; Zhou, A. Density-Based Clustering over Data Streams. In Proceedings of the SIAM International Conference on Data Mining, Bethesda, MD, USA, 20–22 April 2006; pp. 328–339. [Google Scholar]
- Baer, A.; Finamore, A.; Casas, P.; Golab, L.; Mellia, M. Large-Scale Network Traffic Monitoring with DBStream, a System for Rolling Big Data Analysis. In Proceedings of the IEEE International Conference on Big Data (IEEE BigData), Washington, DC, USA, 27–30 October 2014. [Google Scholar]
- Ester, M.; Kriegel, H.P.; Sander, J.; Xu, X. A Density-Based Algorithm for Discovering Clusters in Large Spatial Databases with Noise. In Proceedings of the International Conference on Knowledge Discovery and Data Mining, Portland, OR, USA, 2–4 August 1996; pp. 226–231. [Google Scholar]
- Campello, R.J.G.B.; Moulavi, D.; Sander, J. Density-Based Clustering Based on Hierarchical Density Estimates. In Proceedings of the Pacific-Asia Conference on Knowledge Discovery and Data Mining, Gold Coast, Australia, 14–17 April 2013; pp. 160–172. [Google Scholar]
- Sahoo, D.; Liu, C.; Hoi, S.C. Malicious URL detection using machine learning: A survey. arXiv 2017, arXiv:1701.07179. [Google Scholar]
- Tian, Y.; Yu, Y.; Sun, J.; Wang, Y. From Past to Present: A Survey of Malicious URL Detection Techniques, Datasets and Code Repositories. arXiv 2025, arXiv:2504.16449. [Google Scholar] [CrossRef] [Scilit]
- Liu, R.; Wang, Y.; Guo, Z.; Xu, H.; Qin, Z.; Ma, W.; Zhang, F. PyraTrans: Attention-Enriched Pyramid Transformer for Malicious URL Detection. arXiv 2023, arXiv:2312.00508. [Google Scholar]
- Asiri, S.; Xiao, Y.; Li, T. PhishTransformer: A Novel Approach to Detect Phishing Attacks Using URL Collection and Transformer. Electronics 2024, 13, 30. [Google Scholar] [CrossRef] [Scilit]
- Su, M.-Y.; Su, K.-L. BERT-Based Approaches to Identifying Malicious URLs. Sensors 2023, 23, 8499. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Türk, F.; Kılıçaslan, M. Malicious URL Detection with Advanced Machine Learning and Optimization-Supported Deep Learning Models. Appl. Sci. 2025, 15, 10090. [Google Scholar] [CrossRef] [Scilit]
- Haq, Q.E.u.; Faheem, M.H.; Ahmad, I. Detecting Phishing URLs Based on a Deep Learning Approach to Prevent Cyber-Attacks. Appl. Sci. 2024, 14, 10086. [Google Scholar] [CrossRef] [Scilit]
- Tian, Y.; Yu, Y.; Song, L.; Liu, Z.; Wang, Y.; Sun, J. IP-Augmented Multi-Modal Malicious URL Detection via Token-Contrastive Representation Enhancement and Multi-Granularity Fusion. arXiv 2025, arXiv:2510.12395. [Google Scholar]
- Reyes-Dorta, N.; Caballero-Gil, P.; Rosa-Remedios, C. Detection of Malicious URLs Using Machine Learning. Wirel. Netw. 2024, 30, 7543–7560. [Google Scholar] [CrossRef] [Scilit]
- Altan, I.; Bachir, A.; Parbhulkar, Y.; Rizvi, A.M.; Farazi, M. Dual-Path Phishing Detection: Integrating Transformer-Based NLP with Structural URL Analysis. arXiv 2025, arXiv:2509.20972. [Google Scholar]
- Fahad Zia, M.; Harish Kalidass, S. Web Phishing Net (WPN): A scalable machine learning approach for real-time phishing campaign detection. arXiv 2025, arXiv:2502.13171. [Google Scholar]
- Karapiperis, D.; Feretzakis, G.; Mitropoulos, S. PhishGraph: A Scalable Graph-Based ANN Index for Billion-Scale Real-Time Phishing URL Detection. Electronics 2025, 14, 3605. [Google Scholar]
- Karapiperis, D.; Verykios, V.S. Scaling Entity Resolution with K-Means: A Review of Partitioning Techniques. Electronics 2025, 14, 3605. [Google Scholar] [CrossRef] [Scilit]
- Wang, W.; Wei, F.; Dong, L.; Bao, H.; Yang, N.; Zhou, M. MINILM: Deep self-attention distillation for task-agnostic compression of pre-trained transformers. In Proceedings of the Advances in Neural Information Processing Systems 33 (NeurIPS 2020), Virtual, 6–12 December 2020. [Google Scholar]








| Metric/Feature | PhishTransformer [20] | PhishCluster |
|---|---|---|
| Architecture | Supervised | Unsupervised |
| Accuracy | 99.0% | 98.9% |
| Precision | 99.0% | 98.6% |
| Recall | 99.0% | 98.8% |
| Latency Profile | High (>500 ms for scraping) | Real-Time (<10 ms) |
| Primary Capability | Forensic Classification | Campaign Discovery |
| System | Max Throughput (URLs/s) | Mean ARI | Precision | Recall | Campaign Detection Latency (s) |
|---|---|---|---|---|---|
| PhishCluster (Full) | 8570 | 0.92 | 0.94 | 0.95 | 5.8 |
| PhishCluster-NoANN | 720 * | 0.91 | 0.93 | 0.94 | 6.1 |
| DenStream | 680 * | 0.78 | 0.75 | 0.81 | 15.3 |
| Batch-HDBSCAN | 95 | 0.94 | 0.96 | 0.96 | >60 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Karapiperis, D.; Feretzakis, G.; Mitropoulos, S. PhishCluster: Real-Time, Density-Based Discovery of Malicious URL Campaigns from Semantic Embeddings. Information 2026, 17, 64. https://doi.org/10.3390/info17010064
Karapiperis D, Feretzakis G, Mitropoulos S. PhishCluster: Real-Time, Density-Based Discovery of Malicious URL Campaigns from Semantic Embeddings. Information. 2026; 17(1):64. https://doi.org/10.3390/info17010064
Chicago/Turabian StyleKarapiperis, Dimitrios, Georgios Feretzakis, and Sarandis Mitropoulos. 2026. "PhishCluster: Real-Time, Density-Based Discovery of Malicious URL Campaigns from Semantic Embeddings" Information 17, no. 1: 64. https://doi.org/10.3390/info17010064
APA StyleKarapiperis, D., Feretzakis, G., & Mitropoulos, S. (2026). PhishCluster: Real-Time, Density-Based Discovery of Malicious URL Campaigns from Semantic Embeddings. Information, 17(1), 64. https://doi.org/10.3390/info17010064
