T1584.005

Botnet

Adversaries may compromise numerous third-party systems to form a botnet that can be used during targeting. A botnet is a network of compromised systems that can be instructed to perform coordinated tasks. Instead of purchasing/renting a botnet from a booter/stresser service, adversaries may build their own botnet by compromising numerous third-party systems. Adversaries may also conduct a takeover of an existing botnet by redirecting bots to adversary-controlled C2 servers. With a botnet at their disposal, adversaries may perform follow-on activity such as large-scale phishing or Distributed Denial of Service (DDoS). Notable real-world operators include Volt Typhoon operating KV Botnet through compromised Cisco and NETGEAR SOHO routers, Sandworm's Cyclops Blink targeting SOHO network devices, HAFNIUM using compromised devices in covert proxy networks, and Axiom using large groups of compromised machines as proxy nodes.

Microsoft Sentinel / Defender
kusto
// Detect systems exhibiting botnet node behavior: beaconing to external IPs with
// regular intervals, IRC C2 port usage, or high-frequency outbound connections
// suggesting DDoS participation or automated bot check-ins.
let LookbackPeriod = 24h;
let MinConnectionsThreshold = 20;
let MinHourlyBuckets = 3;
let BotnetC2Ports = dynamic([6667, 6697, 6660, 6661, 6662, 6663, 6664, 6665, 6666, 6668, 6669, 1080, 4444]);
let PrivateRanges = dynamic(["10.", "172.16.", "172.17.", "172.18.", "172.19.", "172.20.",
  "172.21.", "172.22.", "172.23.", "172.24.", "172.25.", "172.26.", "172.27.", "172.28.",
  "172.29.", "172.30.", "172.31.", "192.168.", "127.", "169.254."]);
DeviceNetworkEvents
| where Timestamp > ago(LookbackPeriod)
| where ActionType in ("ConnectionSuccess", "ConnectionAttempt")
| where RemoteIPType == "Public"
| where not(RemoteIP has_any (PrivateRanges))
// Aggregate per device + remote endpoint to identify repeated connections over time
| summarize
    TotalConnections = count(),
    HourlyBuckets = dcount(bin(Timestamp, 1h)),
    BytesSent = sum(SentBytes),
    BytesReceived = sum(ReceivedBytes),
    FirstSeen = min(Timestamp),
    LastSeen = max(Timestamp),
    Processes = make_set(InitiatingProcessFileName, 10),
    ProcessPaths = make_set(InitiatingProcessFolderPath, 5)
    by DeviceName, AccountName, RemoteIP, RemotePort
| where TotalConnections >= MinConnectionsThreshold
| where HourlyBuckets >= MinHourlyBuckets
| extend
    AvgConnectionsPerHour = round(todouble(TotalConnections) / HourlyBuckets, 1),
    AvgBytesPerConnection = round(todouble(BytesSent + BytesReceived) / TotalConnections, 0),
    DurationHours = datetime_diff('hour', LastSeen, FirstSeen),
    IRCPort = RemotePort in (BotnetC2Ports)
// Score: IRC port use = 3, low-byte high-freq beaconing = 2, high-volume connections = 1
| extend BeaconingScore = case(
    IRCPort == true, 3,
    AvgBytesPerConnection < 500 and AvgConnectionsPerHour > 10, 2,
    TotalConnections > 200 and HourlyBuckets >= 6, 2,
    TotalConnections > 100, 1,
    0
)
| where BeaconingScore >= 1
| project
    FirstSeen, LastSeen, DeviceName, AccountName,
    RemoteIP, RemotePort, IRCPort,
    TotalConnections, HourlyBuckets, AvgConnectionsPerHour,
    AvgBytesPerConnection, BytesSent, BytesReceived,
    DurationHours, BeaconingScore, Processes, ProcessPaths
| sort by BeaconingScore desc, TotalConnections desc
high severity medium confidence

Data Sources

Network Traffic: Network Connection Creation Network Traffic: Network Traffic Flow Microsoft Defender for Endpoint

Required Tables

DeviceNetworkEvents

False Positives

  • Monitoring and observability agents (Datadog, SolarWinds, PRTG, Zabbix) that check-in to cloud endpoints at regular intervals with small payloads
  • Software update services and telemetry clients (Windows Update, browser update checks, antivirus cloud lookups) that connect frequently to the same CDN or update endpoint
  • VoIP and real-time communication platforms that maintain persistent connections with high-frequency keepalives
  • Gaming clients, streaming services, and P2P applications that maintain persistent external connections
  • Network management tools or custom scripts that perform frequent health checks against external services

Unlock Pro Content

Get the full detection package for T1584.005 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections