Detection rules › Elastic

Suspicious Svchost Registry Modification

Source
github.com/elastic/protections-artifacts

Identifies modification of the Windows shared services registry key. Adversaries may use this technique to maintain persistence or run with System privileges.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Identifies modification of the Windows shared services registry key. Adversaries may use this technique to maintain
persistence or run with System privileges.
"""
id = "055ce112-f2ad-418b-bce1-5fbe46e703fc"
license = "Elastic License v2"
name = "Suspicious Svchost Registry Modification"
os_list = ["windows"]
version = "1.0.21"

query = '''
registry where registry.key : "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Svchost" and

 registry.data.type : "REG_MULTI_SZ" and process.executable : ("?:\\*", "\\Device\\Mup\\*") and registry.data.strings != null and

 not (registry.value : "print" and registry.data.strings : "PrintNotify") and

 not (process.executable : "?:\\Windows\\System32\\poqexec.exe" and user.id : "S-1-5-18") and

 not (process.executable : "?:\\Program Files*\\Microsoft\\AzureAttestService\\AzureAttestServiceInstaller.exe" and
      registry.value : "AzureAttestService") and

 not process.executable :
             ("?:\\Windows\\System32\\msiexec.exe",
              "?:\\Windows\\System32\\svchost.exe",
              "?:\\Windows\\WinSxS\\*\\TiWorker.exe",
              "?:\\Windows\\System32\\drvinst.exe",
              "?:\\Windows\\System32\\spoolsv.exe",
              "?:\\Windows\\System32\\regsvr32.exe",
              "?:\\Windows\\System32\\wbem\\WinMgmt.exe",
              "C:\\Windows\\System32\\PrintIsolationHost.exe",
              "?:\\Windows\\Regedit.exe",
              "?:\\Windows\\VeeamVssSupport\\VeeamGuestHelper.exe",
              "?:\\Program Files\\ForeScout SecureConnector\\SecureConnector.exe",
              "?:\\Program Files\\UVK - Ultra Virus Killer\\UVK_en64.exe",
              "C:\\Windows\\SoftwareDistribution\\Download\\Install\\osrssinst.exe") and
 not (process.code_signature.subject_name == "Arcadia Laboratories Inc." and process.code_signature.trusted == true)
'''

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

[[optional_actions]]
action = "rollback"
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 registry.key : "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Svchost" and

 registry.data.type : "REG_MULTI_SZ" and process.executable : ("?:\\*", "\\Device\\Mup\\*") and registry.data.strings != null and

 not (registry.value : "print" and registry.data.strings : "PrintNotify") and

 not (process.executable : "?:\\Windows\\System32\\poqexec.exe" and user.id : "S-1-5-18") and

 not (process.executable : "?:\\Program Files*\\Microsoft\\AzureAttestService\\AzureAttestServiceInstaller.exe" and
      registry.value : "AzureAttestService") and

 not process.executable :
             ("?:\\Windows\\System32\\msiexec.exe",
              "?:\\Windows\\System32\\svchost.exe",
              "?:\\Windows\\WinSxS\\*\\TiWorker.exe",
              "?:\\Windows\\System32\\drvinst.exe",
              "?:\\Windows\\System32\\spoolsv.exe",
              "?:\\Windows\\System32\\regsvr32.exe",
              "?:\\Windows\\System32\\wbem\\WinMgmt.exe",
              "C:\\Windows\\System32\\PrintIsolationHost.exe",
              "?:\\Windows\\Regedit.exe",
              "?:\\Windows\\VeeamVssSupport\\VeeamGuestHelper.exe",
              "?:\\Program Files\\ForeScout SecureConnector\\SecureConnector.exe",
              "?:\\Program Files\\UVK - Ultra Virus Killer\\UVK_en64.exe",
              "C:\\Windows\\SoftwareDistribution\\Download\\Install\\osrssinst.exe") and
 not (process.code_signature.subject_name == "Arcadia Laboratories Inc." and process.code_signature.trusted == true)

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.code_signature.subject_nameeqArcadia Laboratories Inc.excludes:process.code_signature.subject_name 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.executableeq?:\Windows\System32\poqexec.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\System32\poqexec.exe"
user.ideqS-1-5-18excludes:user.id field:"user.id" value:"S-1-5-18"
process.executablewildcard?:\Program Files*\Microsoft\AzureAttestService\AzureAttestServiceInstaller.exeexcludes:process.executable field:"process.executable" value:"?:\Program Files*\Microsoft\AzureAttestService\AzureAttestServiceInstaller.exe"
registry.valueeqAzureAttestServiceexcludes:registry.value field:"registry.value" value:"AzureAttestService"
registry.data.stringseqPrintNotifyexcludes:registry.data.strings field:"registry.data.strings" value:"PrintNotify"
registry.valueeqprintexcludes:registry.value field:"registry.value" value:"print"
process.executablewildcard?:\Windows\System32\msiexec.exe, ?:\Windows\System32\svchost.exe, ?:\Windows\WinSxS\*\TiWorker.exe, ?:\Windows\System32\drvinst.exe, ?:\Windows\System32\spoolsv.exe, ?:\Windows\System32\regsvr32.exe, ?:\Windows\System32\wbem\WinMgmt.exe, C:\Windows\System32\PrintIsolationHost.exe, ?:\Windows\Regedit.exe, ?:\Windows\VeeamVssSupport\VeeamGuestHelper.exe, ?:\Program Files\ForeScout SecureConnector\SecureConnector.exe, ?:\Program Files\UVK - Ultra Virus Killer\UVK_en64.exe, C:\Windows\SoftwareDistribution\Download\Install\osrssinst.exeexcludes:process.executable

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
process.executablewildcard
  • ?:\* corpus 18 (elastic 18)
  • \Device\Mup\* corpus 8 (elastic 8)
field:"Image" kind:wildcard
registry.data.stringsis_not_null
  • (no value, null check)
field:"Details" kind:is_not_null
registry.data.typewildcard
  • REG_MULTI_SZ
field:"registry.data.type" kind:wildcard value:"REG_MULTI_SZ"
registry.keywildcard
  • SOFTWARE\Microsoft\Windows NT\CurrentVersion\Svchost
field:"TargetObject" kind:wildcard value:"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Svchost"