1---
2name: hunting-for-command-and-control-beaconing
3description: Detect C2 beaconing patterns in network traffic using frequency analysis,
4 jitter detection, and domain reputation to identify compromised endpoints communicating
5 with adversary infrastructure.
6domain: cybersecurity
7subdomain: threat-hunting
8tags:
9- threat-hunting
10- mitre-attack
11- c2
12- beaconing
13- network-analysis
14- proactive-detection
15version: '1.0'
16author: mahipal
17license: Apache-2.0
18d3fend_techniques:
19- File Metadata Consistency Validation
20- Certificate Analysis
21- Application Protocol Command Analysis
22- Content Format Conversion
23- File Content Analysis
24nist_csf:
25- DE.CM-01
26- DE.AE-02
27- DE.AE-07
28- ID.RA-05
29mitre_attack:
30- T1046
31- T1057
32- T1082
33- T1083
34- T1071
35source: https://github.com/mukul975/Anthropic-Cybersecurity-Skills
36source_commit: 04450304b12645cb2b974ab96d28c0664758a88d
37metadata:
38 source: https://skillmd.com/skills/yanacuti1121/hunting-for-command-and-control-beaconing
39---
40
41# Hunting for Command and Control Beaconing
42
43## When to Use
44
45- When proactively hunting for compromised systems in the network
46- After threat intel indicates C2 frameworks targeting your industry
47- When investigating periodic outbound connections to suspicious domains
48- During incident response to identify active C2 channels
49- When DNS query logs show unusual patterns to specific domains
50
51## Prerequisites
52
53- Network proxy/firewall logs with full URL and timing data
54- DNS query logs (passive DNS, DNS server logs, or Sysmon Event ID 22)
55- Zeek/Bro network connection logs or NetFlow data
56- SIEM with statistical analysis capabilities (Splunk, Elastic)
57- Threat intelligence feeds for domain/IP reputation
58
59## Workflow
60
611. **Identify Beaconing Characteristics**: Define what constitutes beaconing (regular intervals, small payload sizes, consistent destinations, jitter patterns).
622. **Collect Network Telemetry**: Aggregate proxy logs, DNS queries, and connection metadata for analysis.
633. **Apply Frequency Analysis**: Identify connections with regular intervals using statistical methods (standard deviation, coefficient of variation).
644. **Filter Known-Good Traffic**: Exclude legitimate periodic traffic (Windows Update, AV updates, heartbeat services, NTP).
655. **Analyze Domain/IP Reputation**: Check identified beaconing destinations against threat intel, WHOIS data, and certificate transparency logs.
666. **Investigate Endpoint Context**: Correlate beaconing activity with process creation, user context, and file system changes on source endpoints.
677. **Confirm and Respond**: Validate C2 activity, block communication, and initiate incident response.
68
69## Key Concepts
70
71| Concept | Description |
72|---------|-------------|
73| T1071 | Application Layer Protocol (HTTP/HTTPS/DNS C2) |
74| T1071.001 | Web Protocols (HTTP/S beaconing) |
75| T1071.004 | DNS (DNS tunneling C2) |
76| T1573 | Encrypted Channel |
77| T1572 | Protocol Tunneling |
78| T1568 | Dynamic Resolution (DGA, fast-flux) |
79| T1132 | Data Encoding in C2 |
80| T1095 | Non-Application Layer Protocol |
81| Beacon Interval | Time between C2 check-ins |
82| Jitter | Random variation in beacon interval |
83| DGA | Domain Generation Algorithm |
84| Fast-Flux | Rapidly changing DNS resolution |
85
86## Tools & Systems
87
88| Tool | Purpose |
89|------|---------|
90| RITA (Real Intelligence Threat Analytics) | Automated beacon detection in Zeek logs |
91| Splunk | Statistical beacon analysis with SPL |
92| Elastic Security | ML-based anomaly detection for beaconing |
93| Zeek/Bro | Network connection metadata collection |
94| Suricata | Network IDS with JA3/JA4 fingerprinting |
95| VirusTotal | Domain and IP reputation checking |
96| PassiveDNS | Historical DNS resolution data |
97| Flare | C2 profile detection |
98
99## Common Scenarios
100
1011. **Cobalt Strike Beacon**: HTTP/HTTPS beaconing with configurable sleep time and jitter to malleable C2 profiles.
1022. **DNS Tunneling C2**: Data exfiltration and command receipt via encoded DNS TXT/CNAME queries to attacker-controlled domains.
1033. **Sliver C2 over HTTPS**: Modern C2 framework using HTTPS with configurable beacon intervals and domain fronting.
1044. **DGA-based C2**: Malware generating random domains daily, with adversary registering upcoming domains for C2.
1055. **Legitimate Service Abuse**: C2 over legitimate cloud services (Azure, AWS, Slack, Discord, Telegram).
106
107## Output Format
108
109```
110Hunt ID: TH-C2-[DATE]-[SEQ]
111Source IP: [Internal IP]
112Source Host: [Hostname]
113Destination: [Domain/IP]
114Protocol: [HTTP/HTTPS/DNS/Custom]
115Beacon Interval: [Average seconds]
116Jitter: [Percentage]
117Connection Count: [Total connections]
118Data Volume: [Bytes sent/received]
119First Seen: [Timestamp]
120Last Seen: [Timestamp]
121Domain Age: [Days]
122TI Match: [Yes/No - source]
123Risk Level: [Critical/High/Medium/Low]
124```