Detection rules › Elastic
Suspicious Service ImagePath Value
Identifies the creation of a Windows service with a suspicious ImagePath value. Adversaries may use this technique to maintain persistence or run with System privileges.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Persistence |
Rule body
[rule]
description = """
Identifies the creation of a Windows service with a suspicious ImagePath value. Adversaries may use this technique to
maintain persistence or run with System privileges.
"""
id = "d6bb94ed-3df3-426f-8274-f6c4fb9b864d"
license = "Elastic License v2"
name = "Suspicious Service ImagePath Value"
os_list = ["windows"]
version = "1.0.18"
query = '''
registry where registry.path : "HKLM\\SYSTEM\\*ControlSet*\\Services\\*\\ImagePath" and
registry.data.strings != null and
registry.data.strings : ("*COMSPEC*", "*\\172.0.0.1*", "*Admin$*", "*powershell*", "*rundll32*", "*NTDS\\ntds.dit*",
"*HarddiskVolumeShadowCopy*") and
not registry.data.strings :
("?:\\Windows\\system32\\rundll32.exe ?:\\Windows\\SYSTEM32\\INTERP~2.DLL,eb_service",
"%SystemRoot%\\System32\\rundll32.exe \"C:\\Windows\\Downloaded Program Files\\urxdialer.dll\",EmergencyCleanup",
"%COMSPEC% /Q /c start*pzaS5TZXJ2aWNlTmFtZSA9ICJPMjRBVVRIIjs*",
"\"C:\\Program Files (x86)\\*", "\"C:\\Program Files\\*")
'''
actions = []
min_endpoint_version = "8.4.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.4.0"
Stages and Predicates
Stage 1: registry
registry where registry.path : "HKLM\\SYSTEM\\*ControlSet*\\Services\\*\\ImagePath" and
registry.data.strings != null and
registry.data.strings : ("*COMSPEC*", "*\\172.0.0.1*", "*Admin$*", "*powershell*", "*rundll32*", "*NTDS\\ntds.dit*",
"*HarddiskVolumeShadowCopy*") and
not registry.data.strings :
("?:\\Windows\\system32\\rundll32.exe ?:\\Windows\\SYSTEM32\\INTERP~2.DLL,eb_service",
"%SystemRoot%\\System32\\rundll32.exe \"C:\\Windows\\Downloaded Program Files\\urxdialer.dll\",EmergencyCleanup",
"%COMSPEC% /Q /c start*pzaS5TZXJ2aWNlTmFtZSA9ICJPMjRBVVRIIjs*",
"\"C:\\Program Files (x86)\\*", "\"C:\\Program Files\\*")
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
registry.data.strings | wildcard | ?:\Windows\system32\rundll32.exe ?:\Windows\SYSTEM32\INTERP~2.DLL,eb_service, %SystemRoot%\System32\rundll32.exe "C:\Windows\Downloaded Program Files\urxdialer.dll",EmergencyCleanup, %COMSPEC% /Q /c start*pzaS5TZXJ2aWNlTmFtZSA9ICJPMjRBVVRIIjs*, "C:\Program Files (x86)\*, "C:\Program Files\* | excludes:registry.data.strings |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
registry.data.strings | is_not_null | field:"Details" kind:is_not_null | |
registry.data.strings | wildcard |
| field:"Details" kind:wildcard |
registry.path | wildcard |
| field:"TargetObject" kind:wildcard value:"HKLM\SYSTEM\*ControlSet*\Services\*\ImagePath" |