Skip to Content
  • Proceeding Paper
  • Open Access

30 November 2026

Forensic Methodology for Detecting C2 over Legitimate Services via Encrypted Traffic Behavior †

and
Graduate Program in Professional Electrical Engineering (PPEE), Department of Electrical Engineering, University of Brasília (UnB), Brasília 70910-900, Brazil
*
Author to whom correspondence should be addressed.
†
Presented at the Second Summer School on Artificial Intelligence in Cybersecurity, Madrid, Spain, 2–6 March 2026.
Eng. Proc.2026, 169(1), 8;https://doi.org/10.3390/engproc2026169008 
(registering DOI)

Abstract

Command-and-control (C2) channels that abuse legitimate services such as Telegram or Discord blend malicious traffic into benign communications, while TLS encryption limits content inspection. This paper presents a forensic methodology to characterize C2-over-legitimate-services (C2-over-LITS) using behavioral signals in encrypted traffic. The approach combines a controlled testbed for generating labeled datasets, feature engineering resilient to TLS fingerprint randomization, and machine learning classifiers. We validate the methodology through a comparative analysis of feature sets applied to encrypted C2 traffic and demonstrate its practical detection feasibility. The methodology produces an operational playbook with indicators of compromise and detection rules for Zeek and Suricata, providing a reproducible workflow for defenders.

1. Introduction

Adversaries increasingly abuse platforms such as Telegram, Discord, and Slack to operate command-and-control (C2) channels that blend malicious traffic into benign, high-volume services [1,2]. This C2-over-legitimate-services (C2-over-LITS) tactic undermines content-based inspection due to TLS encryption, while traditional fingerprinting methods such as JA3 are losing robustness as clients randomize TLS extensions [3,4]. These trends motivate detection based on behavioral fingerprints from network metadata.
Existing research addresses this problem only partially. Surveys on cloud-based and public legitimate service (CPLS) abuse identify numerous attack techniques but report that only 7.7% of studies propose detection countermeasures [5]. AI-based encrypted traffic analysis has advanced rapidly, yet most studies omit operational concerns such as detection latency [6]. A methodology bridging behavioral traffic analysis with operational defender output remains absent. This paper addresses that gap with the following: (1) a forensic methodology for characterizing encrypted C2-over-LITS behavior using features extracted from network metadata; (2) a feasibility validation based on state-of-the-art benchmarks for encrypted C2 detection; and (3) a defender-oriented playbook with indicators of compromise (IoCs) and detection rules for Zeek and Suricata. Section 2 reviews related work; Section 3 describes the methodology; Section 4 presents the feasibility analysis; Section 5 discusses implications; and Section 6 concludes.

3. Proposed Methodology

The methodology follows four phases: (1) testbed construction and data collection, (2) feature engineering, (3) model development, and (4) validation and playbook generation. Figure 1 illustrates the pipeline.
Figure 1. Overview of the proposed forensic methodology pipeline.

3.1. Testbed Design and Data Collection

A virtualized testbed emulates C2 communications via Telegram and Discord using controlled implants alongside benign human-like usage. Traffic is captured with tcpdump and parsed with Zeek [14]. Two traffic classes are isolated: C2-over-LITS sessions (beacon callbacks, exfiltration) and benign sessions.

3.2. Feature Engineering and Modeling

Features are organized into four categories: (i) statistical—packet size distributions, inter-arrival times, burstiness; (ii) temporal—beaconing periodicity; (iii) TLS handshake—cipher suites, extension counts; and (iv) application-behavioral—message frequency. Based on the results of Parssegny et al. [12], we prioritize packet size features and flow durations, which showed high discriminative power (Feature Importance > 0.3 in Random Forest models). Supervised classifiers (Random Forest, XGBoost) are trained with SMOTE for class-imbalance mitigation.

4. Experimental Feasibility and Benchmarking

Given the behavioral similarities between C2 traffic over legitimate services (C2-over-LITS) and standard encrypted C2 channels (e.g., HTTPS, Cobalt Strike), we evaluated the feasibility of the proposed feature set by analyzing performance benchmarks from recent literature. Table 1 compares metrics from state-of-the-art encrypted traffic detection approaches that utilize metadata features comparable to our methodology.
Table 1. Performance benchmarks for encrypted C2 detection using metadata features (based on literature analysis).

Analysis of Features Effectiveness

The data indicates that metadata-based features are highly effective for detecting encrypted C2 channels. Barradas et al. [11] demonstrated that inferring application behavior patterns (similar to our proposed temporal features) achieves a TPR of 93.87%, while certificate size analysis achieves perfect detection rates. Similarly, Parssegny et al. [12] reported that utilizing standard Netflow features (packet sizes, duration) is sufficient to detect complex C2 traffic like Cobalt Strike with F1-scores approaching 1.0 when the traffic profile is known.
These results support the feasibility of our methodology. As shown in the benchmarks, behavioral features extracted from encrypted flows allow classifiers to distinguish malicious patterns from legitimate traffic with high confidence (F1 > 0.97). While detection performance decreases slightly when facing completely unknown profiles (Generic Profile F1 = 0.78), the use of semi-supervised approaches, as suggested by Liu et al. [15], can mitigate this by leveraging unlabeled data to improve generalization.

5. Discussion

Implications and Limitations

The feasibility analysis confirms that behavioral fingerprints can distinguish C2 traffic with high reliability (TNR > 99%, TPR > 93%), validating the theoretical foundation of our proposed pipeline. The success of metadata-only approaches in TLS 1.3 environments [11] suggests that our methodology will remain robust against future encryption standards like Encrypted Client Hello (ECH).
However, the detection of C2-over-LITS faces specific challenges. While standard C2 channels often exhibit distinct packet sizes (e.g., small beacons), traffic hidden in legitimate services like Discord may mimic the service’s native packet distributions. Future work should focus on application-layer behavioral features (e.g., message frequency) to better differentiate malicious commands from legitimate user activity, a challenge not fully covered by the generic metrics in Table 1.

6. Conclusions

This paper presents a forensic methodology for detecting C2 channels over legitimate services via behavioral analysis of encrypted traffic. Through a comparative feasibility study, we show that metadata-based detection methods can achieve high efficacy (F1-scores up to 1.00) in specific encrypted C2 scenarios, supporting the viability of our proposed approach for C2-over-LITS detection.
The methodology produces an operational playbook with IoCs and Zeek/Suricata rules. Future work will focus on generating specific datasets for Telegram and Discord C2 traffic to validate the cross-platform generalization of the model.

Author Contributions

Conceptualization, V.M.V. and J.J.C.G.; methodology, V.M.V. and J.J.C.G.; writing—original draft preparation, V.M.V.; writing—review and editing, V.M.V. and J.J.C.G.; supervision, J.J.C.G. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Data Availability Statement

No new datasets were generated for this study. The comparative feasibility analysis is based on results reported in the cited studies.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
C2Command and Control
C2-over-LITSC2 over Legitimate Internet/IT Services
CPLSCloud-based and Public Legitimate Services
IoCIndicator of Compromise
TLSTransport Layer Security

References

  1. Hanrahan, J. Instant Messaging-Based Adversarial C2 Techniques and How to Detect Them. Dragos Blog, 2 March 2023. Available online: https://www.dragos.com/blog/how-to-detect-adversarial-c2-techniques-in-instant-messaging (accessed on 28 November 2026).
  2. Symantec Security Center. Protection Highlight: Telegram and Discord Abuse On The Rise. Broadcom Protection Bulletins, 11 February 2025. Available online: https://www.broadcom.com/support/security-center/protection-bulletin/protection-highlight-telegram-and-discord-abuse-on-the-rise (accessed on 28 November 2026).
  3. Althouse, J.; Atkinson, J.; Atkins, J. TLS Fingerprinting with JA3 and JA3S. Salesforce Engineering Blog, 2017. Available online: https://engineering.salesforce.com/tls-fingerprinting-with-ja3-and-ja3s-247362855967/ (accessed on 12 February 2026).
  4. Leblond, E. Adapting to Change: JA3 fingerprints Fade as Browsers Embrace TLS Extension Randomization. Stamus Networks Blog, 2024. Available online: https://www.stamus-networks.com/blog/ja3-fingerprints-fade-browsers-embrace-tls-extension-randomization (accessed on 28 November 2026).
  5. Al-Lelah, T.; Theodorakopoulos, G.; Reinecke, P.; Javed, A.; Anthi, E. Abuse of cloud-based and public legitimate services as command-and-control (C&C) infrastructure: A systematic literature review. J. Cybersecur. Priv. 2023, 3, 558–590. [Google Scholar] [CrossRef] [Scilit]
  6. Ji, I.H.; Lee, J.H.; Kang, M.J.; Park, W.J.; Jeon, S.H.; Seo, J.T. Artificial intelligence-based anomaly detection technology over encrypted traffic: A systematic literature review. Sensors 2024, 24, 898. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  7. Al-Bataineh, A.; Jung, L.T. A comprehensive survey on command and control (C&C) communication techniques in botnets. IEEE Access 2021, 9, 24439–24463. [Google Scholar]
  8. Husak, M.; Kaspar, J.; Bou-Harb, E. A survey of C&C-based botnet detection techniques. ACM Comput. Surv. 2021, 54, 1–36. [Google Scholar] [CrossRef] [Scilit]
  9. Anderson, B.; McGrew, D. Machine learning on encrypted network traffic: A survey. ACM Comput. Surv. 2022, 55, 1–37. [Google Scholar]
  10. Papadogiannaki, E.; Ioannidis, S. A survey on encrypted network traffic analysis applications, techniques, and countermeasures. ACM Comput. Surv. 2021, 54, 1–35. [Google Scholar] [CrossRef] [Scilit]
  11. Barradas, D.; Novo, C.; Portela, B.; Romeiro, S.; Santos, N. Extending C2 Traffic Detection Methodologies: From TLS 1.2 to TLS 1.3-enabled Malware. In Proceedings of the 27th International Symposium on Research in Attacks, Intrusions and Defenses (RAID 2024), Padua, Italy, 30 September–2 October 2024; ACM: New York, NY, USA, 2024. [Google Scholar]
  12. Parssegny, C.; Mazel, J.; Levillain, O.; Chifflier, P. Striking Back at Cobalt: Using Network Traffic Metadata to Detect Cobalt Strike Masquerading Command and Control Channels. arXiv 2025, arXiv:2506.08922. [Google Scholar]
  13. Althouse, J. JA4+ Network Fingerprinting. FoxIO Blog, 2023. Available online: https://blog.foxio.io/ja4-network-fingerprinting (accessed on 12 February 2026).
  14. The Zeek Project. Zeek Network Security Monitor. 2024. Available online: https://zeek.org/ (accessed on 19 June 2025).
  15. Liu, M.; Yang, Q.; Wang, W.; Liu, S. Semi-Supervised Encrypted Malicious Traffic Detection Based on Multimodal Traffic Characteristics. Sensors 2024, 24, 6507. [Google Scholar] [CrossRef] [Scilit] [PubMed]
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.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.