Detection rules › Elastic

Suspicious Windows Service Execution

Source
github.com/elastic/protections-artifacts

Identifies the execution of a Windows service from suspicious path such as mounted localhost admin share. This may indicate an attempt to elevate privileges via windows services.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Identifies the execution of a Windows service from suspicious path such as mounted localhost admin share. This may
indicate an attempt to elevate privileges via windows services.
"""
id = "cd25c529-73b4-4a9d-84a9-e24c4a3540d1"
license = "Elastic License v2"
name = "Suspicious Windows Service Execution"
os_list = ["windows"]
reference = ["https://www.elastic.co/security-labs/twice-around-the-dance-floor-with-pipedance"]
version = "1.0.31"

query = '''
process where event.action == "start" and
  process.parent.name : "services.exe" and
  process.Ext.token.integrity_level_name == "system" and
  (
   process.executable : ("\\\\127.0.0.1\\*", "\\Device\\Mup\\*\\c$\\*", "\\Device\\Mup\\*\\ADMIN$\\*") or

   /* Silver psexec default pattern */
   (process.command_line : "?:\\windows\\Temp\\*.exe \"\"" and process.args_count == 2)
   ) and
   not process.executable : ("\\\\ENT*\\admin$\\smstsvc_passive_*.exe", "\\Device\\Mup\\*\\c$\\Program Files\\SIXPaymentServicesLtd\\*\\eftdvs.exe")
'''

min_endpoint_version = "7.15.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 = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: process

process where event.action == "start" and
  process.parent.name : "services.exe" and
  process.Ext.token.integrity_level_name == "system" and
  (
   process.executable : ("\\\\127.0.0.1\\*", "\\Device\\Mup\\*\\c$\\*", "\\Device\\Mup\\*\\ADMIN$\\*") or
   (process.command_line : "?:\\windows\\Temp\\*.exe \"\"" and process.args_count == 2)
   ) and
   not process.executable : ("\\\\ENT*\\admin$\\smstsvc_passive_*.exe", "\\Device\\Mup\\*\\c$\\Program Files\\SIXPaymentServicesLtd\\*\\eftdvs.exe")

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executablewildcard\\ENT*\admin$\smstsvc_passive_*.exe, \Device\Mup\*\c$\Program Files\SIXPaymentServicesLtd\*\eftdvs.exeexcludes:process.executable field:"process.executable" value:"\\ENT*\admin$\smstsvc_passive_*.exe" field:"process.executable" value:"\Device\Mup\*\c$\Program Files\SIXPaymentServicesLtd\*\eftdvs.exe"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 391 (elastic 391)
field:"EventType" kind:eq value:"start"
process.Ext.token.integrity_level_nameeq
  • system corpus 14 (elastic 14)
field:"process.Ext.token.integrity_level_name" kind:eq value:"system"
process.args_counteq
  • 2 transforms: number corpus 37 (elastic 37)
field:"process.args_count" kind:eq value:"2"
process.command_linewildcard
  • ?:\windows\Temp\*.exe ""
field:"CommandLine" kind:wildcard
process.executablewildcard
  • \Device\Mup\*\ADMIN$\*
  • \Device\Mup\*\c$\*
  • \\127.0.0.1\*
field:"Image" kind:wildcard
process.parent.namewildcard
  • services.exe corpus 12 (elastic 8, splunk 3, kusto 1)
field:"parent_process_name" kind:wildcard value:"services.exe"