Detection rules › Splunk
SMB Traffic Spike
The following analytic detects spikes in Server Message Block (SMB) traffic connections, which are used for sharing files and resources between computers. It leverages network traffic logs to monitor connections on ports 139 and 445, and SMB application usage. By calculating the average and standard deviation of SMB connections over the past 70 minutes, it identifies sources exceeding two standard deviations from the average. This activity is significant as it may indicate potential SMB-based attacks, such as ransomware or data theft. If confirmed malicious, attackers could exfiltrate data or spread malware within the network.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Lateral Movement | T1021.002 Remote Services: SMB/Windows Admin Shares |
Rule body splunk
name: SMB Traffic Spike
id: 7f5fb3e1-4209-4914-90db-0ec21b936378
version: 11
creation_date: '2019-10-16'
modification_date: '2026-05-13'
author: David Dorsey, Splunk
status: experimental
type: Anomaly
description: The following analytic detects spikes in Server Message Block (SMB) traffic connections, which are used for sharing files and resources between computers. It leverages network traffic logs to monitor connections on ports 139 and 445, and SMB application usage. By calculating the average and standard deviation of SMB connections over the past 70 minutes, it identifies sources exceeding two standard deviations from the average. This activity is significant as it may indicate potential SMB-based attacks, such as ransomware or data theft. If confirmed malicious, attackers could exfiltrate data or spread malware within the network.
data_source: []
search: |-
| tstats `security_content_summariesonly` count FROM datamodel=Network_Traffic
WHERE All_Traffic.dest_port=139
OR
All_Traffic.dest_port=445
OR
All_Traffic.app=smb
BY _time span=1h, All_Traffic.src
| `drop_dm_object_name("All_Traffic")`
| eventstats max(_time) as maxtime
| stats count as num_data_samples max(eval(if(_time >= relative_time(maxtime, "-70m@m"), count, null))) as count avg(eval(if(_time<relative_time(maxtime, "-70m@m"), count, null))) as avg stdev(eval(if(_time<relative_time(maxtime, "-70m@m"), count, null))) as stdev
BY src
| eval upperBound=(avg+stdev*2), isOutlier=if(count > upperBound AND num_data_samples >=50, 1, 0)
| where isOutlier=1
| table src count
| `smb_traffic_spike_filter`
how_to_implement: This search requires you to be ingesting your network traffic logs and populating the `Network_Traffic` data model.
known_false_positives: A file server may experience high-demand loads that could cause this analytic to trigger.
references: []
intermediate_findings:
entities:
- field: src
type: system
score: 20
message: Anomalous splike of SMB traffic sent from $src$
analytic_story:
- Emotet Malware DHS Report TA18-201A
- Hidden Cobra Malware
- Ransomware
- DHS Report TA18-074A
asset_type: Endpoint
mitre_attack_id:
- T1021.002
product:
- Splunk Enterprise
- Splunk Enterprise Security
- Splunk Cloud
category: network
security_domain: network
Stages and Predicates
Stage 1: tstats
| tstats `security_content_summariesonly` count FROM datamodel=Network_Traffic
WHERE All_Traffic.dest_port=139
OR
All_Traffic.dest_port=445
OR
All_Traffic.app=smb
BY _time span=1h, All_Traffic.src
Stage 2: search
| `drop_dm_object_name("All_Traffic")`
Stage 3: eventstats
| eventstats max(_time) as maxtime
Stage 4: stats
| stats count as num_data_samples max(eval(if(_time >= relative_time(maxtime, "-70m@m"), count, null))) as count avg(eval(if(_time<relative_time(maxtime, "-70m@m"), count, null))) as avg stdev(eval(if(_time<relative_time(maxtime, "-70m@m"), count, null))) as stdev
BY src
Stage 5: eval
| eval upperBound=(avg+stdev*2), isOutlier=if(count > upperBound AND num_data_samples >=50, 1, 0)
isOutlier =count > upperBound AND num_data_samples >= 5010Stage 6: where
| where isOutlier=1
Stage 7: table
| table src count
Stage 8: search
| `smb_traffic_spike_filter`
Indicators
Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.
| Field | Kind | Values |
|---|---|---|
All_Traffic.app | eq |
|
All_Traffic.dest_port | eq |
|
isOutlier | eq |
|