{"id":319,"date":"2011-08-08T11:12:57","date_gmt":"2011-08-08T03:12:57","guid":{"rendered":"http:\/\/inbreak.net\/?p=319"},"modified":"2011-08-08T11:15:41","modified_gmt":"2011-08-08T03:15:41","slug":"struts2%e6%a1%86%e6%9e%b6xsltresult%e6%9c%ac%e5%9c%b0%e6%96%87%e4%bb%b6%e4%bb%a3%e7%a0%81%e6%89%a7%e8%a1%8c%e6%bc%8f%e6%b4%9e","status":"publish","type":"post","link":"https:\/\/www.inbreak.net\/archives\/319.html","title":{"rendered":"struts2\u6846\u67b6XSLTResult\u672c\u5730\u6587\u4ef6\u4ee3\u7801\u6267\u884c\u6f0f\u6d1e"},"content":{"rendered":"

by kxlzx http:\/\/inbreak.net
\n\u8fd9\u662f\u4e2a\u6ca1\u6709\u4eba\u516c\u5e03\u8fc7\u7684\u6f0f\u6d1e\uff0c\u5076\u5c14\u770b\u4ee3\u7801\u53d1\u73b0\u7684\u3002\u4e8b\u5b9e\u4e0a\uff0c\u8fd9\u6bb5\u4ee3\u7801\u7528\u7684\u4eba\u4e0d\u591a\uff0c\u9700\u8981\u540c\u65f6\u6ee1\u8db3\u4e24\u4e2a\u60c5\u51b5\uff0c\u624d\u53ef\u4ee5\u641e\u3002\u6211\u731c\u6d4b\uff0c\u53d1\u51fastruts2\u8fdc\u7a0b\u4ee3\u7801\u6267\u884c\u7684\u90a3\u4e2a\u5927\u725b\uff0c\u4e0d\u53ef\u80fd\u6ca1\u53d1\u73b0\u8fd9\u4e48\u5f31\u667a\u7684\u6f0f\u6d1e\u3002\u6240\u4ee5\uff0c\u8981\u4e48\u662f\u6709\u539f\u56e0\u4e0d\u80fd\u516c\u5e03\uff0c\u8981\u4e48\u5c31\u662f\u5356\u4e86\uff0c\u90a3\u5c31\u597d\uff0c\u8fd9\u6b21\u6211\u9996\u53d1\uff0c\u54c8\u54c8\u54c8\uff01
\n\u5148\u8bb2\u8bb2\u539f\u7406\uff1a<\/strong>
\nstruts2\u5141\u8bb8action\u6709\u591a\u79cd\u8fd4\u56de\u7c7b\u578b\uff0c\u5176\u4e2d\u5305\u62ecXSLT\u7c7b\u578b\uff0c\u8fd9\u79cd\u7c7b\u578b\u5141\u8bb8\u63a5\u53d7\u7528\u6237\u63d0\u4ea4\u4e00\u4e2a\u6587\u4ef6\u5730\u5740\uff0c\u5e76\u4e14\u53bb\u89e3\u6790\u5b83\u4e3aXSLT\u6587\u4ef6\uff0c\u65e0\u8bba\u6269\u5c55\u540d\u662f\u4ec0\u4e48\u3002
\n\u8fd9\u662fXSLTResult\u6587\u4ef6\u4ee3\u7801\uff1a<\/p>\n

\r\nhttp:\/\/svn.apache.org\/repos\/asf\/struts\/struts2\/trunk\/core\/src\/main\/java\/org\/apache\/struts2\/views\/xslt\/XSLTResult.java\r\n\/\/\u83b7\u53d6\u7528\u6237\u63d0\u4ea4\u7684\"xslt.location\"\u7684\u503c\r\nString pathFromRequest = ServletActionContext.getRequest().getParameter(\"xslt.location\");\r\npath = pathFromRequest;\r\nURL resource = ServletActionContext.getServletContext().getResource(path);\r\n\/\/\u89e3\u6790\u7528\u6237\u63d0\u4ea4\u7684\u6587\u4ef6\u5730\u5740\u4e3axslt\r\ntemplates = factory.newTemplates(new StreamSource(resource.openStream()));\r\n<\/pre>\n

\u800cXSLT\u89e3\u6790\uff0c\u4f1a\u5141\u8bb8\u6267\u884cjava\u9759\u6001\u65b9\u6cd5\uff0c\u6240\u4ee5\uff0c\u53ea\u8981\u4e0a\u4f20\u4e00\u4e2a\u6587\u4ef6\u5728\u670d\u52a1\u5668\u4e0a\uff0c\u4f8b\u5982
\n\/upload\/7758521.gif<\/p>\n

\r\n\r\n\r\n\t\r\n\t\t \r\n\t\t\t \r\n\t\t\t   

hacked by kxlzx<\/h2> \r\n\t\t\t

http:\/\/inbreak.net<\/h2> \r\n\t\t\t \r\n\t\t\t\t\t \r\n\t\t\t\t<\/exp>\r\n\t\t\t<\/body> \r\n\t\t<\/html> \r\n\t<\/xsl:template> \r\n<\/xsl:stylesheet>\r\n<\/pre>\n

\u8fd9\u4e2axsl\u6587\u4ef6\u89e3\u6790\u65f6\uff0c\u4f1a\u8c03\u7528ognl\u4e2d\u7684<\/p>\n

\r\nognl:getValue('@Runtime@getRuntime().exec(\"calc\")', '')\r\n<\/pre>\n

\u5bfc\u81f4\u6267\u884c\u4efb\u610f\u4ee3\u7801\u3002
\n\u4e8b\u5b9e\u4e0a\uff0cXSLT\u89e3\u6790\uff0c\u53ef\u4ee5\u6267\u884c\u4efb\u610f\u4ee3\u7801\uff0c\u5e76\u975e\u53ea\u662fjava\u7684\uff0cphp\u4e5f\u53ef\u4ee5\uff0c\u53ea\u662f\u5927\u591a\u6570\u4eba\u4e0d\u6ce8\u610f\u7f62\u4e86\uff0c\u6211\u5728\u4e4b\u524d\uff0c\u8fd8\u770b\u5230\u5f88\u591a\u5173\u4e8eXSLT\u6267\u884c\u4ee3\u7801\u7684\u6587\u7ae0\uff0c\u5f53\u7136\u4e0d\u662f\u4e3a\u4e86\u5b89\u5168\u7814\u7a76\u3002
\n\u53ef\u80fd\u8fd9\u4e2a\u77e5\u8bc6\u70b9\u77e5\u9053\u7684\u4e0d\u591a\uff0c\u5bfc\u81f4\u6ca1\u6709\u4eba\u53d1\u73b0struts2\u8fd9\u4e2a\u660e\u663e\u7684\u5b89\u5168\u95ee\u9898\u3002
\n\u516b\u5366\u4e00\u4e0b\uff0c\u8fd9\u4e2a\u6f0f\u6d1e\u548cognl\u6728\u6709\u4efb\u4f55\u5173\u7cfb\uff0c\u5176\u5b9e\u662f\u56e0\u4e3a\u6b63\u5e38\u7684Runtime.getRuntime().exec()\u592a\u9ebb\u70e6\u4e86\uff0cognl\u7528\u8d77\u6765\u975e\u5e38\u65b9\u4fbf\uff0c
\n\u800cstruts2\u5fc5\u7136\u81ea\u5e26ognl\u5305\uff0c\u6240\u4ee5\u6211\u8ddf\u968f\u5927\u725b\u811a\u6b65\uff0c\u575a\u5b9a\u65e0\u6bd4\u7684\u6267\u884cognl\u8bed\u53e5\u3002<\/p>\n

\u6587\u4ef6\u4e0a\u4f20\u540e\uff0c\u8981\u627e\u5230\u4e00\u4e2a\u8fd4\u56dexslt\u7684action\u624d\u884c\uff0cXSLTResult\u7684\u4f5c\u7528\u5c31\u662f\u628aaction\u8fd4\u56de\uff0c\u76f4\u63a5\u8f6c\u6362\u4e3axml\uff0c\u4fbf\u4e8e\u4f20\u8f93\u3002
\n\u901a\u5e38\u5728ajax\u7684\u65f6\u5019\uff0c\u7528\u8fd9\u4e2a\u4f1a\u6bd4\u8f83\u5e38\u89c1\uff0c\u6240\u4ee5\u770b\u5230xml\u8fd4\u56de\u65f6\uff0c\u5c31\u8981\u7279\u522b\u6ce8\u610f\u4e86\u3002
\n\u5047\u8bbe\u4e00\u4e2axslt\u7684\u8fd4\u56deaction\u5730\u5740\u4e3a
\nhttp:\/\/inbreak.net\/xslt.action
\n\u6211\u4eec\u5c31\u53ef\u4ee5\u63d0\u4ea4
\nhttp:\/\/inbreak.net\/xslt.action?xslt.location=upload\/a.gif
\n\"\"<\/a>
\n\u4ece\u539f\u7406\u4e0a\uff0c\u770b\u51fa\u6765\u8fd9\u4e2a\u6f0f\u6d1e\u9700\u8981\u81f3\u5c11\u6ee1\u8db3\u4e24\u4e2a\u60c5\u51b5\uff1a
\n1\u3001\u7f51\u7ad9\u4f7f\u7528\u4e86XSLTResult\u8fd4\u56de<\/strong>
\n\u8fd9\u4e00\u70b9\u4e0d\u597d\u9a8c\u8bc1\uff0c\u5177\u4f53\u6765\u8bf4\uff0c\u8fd9\u79cd\u8fd4\u56de\u662f\u4e3a\u4e86\u5904\u7406\u201c\u5bf9\u8c61–xml\u201d\u7684\uff0c\u5c31\u662f\u628a\u4e00\u4e2a\u5bf9\u8c61\uff0c\u5c01\u88c5\u6210xml\uff0c\u7136\u540e\u6254\u51fa\u6765\u3002\u90a3\u4e48\u5177\u4f53\u7684\u4e1a\u52a1\u903b\u8f91\uff0c\u5c31\u8981\u770b\u7f51\u7ad9\u7684\u529f\u80fd\u4e86\u3002
\n2\u3001\u8981\u6709\u4e0a\u4f20\u6587\u4ef6\u529f\u80fd<\/strong>
\n\u56e0\u4e3a\u5fc5\u987b\u5728web\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\uff0c\u624d\u53ef\u4ee5\u641e\uff0c\u4ed6\u53ea\u80fdload\u5230web\u4e0b\u7684\uff0c\u5f80\u524d\uff0c\u5c31\u4e0d\u884c\u4e86\u3002\u4f46\u662f\u597d\u5728\u4e0d\u9650\u5236\u6587\u4ef6\u540d\u548c\u6269\u5c55\u540d\uff0c\u8fd8\u662f\u6709\u5f88\u5927\u673a\u4f1a\u7684\u3002
\nps\uff1a\u8c01\u5e2e\u5fd9\u7533\u8bf7\u4e2aCVE\u3002\u3002\u3002\u6211\u4e0d\u4f1a\u9e1f\u8bed\uff0c\u8fd9\u4e2a\u6ca1\u7533\u8bf7\u8fc7\uff0c\u5f53\u7136\uff0c\u4f60\u7528\u81ea\u5df1\u7684\u540d\u5b57\u7533\u8bf7\u4e5f\u65e0\u6240\u8c13\uff0c\u53ea\u8981\u7559\u4e2a\u94fe\u63a5\u5c31\u597d\u3002
\n by kxlzx http:\/\/inbreak.net<\/p>\n","protected":false},"excerpt":{"rendered":"

\u8fd9\u662f\u4e2a\u6ca1\u6709\u4eba\u516c\u5e03\u8fc7\u7684\u6f0f\u6d1e\uff0c\u5076\u5c14\u770b\u4ee3\u7801\u53d1\u73b0\u7684\u3002\u4e8b\u5b9e\u4e0a\uff0c\u8fd9\u6bb5\u4ee3\u7801\u7528\u7684\u4eba\u4e0d\u591a\uff0c\u9700\u8981\u540c\u65f6\u6ee1\u8db3\u4e24\u4e2a\u60c5\u51b5\uff0c\u624d\u53ef\u4ee5\u641e\u3002\u6211\u731c\u6d4b\uff0c\u53d1\u51fastruts2\u8fdc\u7a0b\u4ee3\u7801\u6267\u884c\u7684\u90a3\u4e2a\u5927\u725b\uff0c\u4e0d\u53ef\u80fd\u6ca1\u53d1\u73b0\u8fd9\u4e48\u5f31\u667a\u7684\u6f0f\u6d1e\u3002\u6240\u4ee5\uff0c\u8981\u4e48\u662f\u6709\u539f\u56e0\u4e0d\u80fd\u516c\u5e03\uff0c\u8981\u4e48\u5c31\u662f\u5356\u4e86\uff0c\u90a3\u5c31\u597d\uff0c\u8fd9\u6b21\u6211\u9996\u53d1\uff0c\u54c8\u54c8\u54c8\uff01<\/p>\n

\u7ee7\u7eed\u9605\u8bfb »<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[84,86,5],"tags":[],"views":11631,"_links":{"self":[{"href":"https:\/\/www.inbreak.net\/wp-json\/wp\/v2\/posts\/319"}],"collection":[{"href":"https:\/\/www.inbreak.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inbreak.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inbreak.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inbreak.net\/wp-json\/wp\/v2\/comments?post=319"}],"version-history":[{"count":16,"href":"https:\/\/www.inbreak.net\/wp-json\/wp\/v2\/posts\/319\/revisions"}],"predecessor-version":[{"id":337,"href":"https:\/\/www.inbreak.net\/wp-json\/wp\/v2\/posts\/319\/revisions\/337"}],"wp:attachment":[{"href":"https:\/\/www.inbreak.net\/wp-json\/wp\/v2\/media?parent=319"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inbreak.net\/wp-json\/wp\/v2\/categories?post=319"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inbreak.net\/wp-json\/wp\/v2\/tags?post=319"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}