foyl Concepts / C2 Beacons
Attack Technique

C2 Beacons and Command and Control

Once an attacker has a foothold, they need to communicate with the compromised system to issue commands and receive results. C2 beacons are the heartbeat of a persistent compromise -- periodic check-ins designed to look like normal traffic.

T1071 Application Layer Protocol T1132 Data Encoding T1568 Dynamic Resolution Live beacon pattern visualization
Beacon pattern visualization -- watch the timing signature Live capture
What is a C2 beacon?
The mechanism that keeps an attacker connected to a compromised host

A C2 beacon is code running on a compromised host that regularly phones home to an attacker-controlled server. The beacon might check in every 60 seconds, receive instructions (run a command, move a file, scan the network), execute them, and send back results.

The defining characteristic is the periodic timing: regular intervals create a timing signature that can be detected in network logs. Attackers use jitter -- random variation in the interval -- to make the pattern look less mechanical.

Most modern C2 frameworks (Cobalt Strike, Sliver, Havoc) have configurable sleep times and jitter percentages. The IRON CHIMNEY compromise used a beacon configured to simulate normal web browsing by varying request patterns and using HTTPS to a domain-fronted or lookalike domain.

C2 communication channels
Attackers choose channels that blend with legitimate traffic in the target environment
HTTPS
HTTPS over port 443
The most common C2 channel. Beacon traffic is encrypted and looks identical to normal HTTPS web traffic at the network layer.
Encrypted -- network inspection sees only TLS
Port 443 allowed everywhere
Blends with legitimate web traffic volume
TLS certificates are visible (unusual CAs, short validity)
Consistent transfer sizes can still be detected
DNS
DNS tunneling
Commands and data encoded in DNS query subdomains. Every host generates DNS traffic -- this channel is very hard to block without breaking resolution.
DNS is allowed everywhere -- hard to block
Low-volume queries look normal
Slow -- DNS is not designed for data transfer
Long or high-entropy subdomains are detectable
Many security tools now monitor DNS query patterns
SMB
SMB named pipes
C2 over Windows file sharing protocol -- used for lateral movement where a compromised host serves as a pivot to reach systems without direct internet access.
Stays inside the network -- no external traffic
SMB traffic is expected between Windows hosts
Requires a pivot host with C2 connectivity
Named pipe connections are logged and detectable
IRON CHIMNEY (INV-2024-0087) -- real C2 domain from the Ficsit scenario
d3adbeef123456789.update.microsoft-cdn-verify.net

This domain was used as the C2 server for the IRON CHIMNEY compromise of RESEARCH-STATION-01 (192.168.3.45). Several detection signals make this domain suspicious on inspection:

Subdomain pattern: The subdomain d3adbeef123456789 is a long hex-like string -- no legitimate CDN uses this naming convention. Defenders can hunt for long or high-entropy subdomains in DNS logs.

Domain mimicry: microsoft-cdn-verify.net mimics Microsoft infrastructure but is not a Microsoft-owned domain. Anything claiming to be a Microsoft CDN that is not under microsoft.com or akadns.net warrants inspection.

Domain age: Attacker domains are typically freshly registered. A TIP or NGFW check on this domain would show low reputation and a registration date within days of the initial compromise.

Detection approaches

Beacon interval detection: Write a query over NetFlow or proxy logs that calculates the standard deviation of connection intervals per destination. A host connecting to the same external IP with very low time variance is likely beaconing. Most SIEM platforms can run this as a scheduled search.

DNS anomalies: Flag DNS queries with subdomains longer than 50 characters, entropy above a threshold, or query rates to newly-registered domains (domain age less than 30 days). DNS tunneling also tends to produce unusually high query counts to a single second-level domain.

TLS certificate inspection: HTTPS C2 uses TLS but the certificate metadata can be unusual -- self-signed certs, short validity windows (under 30 days), or certificates issued by uncommon CAs. A next-gen firewall can log JA3 hashes for TLS fingerprinting to identify known C2 tools by their TLS client behavior.

Size and timing patterns: C2 beacons often produce very consistent packet sizes in check-in requests even with jitter on the interval. A destination where every GET request is exactly 342 bytes is suspicious.

ToolWhat to hunt
SIEMBeacon interval query: stddev of connection times per host per destination over 24h
NGFWDNS queries with subdomains >40 chars; TLS to domains registered <30 days ago; JA3 matching known C2
EDRProcess making periodic outbound connections; svchost.exe or other system processes with unexpected network activity
TIPLookup C2 domain age, WHOIS, passive DNS -- flag if domain is < 30 days old or has no historical resolution
Related concepts