Detect Botnet in Elastic Security
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/
Elastic Detection Query
// Deploy as Elastic SIEM Threshold Rule: group_by=[host.name, destination.ip, destination.port]
// threshold.value >= 20, threshold.cardinality field=@timestamp (1h bucket) >= 3
// This filters events; the threshold rule engine handles the aggregation and hourly bucket counting
network where event.action in ("connection_attempted", "connection_accepted") and
network.direction == "egress" and
not cidrMatch(destination.ip,
"10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16",
"127.0.0.0/8", "169.254.0.0/16", "::1/128", "fc00::/7") and
(
destination.port in (6667, 6697, 6660, 6661, 6662, 6663, 6664, 6665, 6666, 6668, 6669, 1080, 4444)
or (
source.bytes < 1000 and
not destination.port in (80, 443, 53, 25, 587, 22, 21, 3389, 445, 139, 8080, 8443) and
process.name != null
)
) Elastic EQL query detecting botnet node behavior through high-frequency outbound connections to external IPs on IRC C2 ports or low-byte non-standard port connections. Deploy as a Threshold rule type in Kibana SIEM with group_by=[host.name, destination.ip, destination.port], threshold count >= 20, and cardinality on @timestamp (1-hour buckets) >= 3 over a 24-hour window. IRC ports 6660–6669, 6697, 1080, and 4444 are the primary indicator; the secondary branch catches low-byte beaconing to non-standard ports. Private and loopback ranges are excluded via cidrMatch.
Data Sources
Required Tables
False Positives & Tuning
- Legitimate IRC clients used by developer or gaming communities connecting to public IRC networks on standard port 6667 — cross-reference destination IP against known public IRC server ranges and whitelist approved hosts
- Authorized SOCKS5 proxy software using port 1080 for enterprise egress routing — verify RemotePort 1080 connections against approved proxy infrastructure inventory before escalating
- Application performance monitoring agents with sub-minute heartbeat intervals connecting to SaaS APM endpoints such as Datadog, New Relic, or Dynatrace on non-standard ports — tune exclusions per approved monitoring vendor IP ranges
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.
- 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.
- 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.
- 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.
- 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.
References (10)
- https://attack.mitre.org/techniques/T1584/005/
- https://us.norton.com/internetsecurity-malware-what-is-a-botnet.html
- https://www.imperva.com/learn/ddos/booters-stressers-ddosers/
- https://www.secureworks.com/research/dridex-bugat-v5-botnet-takeover-operation
- https://www.cisa.gov/news-events/cybersecurity-advisories/aa24-038a
- https://www.ncsc.gov.uk/news/joint-advisory-sandworm-cyclops-blink
- https://www.microsoft.com/en-us/security/blog/2025/03/05/silk-typhoon-targeting-it-supply-chain/
- https://feodotracker.abuse.ch/
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1584.005/T1584.005.md
- https://www.cisa.gov/sites/default/files/2024-02/aa24-038a-prc-state-sponsored-actors-compromise-us-critical-infrastructure_0.pdf
Unlock Pro Content
Get the full detection package for T1584.005 including response playbook, investigation guide, and atomic red team tests.