1---2name: hunting-for-command-and-control-beaconing3description: Detect C2 beaconing patterns in network traffic using frequency analysis, jitter detection, and domain reputation to identify compromised endpoints communicating with adversary infrastructure.4license: Apache-2.05---6
7# Hunting for Command and Control Beaconing
8
9## When to Use
10
11- When proactively hunting for compromised systems in the network
12- After threat intel indicates C2 frameworks targeting your industry
13- When investigating periodic outbound connections to suspicious domains
14- During incident response to identify active C2 channels
15- When DNS query logs show unusual patterns to specific domains
16
17## Detection Gaps & Validation
18
19- **Jitter and long sleep break naive frequency rules:** interval + 0–50% jitter (Cobalt Strike) and multi-hour sleeps drop the connection count and inflate CV — score on bytes-out consistency and use autocorrelation over a 7–14 day window, not a single-day `CV < 0.2`.
20- **Encrypted/allowlisted channels:** TLS (T1573), domain fronting, and C2 over Slack/Discord/Telegram/Graph API ride trusted FQDNs — destination reputation alone misses them; pivot to JA3/JA4 (use Zeek `ssl.log`/Suricata, since Sysmon EID 3 lacks it) and timing.
21- **DNS C2 (T1071.004):** TXT/CNAME tunneling needs DNS query logs (Sysmon EID 22 or resolver logs) plus entropy/volume analysis — invisible if DNS logging is off or only NXDOMAIN is retained.
22- **Log fidelity:** sampled NetFlow or aggregated proxy logs destroy inter-arrival timing — confirm per-connection records.
23- **Validate:** run Atomic Red Team **T1071.001**/**T1071.004** (or a Sliver test profile) with a known interval and confirm the beacon search and DNS-entropy search fire, then map source IP to host via Sysmon EID 1/3.
24- **Tune FPs:** Windows Update, AV, NTP, telemetry, and CDN health checks are periodic by design — allowlist by destination + process, never by interval alone.
25
26## Prerequisites
27
28- Network proxy/firewall logs with full URL and timing data
29- DNS query logs (passive DNS, DNS server logs, or Sysmon Event ID 22)
30- Zeek/Bro network connection logs or NetFlow data
31- SIEM with statistical analysis capabilities (Splunk, Elastic)
32- Threat intelligence feeds for domain/IP reputation
33
34## Workflow
35
361. **Identify Beaconing Characteristics**: Define what constitutes beaconing (regular intervals, small payload sizes, consistent destinations, jitter patterns).
372. **Collect Network Telemetry**: Aggregate proxy logs, DNS queries, and connection metadata for analysis.
383. **Apply Frequency Analysis**: Identify connections with regular intervals using statistical methods (standard deviation, coefficient of variation).
394. **Filter Known-Good Traffic**: Exclude legitimate periodic traffic (Windows Update, AV updates, heartbeat services, NTP).
405. **Analyze Domain/IP Reputation**: Check identified beaconing destinations against threat intel, WHOIS data, and certificate transparency logs.
416. **Investigate Endpoint Context**: Correlate beaconing activity with process creation, user context, and file system changes on source endpoints.
427. **Confirm and Respond**: Validate C2 activity, block communication, and initiate incident response.
43
44## Key Concepts
45
46| Concept | Description |
47|---------|-------------|
48| T1071 | Application Layer Protocol (HTTP/HTTPS/DNS C2) |
49| T1071.001 | Web Protocols (HTTP/S beaconing) |
50| T1071.004 | DNS (DNS tunneling C2) |
51| T1573 | Encrypted Channel |
52| T1572 | Protocol Tunneling |
53| T1568 | Dynamic Resolution (DGA, fast-flux) |
54| T1132 | Data Encoding in C2 |
55| T1095 | Non-Application Layer Protocol |
56| Beacon Interval | Time between C2 check-ins |
57| Jitter | Random variation in beacon interval |
58| DGA | Domain Generation Algorithm |
59| Fast-Flux | Rapidly changing DNS resolution |
60
61## Tools & Systems
62
63| Tool | Purpose |
64|------|---------|
65| RITA (Real Intelligence Threat Analytics) | Automated beacon detection in Zeek logs |
66| Splunk | Statistical beacon analysis with SPL |
67| Elastic Security | ML-based anomaly detection for beaconing |
68| Zeek/Bro | Network connection metadata collection |
69| Suricata | Network IDS with JA3/JA4 fingerprinting |
70| VirusTotal | Domain and IP reputation checking |
71| PassiveDNS | Historical DNS resolution data |
72| Flare | C2 profile detection |
73
74## Common Scenarios
75
761. **Cobalt Strike Beacon**: HTTP/HTTPS beaconing with configurable sleep time and jitter to malleable C2 profiles.
772. **DNS Tunneling C2**: Data exfiltration and command receipt via encoded DNS TXT/CNAME queries to attacker-controlled domains.
783. **Sliver C2 over HTTPS**: Modern C2 framework using HTTPS with configurable beacon intervals and domain fronting.
794. **DGA-based C2**: Malware generating random domains daily, with adversary registering upcoming domains for C2.
805. **Legitimate Service Abuse**: C2 over legitimate cloud services (Azure, AWS, Slack, Discord, Telegram).
81
82## Output Format
83
84```
85Hunt ID: TH-C2-[DATE]-[SEQ]
86Source IP: [Internal IP]
87Source Host: [Hostname]
88Destination: [Domain/IP]
89Protocol: [HTTP/HTTPS/DNS/Custom]
90Beacon Interval: [Average seconds]
91Jitter: [Percentage]
92Connection Count: [Total connections]
93Data Volume: [Bytes sent/received]
94First Seen: [Timestamp]
95Last Seen: [Timestamp]
96Domain Age: [Days]
97TI Match: [Yes/No - source]
98Risk Level: [Critical/High/Medium/Low]
99```