Suspicious WMIC XSL Script Execution

edit

Identifies WMIC allowlist bypass techniques by alerting on suspicious execution of scripts. When WMIC loads scripting libraries it may be indicative of an allowlist bypass.

Rule type: eql

Rule indices:

  • winlogbeat-*
  • logs-endpoint.events.*
  • logs-windows.*

Severity: medium

Risk score: 47

Runs every: 5 minutes

Searches indices from: now-9m (Date Math format, see also Additional look-back time)

Maximum alerts per execution: 100

Tags:

  • Elastic
  • Host
  • Windows
  • Threat Detection
  • Defense Evasion

Version: 101 (version history)

Added (Elastic Stack release): 7.10.0

Last modified (Elastic Stack release): 8.5.0

Rule authors: Elastic

Rule license: Elastic License v2

Rule query

edit
sequence by process.entity_id with maxspan = 2m [process where
event.type == "start" and (process.name : "WMIC.exe" or
process.pe.original_file_name : "wmic.exe") and process.args :
("format*:*", "/format*:*", "*-format*:*") and not
process.command_line : "* /format:table *"] [any where (event.category
== "library" or (event.category == "process" and event.action : "Image
loaded*")) and (dll.name : ("jscript.dll", "vbscript.dll") or
file.name : ("jscript.dll", "vbscript.dll"))]

Threat mapping

edit

Framework: MITRE ATT&CKTM

Rule version history

edit
Version 101 (8.5.0 release)
  • Updated query, changed from:

    sequence by process.entity_id with maxspan = 2m [process where
    event.type in ("start", "process_started") and (process.name :
    "WMIC.exe" or process.pe.original_file_name : "wmic.exe") and
    process.args : ("format*:*", "/format*:*", "*-format*:*") and not
    process.command_line : "* /format:table *"] [any where (event.category
    == "library" or (event.category == "process" and event.action : "Image
    loaded*")) and (dll.name : ("jscript.dll", "vbscript.dll") or
    file.name : ("jscript.dll", "vbscript.dll"))]
Version 5 (8.4.0 release)
  • Updated query, changed from:

    sequence by process.entity_id with maxspan = 2m [process where
    event.type in ("start", "process_started") and (process.name :
    "WMIC.exe" or process.pe.original_file_name : "wmic.exe") and
    process.args : ("format*:*", "/format*:*", "*-format*:*") and not
    process.command_line : "* /format:table *"] [library where event.type
    == "start" and dll.name : ("jscript.dll", "vbscript.dll")]
Version 3 (8.1.0 release)
  • Formatting only
Version 2 (7.12.0 release)
  • Updated query, changed from:

    sequence by process.entity_id with maxspan=2m [process where
    event.type in ("start", "process_started") and (process.name :
    "WMIC.exe" or process.pe.original_file_name == "wmic.exe") and
    wildcard(process.args, "format*:*", "/format*:*", "*-format*:*") and
    not wildcard(process.command_line, "* /format:table *")] [library
    where event.type == "start" and file.name in ("jscript.dll",
    "vbscript.dll")]