码迷,mamicode.com
首页 > 数据库 > 详细

【原创】DuomiCms多处SQL注入打包

时间:2016-01-13 12:29:18      阅读:149      评论:0      收藏:0      [点我收藏+]

标签:

技术分享

全局都使用dede的防注入函数,这个就留给大家去想办法了。。

我们跟踪到

duomi\member\member.php

}elseif($action==‘chgpwdsubmit‘)
{
	if(trim($newpwd)<>trim($newpwd2))
	{
		ShowMsg(‘两次输入密码不一致‘,‘-1‘);	
		exit();	
	}


	if(!empty($newpwd)||!empty($email))
	{
	$pwd = empty($newpwd)?substr(md5($oldpwd),5,20):substr(md5($newpwd),5,20);
	$dsql->ExecuteNoneQuery("update `duomi_member` set password = ‘$pwd‘ ".(empty($email)?‘‘:",email = ‘$email‘")." where id= ‘$uid‘");
	ShowMsg(‘密码修改成功‘,‘-1‘);	
	exit();	
	}
		

  更改密码处可以看到都被单引号了。

但是下面的全部没有进行单引号。

elseif($action==‘cancelfav‘)
{
	$dsql->executeNoneQuery("delete from duomi_favorite where id=".$id);//一处
	echo "<script>location.href=‘?action=favorite‘</script>";
	exit();
}elseif($action==‘cancelfavs‘)
{
	if(empty($fid))
	{
		showMsg("请选择要取消收藏的视频","-1");
		exit();
	}
	foreach($fid as $id)
	{
		$dsql->executeNoneQuery("delete from duomi_favorite where id=".$id);//二处
	}
	echo "<script>location.href=‘?action=favorite‘</script>";
	exit();
}elseif($action==‘favorite‘)
{
	$pcount = 1;
	$row=$dsql->getOne("select count(id) as dd from duomi_favorite where uid=".$uid);//三处
	$rcount=$row[‘dd‘];
	if($rcount==0)
	{
		echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" ><tr><td align=\"center\">没有收藏的视频</td></tr></table>";
		exit();
	}	
	$dsql->setQuery("select * from duomi_favorite where uid=".$uid." limit ".($pg-1)*$pcount.",$pcount");
	$dsql->Execute(‘favlist‘);
?>

  三处都可控,也没有单引号引入,看看SQL执行。

技术分享

技术分享

现在引入我们的语句

技术分享

已经进去了。

利用如下:

post:

http://localhost/member/member.php?action=cancelfav

 

id=1 SQL注入

 

可以直接扔SQLMAP了。

 

【原创】DuomiCms多处SQL注入打包

标签:

原文地址:http://www.cnblogs.com/blck/p/5126494.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!