XSL Script Processing
Adversaries may bypass application control and obscure execution of code by embedding scripts inside XSL files. Extensible Stylesheet Language (XSL) files support embedded scripting in JavaScript, VBScript, and other languages. Two primary abuse vectors exist: (1) msxsl.exe, Microsoft's command-line XSLT transformation utility, which can execute arbitrary JavaScript or VBScript embedded in local or remote XSL files; and (2) wmic.exe with the /FORMAT switch ('Squiblytwo'), which invokes JScript or VBScript within XSL via WMI. Both techniques leverage trusted Windows tooling to proxy malicious code execution while evading application control solutions such as AppLocker. Since msxsl.exe is not installed by default, adversaries typically drop it alongside their payloads. Real-world usage includes Astaroth, Cobalt Group, and Higaisa.
let MsxslExecutions = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName =~ "msxsl.exe"
| extend RemoteXsl = ProcessCommandLine has_any ("http://", "https://", "ftp://", "\\\\")
| extend SameFileArg = extract(@"(\S+\.\w+)\s+\1", 0, ProcessCommandLine) != ""
| extend ArbitraryExt = ProcessCommandLine matches regex @"\.(jpeg|jpg|png|gif|txt|dat|bin|log)\s"
| extend Indicator = case(
RemoteXsl, "remote-xsl-load",
SameFileArg, "same-file-twice",
ArbitraryExt, "arbitrary-extension",
"local-xsl-exec")
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
InitiatingProcessFileName, InitiatingProcessCommandLine,
RemoteXsl, SameFileArg, ArbitraryExt, Indicator;
let WmicSquiblytwo = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName =~ "wmic.exe"
| where ProcessCommandLine has "/FORMAT"
| where ProcessCommandLine has_any (".xsl", ".xslt", "http://", "https://")
| extend RemoteFormat = ProcessCommandLine has_any ("http://", "https://")
| extend LocalXslFormat = ProcessCommandLine matches regex @"/FORMAT[:\s]+\S*\.xsl"
| extend WmiAlias = extract(@"wmic\s+(\w+)\s+", 1, tolower(ProcessCommandLine))
| extend Indicator = iff(RemoteFormat, "squiblytwo-remote", "squiblytwo-local")
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
InitiatingProcessFileName, InitiatingProcessCommandLine,
RemoteFormat, LocalXslFormat, WmiAlias, Indicator;
union MsxslExecutions, WmicSquiblytwo
| sort by Timestamp desc Data Sources
Required Tables
False Positives
- Legitimate XSLT transformations performed by developers or build pipelines using msxsl.exe — rare since the tool is not installed by default
- WMIC reporting scripts that use /FORMAT with built-in XSL stylesheets from %SystemRoot%\System32\wbem\en-US\ (e.g., wmic process list /FORMAT:list.xsl)
- XML/XSLT tooling in CI/CD pipelines or data processing workflows that invoke msxsl.exe for document transformation
- System administration scripts that legitimately use wmic /FORMAT for structured output — verify the XSL path resolves to a known-good system location
References (10)
- https://attack.mitre.org/techniques/T1220/
- https://pentestlab.blog/2017/07/06/applocker-bypass-msxsl/
- https://reaqta.com/2018/03/spear-phishing-campaign-leveraging-msxsl/
- https://lolbas-project.github.io/lolbas/Binaries/Wmic/
- https://lolbas-project.github.io/lolbas/Binaries/Msxsl/
- https://docs.microsoft.com/dotnet/standard/data/xml/xslt-stylesheet-scripting-using-msxsl-script
- https://medium.com/@threathuntingteam/msxsl-exe-and-wmic-exe-a-way-to-proxy-code-execution-8d524f642b75
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1220/T1220.md
- https://github.com/SigmaHQ/sigma/blob/master/rules/windows/process_creation/proc_creation_win_lolbin_msxsl.yml
- https://www.cybereason.com/blog/astaroth-malware-abuses-legitimate-os-and-antivirus-processes
Unlock Pro Content
Get the full detection package for T1220 including response playbook, investigation guide, and atomic red team tests.