Detection rules › Elastic

Suspicious Execution via Compiled HTML File

Source
github.com/elastic/protections-artifacts

Identifies when the Microsoft HTML Help Executable (hh.exe) spawn a suspicious child process or open a compiled HTM file from a suspicious location. 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) spawn a suspicious child process or open a compiled HTM file
from a suspicious location. Adversaries may conceal malicious code in a CHM file and deliver it to a victim for
execution.
"""
id = "e2554e2b-7333-4379-88af-67e5bfac677a"
license = "Elastic License v2"
name = "Suspicious Execution via Compiled HTML File"
os_list = ["windows"]
reference = [
    "https://www.ptsecurity.com/ww-en/analytics/pt-esc-threat-intelligence/higaisa-or-winnti-apt-41-backdoors-old-and-new/",
]
version = "1.0.25"

query = '''
process where event.action == "start" and
 (
  (process.parent.executable : "?:\\Windows\\hh.exe" and
   process.name : ("cmd.exe",
                  "powershell.exe",
                  "MSHTA.EXE",
                  "CertUtil.exe",
                  "CertReq.exe",
                  "rundll32.exe",
                  "regsvr32.exe",
                  "MSbuild.exe",
                  "cscript.exe",
                  "wscript.exe",
                  "installutil.exe",
                  "schtasks.exe",
                  "msiexec.exe")) or

  (process.parent.executable : "?:\\Windows\\hh.exe" and (process.code_signature.trusted == false or process.code_signature.exists == false))
  )
'''

min_endpoint_version = "7.15.0"
[[actions]]
action = "kill_process"
field = "process.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 = "7.15.0"

Stages and Predicates

Stage 1: process

process where event.action == "start" and
 (
  (process.parent.executable : "?:\\Windows\\hh.exe" and
   process.name : ("cmd.exe",
                  "powershell.exe",
                  "MSHTA.EXE",
                  "CertUtil.exe",
                  "CertReq.exe",
                  "rundll32.exe",
                  "regsvr32.exe",
                  "MSbuild.exe",
                  "cscript.exe",
                  "wscript.exe",
                  "installutil.exe",
                  "schtasks.exe",
                  "msiexec.exe")) or

  (process.parent.executable : "?:\\Windows\\hh.exe" and (process.code_signature.trusted == false or process.code_signature.exists == false))
  )

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 391 (elastic 391)
field:"EventType" kind:eq value:"start"
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
  • CertReq.exe corpus 20 (elastic 20)
  • CertUtil.exe corpus 44 (elastic 38, splunk 6)
  • MSHTA.EXE corpus 84 (elastic 79, splunk 5)
  • MSbuild.exe corpus 39 (elastic 36, splunk 3)
  • cmd.exe corpus 121 (elastic 92, splunk 29)
  • cscript.exe corpus 67 (elastic 65, splunk 2)
  • installutil.exe corpus 37 (elastic 32, 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)
  • schtasks.exe corpus 30 (elastic 19, splunk 11)
  • wscript.exe corpus 83 (elastic 82, splunk 1)
field:"process_name" kind:wildcard
process.parent.executablewildcard
  • ?:\Windows\hh.exe corpus 2 (elastic 2)
field:"ParentImage" kind:wildcard value:"?:\Windows\hh.exe"