T1584.005 Splunk · SPL

Detect Botnet in Splunk

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.

MITRE ATT&CK

Tactic
Resource Development
Technique
T1584 Compromise Infrastructure
Sub-technique
T1584.005 Botnet
Canonical reference
https://attack.mitre.org/techniques/T1584/005/

SPL Detection Query

Splunk (SPL)
spl
index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=3
NOT (DestinationIp="10.*" OR DestinationIp="172.16.*" OR DestinationIp="172.17.*"
     OR DestinationIp="172.18.*" OR DestinationIp="172.19.*" OR DestinationIp="172.20.*"
     OR DestinationIp="172.21.*" OR DestinationIp="172.22.*" OR DestinationIp="172.23.*"
     OR DestinationIp="172.24.*" OR DestinationIp="172.25.*" OR DestinationIp="172.26.*"
     OR DestinationIp="172.27.*" OR DestinationIp="172.28.*" OR DestinationIp="172.29.*"
     OR DestinationIp="172.30.*" OR DestinationIp="172.31.*" OR DestinationIp="192.168.*"
     OR DestinationIp="127.*" OR DestinationIp="169.254.*")
| eval IRCPort=if(match(DestinationPort, "^(6660|6661|6662|6663|6664|6665|6666|6667|6668|6669|6697|4444|1080)$"), 1, 0)
| eval TimeHour=strftime(_time, "%Y-%m-%d %H")
| stats
    count as ConnectionCount,
    dc(TimeHour) as HourlyBuckets,
    max(IRCPort) as IRCPort,
    values(Image) as Processes,
    earliest(_time) as FirstSeen,
    latest(_time) as LastSeen
    by host, SourceIp, DestinationIp, DestinationPort
| where ConnectionCount >= 20 AND HourlyBuckets >= 3
| eval AvgPerHour=round(ConnectionCount / HourlyBuckets, 1)
| eval BeaconingScore=case(
    IRCPort=1, 3,
    AvgPerHour > 10 AND ConnectionCount > 50, 2,
    ConnectionCount > 200, 2,
    ConnectionCount > 100, 1,
    1)
| eval FirstSeen=strftime(FirstSeen, "%Y-%m-%d %H:%M:%S")
| eval LastSeen=strftime(LastSeen, "%Y-%m-%d %H:%M:%S")
| table host, SourceIp, DestinationIp, DestinationPort, ConnectionCount, HourlyBuckets, AvgPerHour, IRCPort, BeaconingScore, Processes, FirstSeen, LastSeen
| sort - BeaconingScore - ConnectionCount
high severity medium confidence

Detects systems exhibiting botnet C2 communication patterns using Sysmon Event ID 3 (Network Connection). Aggregates outbound connections per host/destination pair across hourly buckets to identify persistent beaconing behavior. Scores results based on IRC port usage (classic botnet C2), high average connection frequency, and sustained multi-hour activity. Excludes RFC 1918 private address space and loopback ranges to focus on external C2 candidates. Pivots from the unobservable adversary infrastructure-building action to detectable network behavior indicating a compromised and enrolled botnet node.

Data Sources

Network Traffic: Network Connection CreationSysmon Event ID 3

Required Sourcetypes

XmlWinEventLog:Microsoft-Windows-Sysmon/Operational

False Positives & Tuning

  • 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
Download portable Sigma rule (.yml)

Other platforms for T1584.005


Testing Methodology

Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1Simulate Botnet Beaconing via PowerShell Loop

    Expected signal: Sysmon Event ID 1: Process Create with Image=powershell.exe, CommandLine containing 'DownloadString' and a loop. Sysmon Event ID 3: 30 network connection attempts to 127.0.0.1:8080 over approximately 2.5 minutes. In DeviceNetworkEvents: ConnectionCount will accumulate for the powershell.exe process against the target IP. The connection will fail (no listener) but the attempt events still fire.

  2. Test 2IRC C2 Port Connection Attempt

    Expected signal: Sysmon Event ID 3: Network connection attempt from powershell.exe to 127.0.0.1:6667. DestinationPort=6667 will be logged regardless of whether the connection succeeds. In DeviceNetworkEvents: ActionType will be 'ConnectionAttempt' or 'ConnectionFailed' with RemotePort=6667.

  3. Test 3High-Frequency Outbound Connection Burst (DDoS Simulation)

    Expected signal: Sysmon Event ID 3: 150 network connection events from powershell.exe in rapid succession, each to 127.0.0.1 on different ports. The ConnectionCount in a 15-minute window will exceed 100, triggering the DDoS burst hunting query. UniquePorts will be high (random port selection), triggering ScanIndicator evaluation.

  4. Test 4DNS Query Burst to Simulated DGA Domains

    Expected signal: Sysmon Event ID 22: 60 DNS query events from powershell.exe, each for a unique random-looking domain name. The vast majority will return NXDOMAIN (non-existent domain). DNS debug log (if enabled) will show the same pattern. DnsQueryResults field will contain NXDOMAIN indicators for each failed lookup.

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