Query Details
id: a1b2c3d4-0002-4a5b-8c9d-dns002c2beacon
name: DNS C2 Beaconing — Low-TTL Periodic Domain Lookups
description: |
Detects DNS-based command-and-control beaconing by identifying clients that
query the same external domain repeatedly at suspiciously regular intervals.
Cobalt Strike DNS beacons, Silver, and Havoc C2 frameworks poll a staging
domain on a configurable timer (default: every 1 second to 5 minutes).
This rule alerts when a single client queries the same FQDN 20+ times in 4 hours
with a consistent periodicity, which is characteristic of automated C2 polling.
severity: High
requiredDataConnectors:
- connectorId: WindowsDnsAma
dataTypes:
- ASimDnsActivityLogs
queryFrequency: 4h
queryPeriod: 4h
triggerOperator: gt
triggerThreshold: 0
status: Available
tactics:
- CommandAndControl
relevantTechniques:
- T1071.004
- T1132
tags:
- DNS C2
- Cobalt Strike
- Beaconing
- Silver C2
- Havoc
query: |
ASimDnsActivityLogs
| where TimeGenerated > ago(4h)
| where EventResult =~ "Success"
| where DnsQueryTypeName in~ ("A", "AAAA", "TXT", "MX", "CNAME", "NULL")
| summarize
QueryCount = count(),
FirstSeen = min(TimeGenerated),
LastSeen = max(TimeGenerated),
SrcHostname = any(SrcHostname)
by SrcIpAddr, DnsQuery
| where QueryCount >= 20
| extend
SpanMinutes = datetime_diff('minute', LastSeen, FirstSeen),
QueriesPerMin = round(todouble(QueryCount) / max_of(1, datetime_diff('minute', LastSeen, FirstSeen)), 2)
| where SpanMinutes > 5
| where QueriesPerMin >= 1
entityMappings:
- entityType: Host
fieldMappings:
- identifier: HostName
columnName: SrcHostname
- entityType: IP
fieldMappings:
- identifier: Address
columnName: SrcIpAddr
- entityType: DNS
fieldMappings:
- identifier: DomainName
columnName: DnsQuery
alertDetailsOverride:
alertDisplayNameFormat: "DNS C2 Beaconing — {{SrcHostname}} queried {{DnsQuery}} {{QueryCount}} times"
alertDescriptionFormat: "Potential C2 beacon: {{SrcHostname}} ({{SrcIpAddr}}) queried {{DnsQuery}} {{QueryCount}} times over {{SpanMinutes}} minutes (~{{QueriesPerMin}} q/min)"
customDetails:
QueryCount: QueryCount
QueriesPerMin: QueriesPerMin
BeaconDomain: DnsQuery
This query is designed to detect suspicious DNS activity that may indicate command-and-control (C2) beaconing, a technique often used by malware to communicate with an external server. Here's a simplified breakdown of what the query does:
Purpose: It identifies clients (computers or devices) that repeatedly query the same external domain at regular intervals, which is a common behavior of automated C2 communication.
Detection Criteria:
Alerting:
Use Cases:
Output:
Overall, this query helps in identifying automated and potentially malicious DNS activity that could signify a compromised system communicating with a threat actor's server.

David Alonso
Released: March 26, 2026
Tables
Keywords
Operators