Skip to content
Threat Feed
medium advisory

Suspicious WMIC XSL Script Execution

This rule detects suspicious execution of scripts via WMIC, potentially used for allowlist bypass, by identifying WMIC executions with atypical arguments and the loading of specific libraries like jscript.dll or vbscript.dll for defense evasion and execution.

This detection identifies WMIC allowlist bypass techniques by alerting on suspicious execution of scripts. When WMIC loads scripting libraries, such as jscript.dll or vbscript.dll, it may be indicative of an allowlist bypass. Adversaries exploit WMIC to bypass security measures by executing scripts via XSL files. This technique is often used for defense evasion and execution of malicious code. The detection logic focuses on monitoring WMIC executions with atypical arguments (format*:, /format:, -format:) in conjunction with the loading of scripting libraries, indicating potential misuse. The rule is designed for data generated by Elastic Defend and also supports Sysmon data sources.

Attack Chain

  1. An attacker gains initial access to the system through various means (e.g., phishing, exploit).
  2. The attacker executes WMIC.exe or wmic.exe with suspicious arguments such as “format*:”, “/format:”, or “-format*:*” to leverage XSL script processing.
  3. WMIC attempts to load scripting libraries like jscript.dll or vbscript.dll to enable script execution.
  4. The attacker uses the loaded scripting libraries to execute malicious code embedded in an XSL file.
  5. The script performs various malicious actions, such as downloading additional payloads, modifying system configurations, or escalating privileges.
  6. The attacker leverages the WMI functionality for lateral movement or persistence within the network.
  7. The attacker evades detection by abusing trusted system binaries (WMIC) and allowlisted scripting engines.
  8. The final objective is to achieve code execution and maintain control over the compromised system for data exfiltration or further malicious activities.

Impact

Successful exploitation allows attackers to bypass security measures and execute malicious code on compromised systems. This can lead to a range of adverse effects, including data theft, system compromise, and further propagation of malware within the network. The use of WMIC for defense evasion can make it difficult to detect malicious activity, increasing the risk of successful attacks.

Recommendation

  • Deploy the Sigma rule Detect Suspicious WMIC XSL Script Execution to your SIEM and tune for your environment.
  • Enable Sysmon Event ID 1 (Process Creation) and Event ID 7 (Image Loaded) logging to activate the Sigma rule above.
  • Investigate any alerts triggered by the Sigma rule by reviewing process execution details and command-line arguments.
  • Review the parent process of suspicious WMIC executions to understand the context and origin of the activity.
  • Correlate the process.entity_id with other related events within a 2-minute window to identify any additional suspicious activities.
  • Implement application control policies to restrict the execution of unauthorized or suspicious XSL files and scripts.

Detection coverage 2

Detect Suspicious WMIC XSL Script Execution

medium

Detects suspicious WMIC command execution with arguments indicative of XSL script processing, followed by the loading of scripting libraries.

sigma tactics: defense_evasion, execution techniques: T1047, T1218, T1220 sources: process_creation, windows

Detect Suspicious WMIC Process Creation with XSL Script

medium

Detects the creation of WMIC processes with command-line arguments indicative of XSL script execution, signaling potential defense evasion tactics.

sigma tactics: defense_evasion techniques: T1218, T1220 sources: process_creation, windows

Detection queries are kept inside the platform. Get full rules →