1---2name: hunting-for-command-and-control-beaconing3description: Detect C2 beaconing patterns in network traffic using4version: '1.0'5author: mahipal (vendored by SOCIS)6license: Apache-2.07platforms:8- linux9- macos10- windows11category: security12metadata:13 source: https://skillmd.com/skills/socisio/hunting-for-command-and-control-beaconing14 socis:15 tags:16 - threat-hunting17 - mitre-attack18 - c219 - beaconing20 - network-analysis21 - proactive-detection22 subdomain: threat-hunting23 upstream: mukul975/Anthropic-Cybersecurity-Skills24 nist_csf:25 - DE.CM-0126 - DE.AE-0227 - DE.AE-0728 - ID.RA-0529 d3fend_techniques:30 - File Metadata Consistency Validation31 - Certificate Analysis32 - Application Protocol Command Analysis33 - Content Format Conversion34 - File Content Analysis35 mitre_attack:36 - T104637 - T105738 - T108239 - T108340 - T107141---424344# Hunting for Command and Control Beaconing4546## When to Use4748- When proactively hunting for compromised systems in the network49- After threat intel indicates C2 frameworks targeting your industry50- When investigating periodic outbound connections to suspicious domains51- During incident response to identify active C2 channels52- When DNS query logs show unusual patterns to specific domains5354## Prerequisites5556- Network proxy/firewall logs with full URL and timing data57- DNS query logs (passive DNS, DNS server logs, or Sysmon Event ID 22)58- Zeek/Bro network connection logs or NetFlow data59- SIEM with statistical analysis capabilities (Splunk, Elastic)60- Threat intelligence feeds for domain/IP reputation6162## Workflow63641. **Identify Beaconing Characteristics**: Define what constitutes beaconing (regular intervals, small payload sizes, consistent destinations, jitter patterns).652. **Collect Network Telemetry**: Aggregate proxy logs, DNS queries, and connection metadata for analysis.663. **Apply Frequency Analysis**: Identify connections with regular intervals using statistical methods (standard deviation, coefficient of variation).674. **Filter Known-Good Traffic**: Exclude legitimate periodic traffic (Windows Update, AV updates, heartbeat services, NTP).685. **Analyze Domain/IP Reputation**: Check identified beaconing destinations against threat intel, WHOIS data, and certificate transparency logs.696. **Investigate Endpoint Context**: Correlate beaconing activity with process creation, user context, and file system changes on source endpoints.707. **Confirm and Respond**: Validate C2 activity, block communication, and initiate incident response.7172## Key Concepts7374| Concept | Description |75|---------|-------------|76| T1071 | Application Layer Protocol (HTTP/HTTPS/DNS C2) |77| T1071.001 | Web Protocols (HTTP/S beaconing) |78| T1071.004 | DNS (DNS tunneling C2) |79| T1573 | Encrypted Channel |80| T1572 | Protocol Tunneling |81| T1568 | Dynamic Resolution (DGA, fast-flux) |82| T1132 | Data Encoding in C2 |83| T1095 | Non-Application Layer Protocol |84| Beacon Interval | Time between C2 check-ins |85| Jitter | Random variation in beacon interval |86| DGA | Domain Generation Algorithm |87| Fast-Flux | Rapidly changing DNS resolution |8889## Tools & Systems9091| Tool | Purpose |92|------|---------|93| RITA (Real Intelligence Threat Analytics) | Automated beacon detection in Zeek logs |94| Splunk | Statistical beacon analysis with SPL |95| Elastic Security | ML-based anomaly detection for beaconing |96| Zeek/Bro | Network connection metadata collection |97| Suricata | Network IDS with JA3/JA4 fingerprinting |98| VirusTotal | Domain and IP reputation checking |99| PassiveDNS | Historical DNS resolution data |100| Flare | C2 profile detection |101102## Common Scenarios1031041. **Cobalt Strike Beacon**: HTTP/HTTPS beaconing with configurable sleep time and jitter to malleable C2 profiles.1052. **DNS Tunneling C2**: Data exfiltration and command receipt via encoded DNS TXT/CNAME queries to attacker-controlled domains.1063. **Sliver C2 over HTTPS**: Modern C2 framework using HTTPS with configurable beacon intervals and domain fronting.1074. **DGA-based C2**: Malware generating random domains daily, with adversary registering upcoming domains for C2.1085. **Legitimate Service Abuse**: C2 over legitimate cloud services (Azure, AWS, Slack, Discord, Telegram).109110## Output Format111112```113Hunt ID: TH-C2-[DATE]-[SEQ]114Source IP: [Internal IP]115Source Host: [Hostname]116Destination: [Domain/IP]117Protocol: [HTTP/HTTPS/DNS/Custom]118Beacon Interval: [Average seconds]119Jitter: [Percentage]120Connection Count: [Total connections]121Data Volume: [Bytes sent/received]122First Seen: [Timestamp]123Last Seen: [Timestamp]124Domain Age: [Days]125TI Match: [Yes/No - source]126Risk Level: [Critical/High/Medium/Low]127```