Detection rules › Elastic

Suspicious Windows Service DLL Creation

Source
github.com/elastic/protections-artifacts

Identifies the creation of a new service via ServiceDLL registry modification instead of using the Windows Service Control Manager APIs, subsequently loaded by svchost.exe. Adversaries may use this technique to maintain persistence or run with System privileges.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Identifies the creation of a new service via ServiceDLL registry modification instead of using the Windows Service
Control Manager APIs, subsequently loaded by svchost.exe. Adversaries may use this technique to maintain persistence or
run with System privileges.
"""
id = "2c624716-75a1-42d9-bcb8-1defcb9bded9"
license = "Elastic License v2"
name = "Suspicious Windows Service DLL Creation"
os_list = ["windows"]
version = "1.0.36"

query = '''
registry where event.action == "modification" and 
 registry.value : "ServiceDLL" and process.executable : ("?:\\*", "\\Device\\Mup\\*") and
 not process.executable : ("?:\\Windows\\System32\\services.exe",
                           "?:\\Windows\\System32\\msiexec.exe",
                           "?:\\Windows\\SysWOW64\\msiexec.exe",
                           "?:\\Windows\\System32\\poqexec.exe",
                           "?:\\Windows\\System32\\w32tm.exe",
                           "?:\\Windows\\System32\\spoolsv.exe",
                           "?:\\Windows\\servicing\\TrustedInstaller.exe",
                           "?:\\Windows\\System32\\sdiagnhost.exe",
                           "?:\\Windows\\WinSxS\\*\\TiWorker.exe",
                           "?:\\Windows\\System32\\drvinst.exe",
                           "?:\\Program Files (x86)\\*.exe",
                           "?:\\Program Files\\*.exe",
                           "?:\\Windows\\Temp\\*-*-*\\DismHost.exe",
                           "?:\\$WINDOWS.~BT\\Work\\*\\DismHost.exe",
                           "?:\\$WinREAgent\\Scratch\\*\\DismHost.exe",
                           "?:\\Windows\\SoftwareDistribution\\*.exe",
                           "?:\\Windows\\regedit.exe",
                           "?:\\Windows\\System32\\reg.exe",
                           "?:\\Windows\\System32\\lsass.exe",
                           "?:\\Windows\\System32\\upfc.exe",
                           "?:\\Windows\\System32\\SearchProtocolHost.exe",
                           "?:\\Windows\\SystemApps\\Microsoft.Windows.Search_*\\SearchApp.exe",
                           "?:\\Windows\\System32\\conhost.exe",
                           "?:\\Windows\\System32\\oobe\\UserOOBEBroker.exe",
                           "?:\\Windows\\CCM\\SCNotification.exe",
                           "?:\\Windows\\System32\\PrintIsolationHost.exe",
                           "?:\\Windows\\System32\\sppsvc.exe",
                           "?:\\Windows\\System32\\backgroundTaskHost.exe",
                           "?:\\*\\procexp64.exe",
                           "C:\\Windows\\SystemTemp\\*\\DismHost.exe") and

 not (process.executable : ("?:\\Windows\\System32\\svchost.exe",
                            "?:\\Windows\\System32\\regsvr32.exe",
                            "?:\\Windows\\SysWOW64\\regsvr32.exe",
                            "?:\\Users\\*\\AppData\\Local\\Temp\\*\\DismHost.exe",
                            "?:\\Windows\\Temp\\osrssinst.exe",
                            "?:\\Windows\\regedit.exe",
                            "?:\\$WINDOWS.~BT\\Work\\*\\DismHost.exe") and
      registry.data.strings : ("%systemroot%\\system32\\*", "?:\\Windows\\System32\\*", "%systemroot%\\syswow64\\*",
                               "?:\\Windows\\SysWOW64\\*", "*:\\Program Files\\*", "*:\\Program Files (x86)\\*")) and

 not registry.data.strings : "?:\\WINDOWS\\system32\\spool\\drivers\\x64\\3\\PrintConfig.dll" and

 not (registry.data.strings : "?:\\Program Files (x86)\\dolphinpaper\\provider\\wpprovider.dll" and
      registry.path : "HKLM\\SYSTEM\\ControlSet*\\Services\\dolphinSvc\\Parameters\\ServiceDll") and

 not (process.code_signature.subject_name : ("Speckled Jay LLC", "Refraction Point, Inc", "Arcadia Laboratories Inc.") and process.code_signature.trusted == true) and

 not (process.name : "Dismhost.exe" and registry.data.strings : ("%systemroot%\\system32\\wuaueng.dll", "%SystemRoot%\\System32\\browser.dll") and
      process.code_signature.subject_name : "Microsoft*" and process.code_signature.trusted == true)
'''

min_endpoint_version = "8.1.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1543"
name = "Create or Modify System Process"
reference = "https://attack.mitre.org/techniques/T1543/"
[[threat.technique.subtechnique]]
id = "T1543.003"
name = "Windows Service"
reference = "https://attack.mitre.org/techniques/T1543/003/"



[threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"

[internal]
min_endpoint_version = "8.1.0"

Stages and Predicates

Stage 1: registry

registry where event.action == "modification" and 
 registry.value : "ServiceDLL" and process.executable : ("?:\\*", "\\Device\\Mup\\*") and
 not process.executable : ("?:\\Windows\\System32\\services.exe",
                           "?:\\Windows\\System32\\msiexec.exe",
                           "?:\\Windows\\SysWOW64\\msiexec.exe",
                           "?:\\Windows\\System32\\poqexec.exe",
                           "?:\\Windows\\System32\\w32tm.exe",
                           "?:\\Windows\\System32\\spoolsv.exe",
                           "?:\\Windows\\servicing\\TrustedInstaller.exe",
                           "?:\\Windows\\System32\\sdiagnhost.exe",
                           "?:\\Windows\\WinSxS\\*\\TiWorker.exe",
                           "?:\\Windows\\System32\\drvinst.exe",
                           "?:\\Program Files (x86)\\*.exe",
                           "?:\\Program Files\\*.exe",
                           "?:\\Windows\\Temp\\*-*-*\\DismHost.exe",
                           "?:\\$WINDOWS.~BT\\Work\\*\\DismHost.exe",
                           "?:\\$WinREAgent\\Scratch\\*\\DismHost.exe",
                           "?:\\Windows\\SoftwareDistribution\\*.exe",
                           "?:\\Windows\\regedit.exe",
                           "?:\\Windows\\System32\\reg.exe",
                           "?:\\Windows\\System32\\lsass.exe",
                           "?:\\Windows\\System32\\upfc.exe",
                           "?:\\Windows\\System32\\SearchProtocolHost.exe",
                           "?:\\Windows\\SystemApps\\Microsoft.Windows.Search_*\\SearchApp.exe",
                           "?:\\Windows\\System32\\conhost.exe",
                           "?:\\Windows\\System32\\oobe\\UserOOBEBroker.exe",
                           "?:\\Windows\\CCM\\SCNotification.exe",
                           "?:\\Windows\\System32\\PrintIsolationHost.exe",
                           "?:\\Windows\\System32\\sppsvc.exe",
                           "?:\\Windows\\System32\\backgroundTaskHost.exe",
                           "?:\\*\\procexp64.exe",
                           "C:\\Windows\\SystemTemp\\*\\DismHost.exe") and

 not (process.executable : ("?:\\Windows\\System32\\svchost.exe",
                            "?:\\Windows\\System32\\regsvr32.exe",
                            "?:\\Windows\\SysWOW64\\regsvr32.exe",
                            "?:\\Users\\*\\AppData\\Local\\Temp\\*\\DismHost.exe",
                            "?:\\Windows\\Temp\\osrssinst.exe",
                            "?:\\Windows\\regedit.exe",
                            "?:\\$WINDOWS.~BT\\Work\\*\\DismHost.exe") and
      registry.data.strings : ("%systemroot%\\system32\\*", "?:\\Windows\\System32\\*", "%systemroot%\\syswow64\\*",
                               "?:\\Windows\\SysWOW64\\*", "*:\\Program Files\\*", "*:\\Program Files (x86)\\*")) and

 not registry.data.strings : "?:\\WINDOWS\\system32\\spool\\drivers\\x64\\3\\PrintConfig.dll" and

 not (registry.data.strings : "?:\\Program Files (x86)\\dolphinpaper\\provider\\wpprovider.dll" and
      registry.path : "HKLM\\SYSTEM\\ControlSet*\\Services\\dolphinSvc\\Parameters\\ServiceDll") and

 not (process.code_signature.subject_name : ("Speckled Jay LLC", "Refraction Point, Inc", "Arcadia Laboratories Inc.") and process.code_signature.trusted == true) and

 not (process.name : "Dismhost.exe" and registry.data.strings : ("%systemroot%\\system32\\wuaueng.dll", "%SystemRoot%\\System32\\browser.dll") and
      process.code_signature.subject_name : "Microsoft*" and process.code_signature.trusted == true)

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.code_signature.subject_nameeqSpeckled Jay LLC, Refraction Point, Inc, Arcadia Laboratories Inc.excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Speckled Jay LLC" field:"process.code_signature.subject_name" value:"Refraction Point, Inc" field:"process.code_signature.subject_name" value:"Arcadia Laboratories Inc."
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.code_signature.subject_namestarts_withMicrosoftexcludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Microsoft"
process.nameeqDismhost.exeexcludes:process.name field:"process.name" value:"Dismhost.exe"
registry.data.stringseq%systemroot%\system32\wuaueng.dll, %SystemRoot%\System32\browser.dllexcludes:registry.data.strings field:"registry.data.strings" value:"%systemroot%\system32\wuaueng.dll" field:"registry.data.strings" value:"%SystemRoot%\System32\browser.dll"
process.executablewildcard?:\Windows\System32\svchost.exe, ?:\Windows\System32\regsvr32.exe, ?:\Windows\SysWOW64\regsvr32.exe, ?:\Users\*\AppData\Local\Temp\*\DismHost.exe, ?:\Windows\Temp\osrssinst.exe, ?:\Windows\regedit.exe, ?:\$WINDOWS.~BT\Work\*\DismHost.exeexcludes:process.executable
registry.data.stringswildcard%systemroot%\system32\*, ?:\Windows\System32\*, %systemroot%\syswow64\*, ?:\Windows\SysWOW64\*, *:\Program Files\*, *:\Program Files (x86)\*excludes:registry.data.strings
registry.data.stringseq?:\Program Files (x86)\dolphinpaper\provider\wpprovider.dllexcludes:registry.data.strings field:"registry.data.strings" value:"?:\Program Files (x86)\dolphinpaper\provider\wpprovider.dll"
registry.pathwildcardHKLM\SYSTEM\ControlSet*\Services\dolphinSvc\Parameters\ServiceDllexcludes:registry.path field:"registry.path" value:"HKLM\SYSTEM\ControlSet*\Services\dolphinSvc\Parameters\ServiceDll"
process.executablewildcard?:\Windows\System32\services.exe, ?:\Windows\System32\msiexec.exe, ?:\Windows\SysWOW64\msiexec.exe, ?:\Windows\System32\poqexec.exe, ?:\Windows\System32\w32tm.exe, ?:\Windows\System32\spoolsv.exe, ?:\Windows\servicing\TrustedInstaller.exe, ?:\Windows\System32\sdiagnhost.exe, ?:\Windows\WinSxS\*\TiWorker.exe, ?:\Windows\System32\drvinst.exe, ?:\Program Files (x86)\*.exe, ?:\Program Files\*.exe, ?:\Windows\Temp\*-*-*\DismHost.exe, ?:\$WINDOWS.~BT\Work\*\DismHost.exe, ?:\$WinREAgent\Scratch\*\DismHost.exe, ?:\Windows\SoftwareDistribution\*.exe, ?:\Windows\regedit.exe, ?:\Windows\System32\reg.exe, ?:\Windows\System32\lsass.exe, ?:\Windows\System32\upfc.exe, ?:\Windows\System32\SearchProtocolHost.exe, ?:\Windows\SystemApps\Microsoft.Windows.Search_*\SearchApp.exe, ?:\Windows\System32\conhost.exe, ?:\Windows\System32\oobe\UserOOBEBroker.exe, ?:\Windows\CCM\SCNotification.exe, ?:\Windows\System32\PrintIsolationHost.exe, ?:\Windows\System32\sppsvc.exe, ?:\Windows\System32\backgroundTaskHost.exe, ?:\*\procexp64.exe, C:\Windows\SystemTemp\*\DismHost.exeexcludes:process.executable
registry.data.stringseq?:\WINDOWS\system32\spool\drivers\x64\3\PrintConfig.dllexcludes:registry.data.strings field:"registry.data.strings" value:"?:\WINDOWS\system32\spool\drivers\x64\3\PrintConfig.dll"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • modification corpus 72 (elastic 72)
field:"EventType" kind:eq value:"modification"
process.executablewildcard
  • ?:\* corpus 18 (elastic 18)
  • \Device\Mup\* corpus 8 (elastic 8)
field:"Image" kind:wildcard
registry.valuewildcard
  • ServiceDLL corpus 2 (elastic 2)
field:"registry_value_name" kind:wildcard value:"ServiceDLL"