Detect Botnet in Google Chronicle
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/
YARA-L Detection Query
rule t1584_005_botnet_node_irc_c2_beaconing {
meta:
author = "Detection Engineering"
description = "Detects botnet node behavior: systems making 20+ outbound connections over 24h to external IPs on IRC C2 ports (6660-6669, 6697) or proxy ports (1080, 4444) commonly used by bot malware for C2 check-ins"
mitre_attack_tactic = "Resource Development"
mitre_attack_technique = "T1584.005"
mitre_attack_subtechnique = "Botnet"
severity = "HIGH"
confidence = "HIGH"
created = "2024-01-01"
modified = "2024-01-01"
reference = "https://attack.mitre.org/techniques/T1584/005/"
events:
$net.metadata.event_type = "NETWORK_CONNECTION"
$net.network.direction = "OUTBOUND"
not net.ip_in_range_cidr($net.target.ip, "10.0.0.0/8")
not net.ip_in_range_cidr($net.target.ip, "172.16.0.0/12")
not net.ip_in_range_cidr($net.target.ip, "192.168.0.0/16")
not net.ip_in_range_cidr($net.target.ip, "127.0.0.0/8")
not net.ip_in_range_cidr($net.target.ip, "169.254.0.0/16")
(
$net.target.port = 6667 or
$net.target.port = 6697 or
$net.target.port = 6660 or
$net.target.port = 6661 or
$net.target.port = 6662 or
$net.target.port = 6663 or
$net.target.port = 6664 or
$net.target.port = 6665 or
$net.target.port = 6666 or
$net.target.port = 6668 or
$net.target.port = 6669 or
$net.target.port = 1080 or
$net.target.port = 4444
)
$hostname = $net.principal.hostname
$dst_ip = $net.target.ip
$dst_port = $net.target.port
match:
$hostname, $dst_ip, $dst_port over 24h
outcome:
$total_connections = count_distinct($net.metadata.id)
$src_ips = array_distinct($net.principal.ip)
$process_paths = array_distinct($net.principal.process.file.full_path)
$first_seen = min($net.metadata.event_timestamp.seconds)
$last_seen = max($net.metadata.event_timestamp.seconds)
$bytes_sent = sum($net.network.sent_bytes)
$bytes_received = sum($net.network.received_bytes)
condition:
#net >= 20
} Chronicle YARA-L 2.0 rule detecting botnet node behavior by identifying hosts that make 20 or more outbound connections over a 24-hour sliding window to external IPs on IRC C2 or bot proxy ports. The match clause groups by hostname, destination IP, and destination port, so each unique (host, dst_ip, dst_port) tuple is evaluated independently. The port filter covers the full IRC range (6660–6669), IRC-over-TLS (6697), SOCKS proxy (1080), and generic backdoor/RAT port (4444). All RFC1918, loopback, and link-local ranges are excluded via net.ip_in_range_cidr. Outcome fields provide bytes transferred and process path context for analyst triage.
Data Sources
Required Tables
False Positives & Tuning
- Authorized IRC server infrastructure or legitimate IRC bot frameworks used for internal ChatOps pipelines — add destination IP allowlist entries as reference list exceptions in the rule condition
- SOCKS5 enterprise proxy appliances accepting connections on port 1080 from clients — create a Chronicle reference list of approved proxy server IPs and add not $dst_ip in %approved_proxy_ips to the events section
- Security research or malware sandbox environments that deliberately replicate botnet traffic patterns during controlled analysis — exclude sandbox host principals by hostname prefix or IP range in the events block
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.