可疑HTML文件创建

编辑

识别浏览器进程执行打开具有高熵值和大小的HTML文件。攻击者可能会通过将恶意有效负载隐藏在看似良性的HTML文件中来绕过内容过滤器,从而隐藏数据和文件。

规则类型: eql

规则索引:

  • logs-endpoint.events.process-*
  • logs-endpoint.events.file-*

严重性: 中等

风险评分: 47

运行频率: 5分钟

搜索索引时间范围: now-9m (日期数学格式,另见 额外回溯时间)

每次执行的最大告警数: 100

参考: 无

标签:

  • 领域:终端
  • 操作系统:Windows
  • 用例:威胁检测
  • 战术:初始访问
  • 数据源:Elastic Defend

版本: 108

规则作者:

  • Elastic

规则许可证: Elastic License v2

调查指南

编辑

由于各种文件路径可能与每个EQL序列匹配,因此此规则可能会对性能产生低到中等的影响。

设置

编辑

设置

如果在非elastic-agent索引(例如beats)上启用EQL规则,版本<8.2的事件将不会定义event.ingested,并且直到8.2版本才添加EQL规则的默认回退。因此,为了使此规则有效工作,用户需要添加自定义摄取管道以将event.ingested填充到@timestamp。有关添加自定义摄取管道的更多详细信息,请参阅 - https://elastic.ac.cn/guide/en/fleet/current/data-streams-pipeline-tutorial.html

规则查询

编辑
sequence by user.id with maxspan=2m

 [file where host.os.type == "windows" and event.action in ("creation", "rename") and

  /* Check for HTML files with high entropy and size */
  file.extension : ("htm", "html") and ((file.Ext.entropy >= 5 and file.size >= 150000) or file.size >= 1000000) and

  /* Check for file paths in common download and temporary directories */
  file.path : (
    "?:\\Users\\*\\Downloads\\*",
    "?:\\Users\\*\\Content.Outlook\\*",
    "?:\\Users\\*\\AppData\\Local\\Temp\\Temp?_*",
    "?:\\Users\\*\\AppData\\Local\\Temp\\7z*",
    "?:\\Users\\*\\AppData\\Local\\Temp\\Rar$*")]
 [process where host.os.type == "windows" and event.action == "start" and
  (
   /* Check for browser processes opening HTML files with single argument */
   (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

   /* Optionally, check for browser processes opening HTML files with two arguments */
   (process.name == "iexplore.exe" and process.args_count == 2) or

   /* Optionally, check for browser processes opening HTML files with URL argument */
   (process.name in ("firefox.exe", "waterfox.exe") and process.args == "-url")
  )
  /* Check for file paths in common download and temporary directories targeted in the process arguments */
  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*")]

框架: MITRE ATT&CKTM