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.4domain: cybersecurity5subdomain: threat-hunting6tags: [threat-hunting, mitre-attack, c2, beaconing, network-analysis, proactive-detection]7version: "1.0"8author: mahipal9license: MIT10metadata:11 source: https://skillmd.com/skills/njones17/hunting-for-command-and-control-beaconing12---1314# Hunting for Command and Control Beaconing1516## When to Use1718- When proactively hunting for compromised systems in the network19- After threat intel indicates C2 frameworks targeting your industry20- When investigating periodic outbound connections to suspicious domains21- During incident response to identify active C2 channels22- When DNS query logs show unusual patterns to specific domains2324## Prerequisites2526- Network proxy/firewall logs with full URL and timing data27- DNS query logs (passive DNS, DNS server logs, or Sysmon Event ID 22)28- Zeek/Bro network connection logs or NetFlow data29- SIEM with statistical analysis capabilities (Splunk, Elastic)30- Threat intelligence feeds for domain/IP reputation3132## Workflow33341. **Identify Beaconing Characteristics**: Define what constitutes beaconing (regular intervals, small payload sizes, consistent destinations, jitter patterns).352. **Collect Network Telemetry**: Aggregate proxy logs, DNS queries, and connection metadata for analysis.363. **Apply Frequency Analysis**: Identify connections with regular intervals using statistical methods (standard deviation, coefficient of variation).374. **Filter Known-Good Traffic**: Exclude legitimate periodic traffic (Windows Update, AV updates, heartbeat services, NTP).385. **Analyze Domain/IP Reputation**: Check identified beaconing destinations against threat intel, WHOIS data, and certificate transparency logs.396. **Investigate Endpoint Context**: Correlate beaconing activity with process creation, user context, and file system changes on source endpoints.407. **Confirm and Respond**: Validate C2 activity, block communication, and initiate incident response.4142## Key Concepts4344| Concept | Description |45|---------|-------------|46| T1071 | Application Layer Protocol (HTTP/HTTPS/DNS C2) |47| T1071.001 | Web Protocols (HTTP/S beaconing) |48| T1071.004 | DNS (DNS tunneling C2) |49| T1573 | Encrypted Channel |50| T1572 | Protocol Tunneling |51| T1568 | Dynamic Resolution (DGA, fast-flux) |52| T1132 | Data Encoding in C2 |53| T1095 | Non-Application Layer Protocol |54| Beacon Interval | Time between C2 check-ins |55| Jitter | Random variation in beacon interval |56| DGA | Domain Generation Algorithm |57| Fast-Flux | Rapidly changing DNS resolution |5859## Tools & Systems6061| Tool | Purpose |62|------|---------|63| RITA (Real Intelligence Threat Analytics) | Automated beacon detection in Zeek logs |64| Splunk | Statistical beacon analysis with SPL |65| Elastic Security | ML-based anomaly detection for beaconing |66| Zeek/Bro | Network connection metadata collection |67| Suricata | Network IDS with JA3/JA4 fingerprinting |68| VirusTotal | Domain and IP reputation checking |69| PassiveDNS | Historical DNS resolution data |70| Flare | C2 profile detection |7172## Common Scenarios73741. **Cobalt Strike Beacon**: HTTP/HTTPS beaconing with configurable sleep time and jitter to malleable C2 profiles.752. **DNS Tunneling C2**: Data exfiltration and command receipt via encoded DNS TXT/CNAME queries to attacker-controlled domains.763. **Sliver C2 over HTTPS**: Modern C2 framework using HTTPS with configurable beacon intervals and domain fronting.774. **DGA-based C2**: Malware generating random domains daily, with adversary registering upcoming domains for C2.785. **Legitimate Service Abuse**: C2 over legitimate cloud services (Azure, AWS, Slack, Discord, Telegram).7980## Output Format8182```83Hunt ID: TH-C2-[DATE]-[SEQ]84Source IP: [Internal IP]85Source Host: [Hostname]86Destination: [Domain/IP]87Protocol: [HTTP/HTTPS/DNS/Custom]88Beacon Interval: [Average seconds]89Jitter: [Percentage]90Connection Count: [Total connections]91Data Volume: [Bytes sent/received]92First Seen: [Timestamp]93Last Seen: [Timestamp]94Domain Age: [Days]95TI Match: [Yes/No - source]96Risk Level: [Critical/High/Medium/Low]97```