Detection rules › Elastic

Suspicious File Delivery via HTML Smuggling

Time window
30s
Sequence by
process.name
Source
github.com/elastic/protections-artifacts

Identifies the execution of a browser process to open an HTML file followed immediately by the creation of an executable, script or archive file. Adversaries may smuggle data and files past content filters by hiding malicious payloads inside of seemingly benign HTML files.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Identifies the execution of a browser process to open an HTML file followed immediately by the creation of an
executable, script or archive file. Adversaries may smuggle data and files past content filters by hiding malicious
payloads inside of seemingly benign HTML files.
"""
id = "4415ab60-7cff-41dc-b3f0-939bd22c1810"
license = "Elastic License v2"
name = "Suspicious File Delivery via HTML Smuggling"
os_list = ["windows"]
reference = [
    "https://research.nccgroup.com/2017/08/08/smuggling-hta-files-in-internet-explorer-edge/",
    "https://outflank.nl/blog/2018/08/14/html-smuggling-explained/",
]
version = "1.0.26"

query = '''
sequence by process.name with maxspan=30s
 [process where event.action == "start" and
  process.parent.name : "explorer.exe" and
  (
   (process.name in ("chrome.exe", "msedge.exe", "brave.exe", "whale.exe", "browser.exe", "dragon.exe", "vivaldi.exe", "opera.exe")
    and process.args == "--single-argument") or
   (process.name == "iexplore.exe" and process.args_count == 2) or
   (process.name in ("firefox.exe", "waterfox.exe") and process.args == "-url")
  )
  and process.args : ("?:\\Users\\*\\Downloads\\*.htm*",
                      "?:\\Users\\*\\Content.Outlook\\*.htm*",
                      "?:\\Users\\*\\AppData\\Local\\Temp\\Temp?_*.htm*",
                      "?:\\Users\\*\\AppData\\Local\\Temp\\7z*.htm*",
                      "?:\\Users\\*\\AppData\\Local\\Temp\\Rar$*.htm*",
                      "?:\\Users\\*\\AppData\\Local\\Temp\\BNZ.*.htm*")]
 [file where event.action == "rename" and
  process.name in ("chrome.exe", "msedge.exe", "brave.exe", "whale.exe", "browser.exe", "dragon.exe", "vivaldi.exe",
                   "opera.exe", "iexplore", "firefox.exe", "waterfox.exe", "iexplore.exe") and
  file.extension : ("iso", "rar", "zip", "7z", "img", "vhd", "js", "vbs", "wsh", "hta", "cpl", "jse", "vbe") and
  file.path : "?:\\Users\\*\\Downloads\\*" and file.Ext.original.name : ("*.crdownload", "*.part", "*.partial")]
'''

min_endpoint_version = "7.15.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 1

[[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 = "T1027"
name = "Obfuscated Files or Information"
reference = "https://attack.mitre.org/techniques/T1027/"
[[threat.technique.subtechnique]]
id = "T1027.006"
name = "HTML Smuggling"
reference = "https://attack.mitre.org/techniques/T1027/006/"



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

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Ordered sequence: each step below must occur in order within 30s, correlated by process.name.

Stage 1: process

[process where event.action == "start" and
  process.parent.name : "explorer.exe" and
  (
   (process.name in ("chrome.exe", "msedge.exe", "brave.exe", "whale.exe", "browser.exe", "dragon.exe", "vivaldi.exe", "opera.exe")
    and process.args == "--single-argument") or
   (process.name == "iexplore.exe" and process.args_count == 2) or
   (process.name in ("firefox.exe", "waterfox.exe") and process.args == "-url")
  )
  and process.args : ("?:\\Users\\*\\Downloads\\*.htm*",
                      "?:\\Users\\*\\Content.Outlook\\*.htm*",
                      "?:\\Users\\*\\AppData\\Local\\Temp\\Temp?_*.htm*",
                      "?:\\Users\\*\\AppData\\Local\\Temp\\7z*.htm*",
                      "?:\\Users\\*\\AppData\\Local\\Temp\\Rar$*.htm*",
                      "?:\\Users\\*\\AppData\\Local\\Temp\\BNZ.*.htm*")]

Stage 2: file

[file where event.action == "rename" and
  process.name in ("chrome.exe", "msedge.exe", "brave.exe", "whale.exe", "browser.exe", "dragon.exe", "vivaldi.exe",
                   "opera.exe", "iexplore", "firefox.exe", "waterfox.exe", "iexplore.exe") and
  file.extension : ("iso", "rar", "zip", "7z", "img", "vhd", "js", "vbs", "wsh", "hta", "cpl", "jse", "vbe") and
  file.path : "?:\\Users\\*\\Downloads\\*" and file.Ext.original.name : ("*.crdownload", "*.part", "*.partial")]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • rename corpus 22 (elastic 21, sigma 1)
  • start corpus 391 (elastic 391)
field:"EventType" kind:eq
file.Ext.original.namewildcard
  • *.crdownload
  • *.part
  • *.partial
field:"file.Ext.original.name" kind:wildcard
file.extensionwildcard
  • 7z corpus 3 (elastic 3)
  • cpl corpus 19 (elastic 19)
  • hta corpus 20 (elastic 20)
  • img corpus 4 (elastic 4)
  • iso corpus 4 (elastic 4)
  • js corpus 23 (elastic 23)
  • jse corpus 18 (elastic 18)
  • rar corpus 4 (elastic 4)
  • vbe corpus 18 (elastic 18)
  • vbs corpus 19 (elastic 19)
  • vhd corpus 3 (elastic 3)
  • wsh corpus 16 (elastic 16)
  • zip corpus 4 (elastic 4)
field:"file.extension" kind:wildcard
file.pathwildcard
  • ?:\Users\*\Downloads\* corpus 3 (elastic 3)
field:"TargetFilename" kind:wildcard value:"?:\Users\*\Downloads\*"
process.argseq
  • --single-argument corpus 3 (elastic 3)
  • -url corpus 3 (elastic 3)
field:"process.args" kind:eq
process.argswildcard
  • ?:\Users\*\AppData\Local\Temp\7z*.htm* corpus 2 (elastic 2)
  • ?:\Users\*\AppData\Local\Temp\BNZ.*.htm*
  • ?:\Users\*\AppData\Local\Temp\Rar$*.htm* corpus 2 (elastic 2)
  • ?:\Users\*\AppData\Local\Temp\Temp?_*.htm* corpus 2 (elastic 2)
  • ?:\Users\*\Content.Outlook\*.htm* corpus 2 (elastic 2)
  • ?:\Users\*\Downloads\*.htm* corpus 2 (elastic 2)
field:"process.args" kind:wildcard
process.args_counteq
  • 2 transforms: number corpus 37 (elastic 37)
field:"process.args_count" kind:eq value:"2"
process.nameeq
  • iexplore.exe corpus 6 (elastic 5, splunk 1)
field:"process_name" kind:eq value:"iexplore.exe"
process.namein
  • brave.exe corpus 7 (elastic 7)
  • browser.exe corpus 7 (elastic 7)
  • chrome.exe corpus 16 (elastic 14, splunk 2)
  • dragon.exe corpus 7 (elastic 7)
  • firefox.exe corpus 5 (elastic 5)
  • iexplore
  • iexplore.exe corpus 6 (elastic 5, splunk 1)
  • msedge.exe corpus 12 (elastic 12)
  • opera.exe corpus 3 (elastic 3)
  • vivaldi.exe corpus 6 (elastic 6)
  • waterfox.exe
  • whale.exe corpus 4 (elastic 4)
field:"process_name" kind:in
process.parent.namewildcard
  • explorer.exe corpus 51 (elastic 50, splunk 1)
field:"parent_process_name" kind:wildcard value:"explorer.exe"