Detection rules › Elastic

Unexpected SMB Connection from User-mode Process

Time window
1m
Sequence by
process.entity_id
Source
github.com/elastic/protections-artifacts

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

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.

FieldKindExcluded valuesSearch
process.code_signature.subject_nameeqRAPIDFIRE TOOLS INC., KASEYA US LLC, Kaseya Holdings Inc, Veeam Software Group GmbH, TYCHON, LLCexcludes:process.code_signature.subject_name
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.executableeqC:\Windows\System32\conhost.exeexcludes:process.executable field:"process.executable" value:"C:\Windows\System32\conhost.exe"
process.parent.executableeqC:\Program Files (x86)\CyberCNSAgentV2\osqueryi.exe, C:\Program Files (x86)\BeAnywhere Support Express\GetSupportService_N-Central\TCIntegratorCommHelper.exeexcludes: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.ideqS-1-5-19, S-1-5-20excludes:user.id field:"user.id" value:"S-1-5-19" field:"user.id" value:"S-1-5-20"
process.executablewildcard?:\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.exeexcludes:process.executable

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
destination.porteq
  • 445 transforms: number corpus 10 (elastic 7, splunk 2, sigma 1)
field:"DestinationPort" kind:eq value:"445"
event.actioneq
  • start corpus 391 (elastic 391)
field:"EventType" kind:eq value:"start"
network.directioneq
  • egress corpus 17 (elastic 17)
field:"Initiated" kind:eq value:"egress"
process.executablewildcard
  • ?:\Windows\*.exe corpus 3 (elastic 3)
field:"Image" kind:wildcard value:"?:\Windows\*.exe"
source.portge
  • 49152 transforms: number corpus 16 (elastic 16)
field:"SourcePort" kind:ge value:"49152"