Detection rules › Elastic
Unexpected SMB Connection from User-mode Process
Identifies unexpected processes making network connections over port 445. Windows File Sharing is typically implemented over Server Message Block (SMB), which communicates between hosts using port 445. When legitimate, these network connections are established by the kernel. Processes making 445/tcp connections may be port scanners, exploits, or suspicious user-level processes moving laterally.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Lateral Movement |
Rule body
[rule]
description = """
Identifies unexpected processes making network connections over port 445. Windows File Sharing is typically implemented
over Server Message Block (SMB), which communicates between hosts using port 445. When legitimate, these network
connections are established by the kernel. Processes making 445/tcp connections may be port scanners, exploits, or
suspicious user-level processes moving laterally.
"""
id = "2fbbd139-3919-4b6b-9c50-9452b0aef005"
license = "Elastic License v2"
name = "Unexpected SMB Connection from User-mode Process"
os_list = ["windows"]
version = "1.0.39"
query = '''
sequence by process.entity_id with maxspan=1m
[process where event.action == "start" and
process.executable : "?:\\Windows\\*.exe" and
/* Issue #338 */
not (process.code_signature.subject_name : ("RAPIDFIRE TOOLS INC.", "KASEYA US LLC", "Kaseya Holdings Inc", "Veeam Software Group GmbH", "TYCHON, LLC") and
process.code_signature.trusted == true) and
not (process.executable : "C:\\Windows\\System32\\conhost.exe" and
process.parent.executable :
("C:\\Program Files (x86)\\CyberCNSAgentV2\\osqueryi.exe",
"C:\\Program Files (x86)\\BeAnywhere Support Express\\GetSupportService_N-Central\\TCIntegratorCommHelper.exe")) and
not user.id : ("S-1-5-19", "S-1-5-20")]
[network where network.direction == "egress" and
destination.port == 445 and source.port >= 49152 and
not process.executable :
("?:\\Windows\\System32\\MicrosoftEdgeCP.exe",
"?:\\Windows\\System32\\inetsrv\\w3wp.exe",
"?:\\Windows\\SysWOW64\\inetsrv\\w3wp.exe",
"?:\\Windows\\System32\\wsmprovhost.exe",
"?:\\Windows\\System32\\mmc.exe",
"?:\\Windows\\SysWOW64\\mmc.exe",
"?:\\Windows\\System32\\svchost.exe",
"?:\\Windows\\System32\\WerFault.exe",
"?:\\Windows\\System32\\userinit.exe",
"?:\\Windows\\System32\\vpc.exe",
"?:\\Windows\\SysWOW64\\vmnat.exe",
"?:\\Windows\\System32\\telnet.exe",
"?:\\windows\\system32\\windowspowershell\\v*\\powershell.exe",
"?:\\windows\\SysWOW64\\windowspowershell\\v*\\powershell.exe",
"?:\\windows\\system32\\windowspowershell\\v*\\powershell_ise.exe",
"?:\\Windows\\NetworkDetective-RDC-*\\nacmdline.exe",
"?:\\Windows\\ProPatches\\Installation\\InstallationSandbox*\\stdeploy.exe",
"?:\\Windows\\System32\\ctfmon.exe",
"?:\\Windows\\SysWOW64\\ctfmon.exe",
"?:\\Windows\\System32\\OpenSSH\\ssh.exe",
"?:\\Windows\\LTSvc\\packages\\RFT\\NDDC\\nddc.exe")]
'''
min_endpoint_version = "7.16.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1021"
name = "Remote Services"
reference = "https://attack.mitre.org/techniques/T1021/"
[[threat.technique.subtechnique]]
id = "T1021.002"
name = "SMB/Windows Admin Shares"
reference = "https://attack.mitre.org/techniques/T1021/002/"
[threat.tactic]
id = "TA0008"
name = "Lateral Movement"
reference = "https://attack.mitre.org/tactics/TA0008/"
[internal]
min_endpoint_version = "7.16.0"
Stages and Predicates
Ordered sequence: each step below must occur in order within 1m, correlated by process.entity_id.
Stage 1: process
[process where event.action == "start" and
process.executable : "?:\\Windows\\*.exe" and
not (process.code_signature.subject_name : ("RAPIDFIRE TOOLS INC.", "KASEYA US LLC", "Kaseya Holdings Inc", "Veeam Software Group GmbH", "TYCHON, LLC") and
process.code_signature.trusted == true) and
not (process.executable : "C:\\Windows\\System32\\conhost.exe" and
process.parent.executable :
("C:\\Program Files (x86)\\CyberCNSAgentV2\\osqueryi.exe",
"C:\\Program Files (x86)\\BeAnywhere Support Express\\GetSupportService_N-Central\\TCIntegratorCommHelper.exe")) and
not user.id : ("S-1-5-19", "S-1-5-20")]
Stage 2: network
[network where network.direction == "egress" and
destination.port == 445 and source.port >= 49152 and
not process.executable :
("?:\\Windows\\System32\\MicrosoftEdgeCP.exe",
"?:\\Windows\\System32\\inetsrv\\w3wp.exe",
"?:\\Windows\\SysWOW64\\inetsrv\\w3wp.exe",
"?:\\Windows\\System32\\wsmprovhost.exe",
"?:\\Windows\\System32\\mmc.exe",
"?:\\Windows\\SysWOW64\\mmc.exe",
"?:\\Windows\\System32\\svchost.exe",
"?:\\Windows\\System32\\WerFault.exe",
"?:\\Windows\\System32\\userinit.exe",
"?:\\Windows\\System32\\vpc.exe",
"?:\\Windows\\SysWOW64\\vmnat.exe",
"?:\\Windows\\System32\\telnet.exe",
"?:\\windows\\system32\\windowspowershell\\v*\\powershell.exe",
"?:\\windows\\SysWOW64\\windowspowershell\\v*\\powershell.exe",
"?:\\windows\\system32\\windowspowershell\\v*\\powershell_ise.exe",
"?:\\Windows\\NetworkDetective-RDC-*\\nacmdline.exe",
"?:\\Windows\\ProPatches\\Installation\\InstallationSandbox*\\stdeploy.exe",
"?:\\Windows\\System32\\ctfmon.exe",
"?:\\Windows\\SysWOW64\\ctfmon.exe",
"?:\\Windows\\System32\\OpenSSH\\ssh.exe",
"?:\\Windows\\LTSvc\\packages\\RFT\\NDDC\\nddc.exe")]
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.code_signature.subject_name | eq | RAPIDFIRE TOOLS INC., KASEYA US LLC, Kaseya Holdings Inc, Veeam Software Group GmbH, TYCHON, LLC | excludes:process.code_signature.subject_name |
process.code_signature.trusted | eq | true | excludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true" |
process.executable | eq | C:\Windows\System32\conhost.exe | excludes:process.executable field:"process.executable" value:"C:\Windows\System32\conhost.exe" |
process.parent.executable | eq | C:\Program Files (x86)\CyberCNSAgentV2\osqueryi.exe, C:\Program Files (x86)\BeAnywhere Support Express\GetSupportService_N-Central\TCIntegratorCommHelper.exe | excludes:process.parent.executable field:"process.parent.executable" value:"C:\Program Files (x86)\CyberCNSAgentV2\osqueryi.exe" field:"process.parent.executable" value:"C:\Program Files (x86)\BeAnywhere Support Express\GetSupportService_N-Central\TCIntegratorCommHelper.exe" |
user.id | eq | S-1-5-19, S-1-5-20 | excludes:user.id field:"user.id" value:"S-1-5-19" field:"user.id" value:"S-1-5-20" |
process.executable | wildcard | ?:\Windows\System32\MicrosoftEdgeCP.exe, ?:\Windows\System32\inetsrv\w3wp.exe, ?:\Windows\SysWOW64\inetsrv\w3wp.exe, ?:\Windows\System32\wsmprovhost.exe, ?:\Windows\System32\mmc.exe, ?:\Windows\SysWOW64\mmc.exe, ?:\Windows\System32\svchost.exe, ?:\Windows\System32\WerFault.exe, ?:\Windows\System32\userinit.exe, ?:\Windows\System32\vpc.exe, ?:\Windows\SysWOW64\vmnat.exe, ?:\Windows\System32\telnet.exe, ?:\windows\system32\windowspowershell\v*\powershell.exe, ?:\windows\SysWOW64\windowspowershell\v*\powershell.exe, ?:\windows\system32\windowspowershell\v*\powershell_ise.exe, ?:\Windows\NetworkDetective-RDC-*\nacmdline.exe, ?:\Windows\ProPatches\Installation\InstallationSandbox*\stdeploy.exe, ?:\Windows\System32\ctfmon.exe, ?:\Windows\SysWOW64\ctfmon.exe, ?:\Windows\System32\OpenSSH\ssh.exe, ?:\Windows\LTSvc\packages\RFT\NDDC\nddc.exe | excludes:process.executable |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
destination.port | eq |
| field:"DestinationPort" kind:eq value:"445" |
event.action | eq |
| field:"EventType" kind:eq value:"start" |
network.direction | eq |
| field:"Initiated" kind:eq value:"egress" |
process.executable | wildcard |
| field:"Image" kind:wildcard value:"?:\Windows\*.exe" |
source.port | ge |
| field:"SourcePort" kind:ge value:"49152" |