Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Adversaries may bypass application control and obscure execution of code by embedding scripts inside XSL files.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 53% | 0% |
| case-08 | ✗→✓ | ▲ Improved | -11% | 0% |
| case-14 | ✗→✓ | ▲ Improved | 30% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 80% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 41% | 0% |
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:
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:
Platforms: Windows
The following tests are from Atomic Red Team and provide actionable ways to test this technique:
Executes the code specified within a XSL script tag during XSL transformation using a local payload. Requires download of MSXSL. No longer available from Microsoft. (Available via Internet Archive https://web.archive.org/web/20200825011623/https://www.microsoft.com/en-us/download/details.aspx?id=21714 ) Open Calculator.exe when test successfully executed, while AV turned off.
Supported Platforms: windows
cmd"#{msxsl_exe}" "#{xmlfile}" "#{xslfile}"
Dependencies:
Executes the code specified within a XSL script tag during XSL transformation using a remote payload. Requires download of MSXSL.exe. No longer available from Microsoft. (Available via Internet Archive https://web.archive.org/web/20200825011623/https://www.microsoft.com/en-us/download/details.aspx?id=21714 ) Open Calculator.exe when test successfully executed, while AV turned off.
Supported Platforms: windows
cmd"#{msxsl_exe}" "#{xmlfile}" "#{xslfile}"
Dependencies:
Executes the code specified within a XSL script using a local payload.
Supported Platforms: windows
cmdwmic #{wmic_command} /FORMAT:"#{local_xsl_file}"
Dependencies:
Executes the code specified within a XSL script using a remote payload. Open Calculator.exe when test successfully executed, while AV turned off.
Supported Platforms: windows
cmdwmic #{wmic_command} /FORMAT:"#{remote_xsl_file}"
If Atomic Red Team tests are not applicable, manually verify the technique by:
If msxsl.exe is unnecessary, then block its execution to prevent abuse by adversaries.
| Finding | Severity | Impact | | ------------------------------------------ | -------- | --------------- | | XSL Script Processing technique applicable | High | Defense Evasion |
| CWE ID | Title | | ------- | ---------------------------- | | CWE-693 | Protection Mechanism Failure |
Other measured skills in the registry, with their headline benchmark lift.