织梦DedeCMS投票漏洞解决方法
DedeCMS投票漏洞是因为我们在获取投票项时没有进行任何过滤,从而可以让人可以直接利用sql注入形式进行攻击我们的系统了,下面我来给大家介绍解决办法.
打开/include/dedevote.class.php文件,查找如下代码:
$this ->dsql->ExecuteNoneQuery( "UPDATE `detest_vote` SET totalcount='" .( $this ->VoteInfos['totalcount ']+1)."' ,votenote= '".addslashes($items)."' WHERE aid= '".$this->VoteID."' ");修改为如下代码:
$this ->dsql->ExecuteNoneQuery( "UPDATE `detest_vote` SET totalcount='" .( $this ->VoteInfos['totalcount ']+1)."' ,votenote= '".mysql_real_escape_string($items)."' WHERE aid= '".mysql_real_escape_string($this->VoteID)."' ");注:
* addslashes() 是强行加;
* mysql_real_escape_string() 会判断字符集,但是对PHP版本有要求;(PHP 4 >= 4.0.3, PHP 5)
最好直接使用addslashes同时要查看你php是否默认打开了addslashes这个自动功能哦,如果有了我们就不用加了.
查看更多关于织梦DedeCMS投票漏洞解决方法 - DeDecms的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did5573