Detect Botnet in IBM QRadar
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/
QRadar Detection Query
SELECT
sourceip,
destinationip,
destinationport,
COUNT(*) AS connection_count,
COUNT(DISTINCT DATEFORMAT(starttime, 'yyyy-MM-dd HH')) AS hourly_buckets,
SUM(bytessent) AS bytes_sent,
SUM(bytesreceived) AS bytes_received,
MIN(DATEFORMAT(starttime, 'yyyy-MM-dd HH:mm:ss')) AS first_seen,
MAX(DATEFORMAT(starttime, 'yyyy-MM-dd HH:mm:ss')) AS last_seen,
CASE
WHEN destinationport IN (6660,6661,6662,6663,6664,6665,6666,6667,6668,6669,6697,1080,4444) THEN 3
WHEN COUNT(*) > 200 THEN 2
WHEN COUNT(*) > 100 THEN 1
ELSE 1
END AS beaconing_score
FROM flows
WHERE
NOT INCIDR('10.0.0.0/8', destinationip)
AND NOT INCIDR('172.16.0.0/12', destinationip)
AND NOT INCIDR('192.168.0.0/16', destinationip)
AND NOT INCIDR('127.0.0.0/8', destinationip)
AND NOT INCIDR('169.254.0.0/16', destinationip)
AND NOT INCIDR('::1/128', destinationip)
GROUP BY sourceip, destinationip, destinationport
HAVING
COUNT(*) >= 20
AND COUNT(DISTINCT DATEFORMAT(starttime, 'yyyy-MM-dd HH')) >= 3
ORDER BY beaconing_score DESC, connection_count DESC
LAST 24 HOURS QRadar AQL query against the flows table detecting botnet node behavior through sustained outbound connections to external IP addresses. Groups flow records by source IP, destination IP, and destination port over 24 hours using the LAST clause. The HAVING filter requires at least 20 total connections across 3 or more distinct hourly buckets (derived via COUNT DISTINCT on DATEFORMAT truncated to the hour), eliminating single-burst events. Beaconing score is computed inline via CASE: IRC C2 port hits score 3, high-volume connections score 1–2. All RFC1918, loopback, and link-local ranges are excluded using INCIDR.
Data Sources
Required Tables
False Positives & Tuning
- CDN health probes and synthetic monitoring agents generating sustained high-frequency flows from application servers to external monitoring endpoints — add HAVING exclusions for known CDN source IP ranges
- Authorized network scanners such as Nessus, Qualys, or Rapid7 Nexpose running credentialed scans from internal hosts to external IP space — correlate sourceip against scanner asset inventory
- IRC-based ChatOps bots or DevOps automation tools connecting to authorized IRC servers on port 6667 — create a QRadar reference set of approved IRC server IPs and add NOT REFERENCESETCONTAINS exclusion to the WHERE clause
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.