来源:自学PHP网 时间:2015-04-15 15:00 作者: 阅读:次
[导读] 过滤不严。在index php中include(SYS_ROOT INC 39;common php 39;);$path=$_SERVER[ 39;PATH_INFO 39;] ($_SERVER[ 39;QUERY_STRING 39;]? 39;? 39; str_replace( 39;? 39;, 39; 39;,$_SERVER[ 39...
|
过滤不严。
在index.php中
include(SYS_ROOT.INC.'common.php');
$path=$_SERVER['PATH_INFO'].($_SERVER['QUERY_STRING']?'?'.str_replace('?','',$_SERVER['QUERY_STRING']):'');
if(substr($path, 0,1)=='/'){
$path=substr($path,1);
}
$ctrl=isset($_GET['action'])?$_GET['action']:'run';
if(isset($_GET['createprocess']))
{
Index::createhtml(isset($_GET['id'])?$_GET['id']:0,$_GET['cat'],$_GET['single']);
}else{
Index::$ctrl($path);
}
path是由query_string来的 所以不受gpc啦。
$ctrl=isset($_GET['action'])?$_GET['action']:'run';
if(isset($_GET['createprocess']))
{
Index::createhtml(isset($_GET['id'])?$_GET['id']:0,$_GET['cat'],$_GET['single']);
}else{
Index::$ctrl($path);
}
?>
看这里 我们可以自己来控制要进的函数
static public function getatlbyid($id){
if(!$id)return null;
self::$_db=new Dbclass(SYS_ROOT.DB_NAME);
if(MEMCACHE){
self::$_mem=new Memcached(MEMCACHE);
if(!$atl=self::$_mem->get($id.'_cms')){
$atl=self::$_db->get_one(TB."cms",'status=1 and id='.$id,"*",1);;
self::$_mem->set($id.'_cms',$atl);
}
}else{
$atl=self::$_db->get_one(TB."cms",'status=1 and id='.$id,"*",1);
}
return $atl;
}
那么就找这个函数来注入把。
![]() 有图有真相。
修复方案:
过滤。
|
自学PHP网专注网站建设学习,PHP程序学习,平面设计学习,以及操作系统学习
京ICP备14009008号-1@版权所有www.zixuephp.com
网站声明:本站所有视频,教程都由网友上传,站长收集和分享给大家学习使用,如由牵扯版权问题请联系站长邮箱904561283@qq.com