Detection rules › Elastic

Suspicious Microsoft HTML Help Descendant

Source
github.com/elastic/protections-artifacts

Identifies when the Microsoft HTML Help Executable (hh.exe) creates a suspicious child process. Adversaries may conceal malicious code in a CHM file and deliver it to a victim for execution.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Identifies when the Microsoft HTML Help Executable (hh.exe) creates a suspicious child process. Adversaries may conceal
malicious code in a CHM file and deliver it to a victim for execution.
"""
id = "f79a18a4-e8d8-481f-bf66-04941f7b549a"
license = "Elastic License v2"
name = "Suspicious Microsoft HTML Help Descendant"
os_list = ["windows"]
reference = ["https://attack.mitre.org/techniques/T1218/001/"]
version = "1.0.5"

query = '''
process where event.action == "start" and
 process.parent.executable : "?:\\Windows\\hh.exe" and
 (
  process.name : ("wscript.exe", "cscript.exe", "cmd.exe", "powershell.exe", "rundll32.exe",
                  "regsvr32.exe", "mshta.exe", "msiexec.exe", "msbuild.exe", "conhost.exe", "curl.exe", "xcopy.exe", "expand.exe") or
  (process.Ext.relative_file_creation_time <= 500 and (process.code_signature.trusted == false or process.code_signature.exists == false)) or
  process.pe.original_file_name: ("wscript.exe", "cscript.exe", "cmd.exe", "powershell.exe", "rundll32.exe",
                                  "regsvr32.exe", "mshta.exe", "msiexec.exe", "msbuild.exe", "conhost.exe", "curl.exe", "xcopy.exe", "expand.exe")
  ) and
  not (process.executable : "C:\\Windows\\system32\\conhost.exe" and
       process.command_line : "\\??\\C:\\Windows\\system32\\conhost.exe 0xffffffff -ForceV1") and
  not process.hash.sha256 in ("4535320c5b9596a6210109f68c647dbdbd0289ba63286fd389dea910855491f1",
                              "9440e89e0ea081e3016d6c604a746c74ffd0dbbf5c4c1e03d544a5128d6e1ade",
                              "7902fc0d4483b5bffed560455539f1dd0ea26380318ca4d5e04e5c8c4a7e545d",
                              "cb35afb097cf36892dead09b39ea8dbe2d552daf9b489843e8835e9d7715e418") and
  not (process.executable : ("C:\\Windows\\SysWOW64\\cmd.exe", "C:\\Windows\\SysWOW64\\regsvr32.exe", "C:\\Windows\\SysWOW64\\*\\powershell.exe") and
       not process.parent.name : "hh.exe")
'''

min_endpoint_version = "8.4.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
tree = true

[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0
tree = true

[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1566"
name = "Phishing"
reference = "https://attack.mitre.org/techniques/T1566/"
[[threat.technique.subtechnique]]
id = "T1566.001"
name = "Spearphishing Attachment"
reference = "https://attack.mitre.org/techniques/T1566/001/"



[threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"
[[threat.technique.subtechnique]]
id = "T1218.001"
name = "Compiled HTML File"
reference = "https://attack.mitre.org/techniques/T1218/001/"



[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

[internal]
min_endpoint_version = "8.4.0"

Stages and Predicates

Stage 1: process

process where event.action == "start" and
 process.parent.executable : "?:\\Windows\\hh.exe" and
 (
  process.name : ("wscript.exe", "cscript.exe", "cmd.exe", "powershell.exe", "rundll32.exe",
                  "regsvr32.exe", "mshta.exe", "msiexec.exe", "msbuild.exe", "conhost.exe", "curl.exe", "xcopy.exe", "expand.exe") or
  (process.Ext.relative_file_creation_time <= 500 and (process.code_signature.trusted == false or process.code_signature.exists == false)) or
  process.pe.original_file_name: ("wscript.exe", "cscript.exe", "cmd.exe", "powershell.exe", "rundll32.exe",
                                  "regsvr32.exe", "mshta.exe", "msiexec.exe", "msbuild.exe", "conhost.exe", "curl.exe", "xcopy.exe", "expand.exe")
  ) and
  not (process.executable : "C:\\Windows\\system32\\conhost.exe" and
       process.command_line : "\\??\\C:\\Windows\\system32\\conhost.exe 0xffffffff -ForceV1") and
  not process.hash.sha256 in ("4535320c5b9596a6210109f68c647dbdbd0289ba63286fd389dea910855491f1",
                              "9440e89e0ea081e3016d6c604a746c74ffd0dbbf5c4c1e03d544a5128d6e1ade",
                              "7902fc0d4483b5bffed560455539f1dd0ea26380318ca4d5e04e5c8c4a7e545d",
                              "cb35afb097cf36892dead09b39ea8dbe2d552daf9b489843e8835e9d7715e418") and
  not (process.executable : ("C:\\Windows\\SysWOW64\\cmd.exe", "C:\\Windows\\SysWOW64\\regsvr32.exe", "C:\\Windows\\SysWOW64\\*\\powershell.exe") and
       not process.parent.name : "hh.exe")

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.parent.nameeqhh.exeexcludes:process.parent.name field:"process.parent.name" value:"hh.exe"
process.executablewildcardC:\Windows\SysWOW64\cmd.exe, C:\Windows\SysWOW64\regsvr32.exe, C:\Windows\SysWOW64\*\powershell.exeexcludes:process.executable field:"process.executable" value:"C:\Windows\SysWOW64\cmd.exe" field:"process.executable" value:"C:\Windows\SysWOW64\regsvr32.exe" field:"process.executable" value:"C:\Windows\SysWOW64\*\powershell.exe"
process.command_lineeq\??\C:\Windows\system32\conhost.exe 0xffffffff -ForceV1excludes:process.command_line field:"process.command_line" value:"\??\C:\Windows\system32\conhost.exe 0xffffffff -ForceV1"
process.executableeqC:\Windows\system32\conhost.exeexcludes:process.executable field:"process.executable" value:"C:\Windows\system32\conhost.exe"
process.hash.sha256in4535320c5b9596a6210109f68c647dbdbd0289ba63286fd389dea910855491f1, 7902fc0d4483b5bffed560455539f1dd0ea26380318ca4d5e04e5c8c4a7e545d, 9440e89e0ea081e3016d6c604a746c74ffd0dbbf5c4c1e03d544a5128d6e1ade, cb35afb097cf36892dead09b39ea8dbe2d552daf9b489843e8835e9d7715e418excludes:process.hash.sha256

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.relative_file_creation_timele
  • 500 transforms: number corpus 28 (elastic 28)
field:"process.Ext.relative_file_creation_time" kind:le value:"500"
process.code_signature.existseq
  • false transforms: boolean corpus 119 (elastic 119)
field:"process.code_signature.exists" kind:eq value:"false"
process.code_signature.trustedeq
  • false transforms: boolean corpus 115 (elastic 115)
field:"process.code_signature.trusted" kind:eq value:"false"
process.namewildcard
  • cmd.exe corpus 121 (elastic 92, splunk 29)
  • conhost.exe corpus 12 (elastic 11, splunk 1)
  • cscript.exe corpus 67 (elastic 65, splunk 2)
  • curl.exe corpus 34 (elastic 31, splunk 3)
  • expand.exe corpus 8 (elastic 7, splunk 1)
  • msbuild.exe corpus 39 (elastic 36, splunk 3)
  • mshta.exe corpus 84 (elastic 79, splunk 5)
  • msiexec.exe corpus 46 (elastic 41, splunk 5)
  • powershell.exe corpus 184 (elastic 140, splunk 44)
  • regsvr32.exe corpus 73 (elastic 68, splunk 5)
  • rundll32.exe corpus 126 (elastic 100, splunk 26)
  • wscript.exe corpus 83 (elastic 82, splunk 1)
  • xcopy.exe corpus 10 (elastic 10)
field:"process_name" kind:wildcard
process.parent.executablewildcard
  • ?:\Windows\hh.exe corpus 2 (elastic 2)
field:"ParentImage" kind:wildcard value:"?:\Windows\hh.exe"
process.parent.namewildcard
  • hh.exe corpus 6 (elastic 5, splunk 1)
field:"parent_process_name" kind:wildcard value:"hh.exe"
process.pe.original_file_namewildcard
  • cmd.exe corpus 81 (sigma 43, elastic 21, splunk 17)
  • conhost.exe corpus 3 (sigma 2, elastic 1)
  • cscript.exe corpus 32 (sigma 17, elastic 15)
  • curl.exe corpus 24 (sigma 13, elastic 8, splunk 3)
  • expand.exe
  • msbuild.exe corpus 20 (elastic 15, splunk 4, sigma 1)
  • mshta.exe corpus 40 (elastic 21, sigma 13, splunk 6)
  • msiexec.exe corpus 20 (elastic 11, sigma 5, splunk 4)
  • powershell.exe corpus 138 (sigma 84, splunk 30, elastic 24)
  • regsvr32.exe corpus 37 (sigma 17, elastic 15, splunk 5)
  • rundll32.exe corpus 78 (sigma 35, elastic 22, splunk 21)
  • wscript.exe corpus 38 (elastic 21, sigma 17)
  • xcopy.exe corpus 5 (sigma 4, elastic 1)
field:"OriginalFileName" kind:wildcard