1---2name: command-control-bcnng3description: 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---67# Hunting for Command and Control Beaconing89## When to Use1011- When proactively hunting for compromised systems in the network12- After threat intel indicates C2 frameworks targeting your industry13- When investigating periodic outbound connections to suspicious domains14- During incident response to identify active C2 channels15- When DNS query logs show unusual patterns to specific domains1617## Prerequisites1819- Network proxy/firewall logs with full URL and timing data20- DNS query logs (passive DNS, DNS server logs, or Sysmon Event ID 22)21- Zeek/Bro network connection logs or NetFlow data22- SIEM with statistical analysis capabilities (Splunk, Elastic)23- Threat intelligence feeds for domain/IP reputation2425## Workflow26271. **Identify Beaconing Characteristics**: Define what constitutes beaconing (regular intervals, small payload sizes, consistent destinations, jitter patterns).282. **Collect Network Telemetry**: Aggregate proxy logs, DNS queries, and connection metadata for analysis.293. **Apply Frequency Analysis**: Identify connections with regular intervals using statistical methods (standard deviation, coefficient of variation).304. **Filter Known-Good Traffic**: Exclude legitimate periodic traffic (Windows Update, AV updates, heartbeat services, NTP).315. **Analyze Domain/IP Reputation**: Check identified beaconing destinations against threat intel, WHOIS data, and certificate transparency logs.326. **Investigate Endpoint Context**: Correlate beaconing activity with process creation, user context, and file system changes on source endpoints.337. **Confirm and Respond**: Validate C2 activity, block communication, and initiate incident response.3435## Key Concepts3637| Concept | Description |38|---------|-------------|39| T1071 | Application Layer Protocol (HTTP/HTTPS/DNS C2) |40| T1071.001 | Web Protocols (HTTP/S beaconing) |41| T1071.004 | DNS (DNS tunneling C2) |42| T1573 | Encrypted Channel |43| T1572 | Protocol Tunneling |44| T1568 | Dynamic Resolution (DGA, fast-flux) |45| T1132 | Data Encoding in C2 |46| T1095 | Non-Application Layer Protocol |47| Beacon Interval | Time between C2 check-ins |48| Jitter | Random variation in beacon interval |49| DGA | Domain Generation Algorithm |50| Fast-Flux | Rapidly changing DNS resolution |5152## Tools & Systems5354| Tool | Purpose |55|------|---------|56| RITA (Real Intelligence Threat Analytics) | Automated beacon detection in Zeek logs |57| Splunk | Statistical beacon analysis with SPL |58| Elastic Security | ML-based anomaly detection for beaconing |59| Zeek/Bro | Network connection metadata collection |60| Suricata | Network IDS with JA3/JA4 fingerprinting |61| VirusTotal | Domain and IP reputation checking |62| PassiveDNS | Historical DNS resolution data |63| Flare | C2 profile detection |6465## Common Scenarios66671. **Cobalt Strike Beacon**: HTTP/HTTPS beaconing with configurable sleep time and jitter to malleable C2 profiles.682. **DNS Tunneling C2**: Data exfiltration and command receipt via encoded DNS TXT/CNAME queries to attacker-controlled domains.693. **Sliver C2 over HTTPS**: Modern C2 framework using HTTPS with configurable beacon intervals and domain fronting.704. **DGA-based C2**: Malware generating random domains daily, with adversary registering upcoming domains for C2.715. **Legitimate Service Abuse**: C2 over legitimate cloud services (Azure, AWS, Slack, Discord, Telegram).7273## Output Format7475```76Hunt ID: TH-C2-[DATE]-[SEQ]77Source IP: [Internal IP]78Source Host: [Hostname]79Destination: [Domain/IP]80Protocol: [HTTP/HTTPS/DNS/Custom]81Beacon Interval: [Average seconds]82Jitter: [Percentage]83Connection Count: [Total connections]84Data Volume: [Bytes sent/received]85First Seen: [Timestamp]86Last Seen: [Timestamp]87Domain Age: [Days]88TI Match: [Yes/No - source]89Risk Level: [Critical/High/Medium/Low]90```