Windows SMB漏洞分析

    技术2025-11-28  7

    漏洞环境:windowns 2003,并且需要设置设置Active Directory域控制器

              Active directory的设置请参考:http://zhidao.baidu.com/question/18878152.html 

    漏洞模块:mrxsmb.sys(SMB协议相关模块)

    漏洞原因

    由于驱动程序中对参数检测不严格,导致堆数据拷贝的时候出现堆溢出。

    造成系统win2003系统蓝屏,堆溢出代码出现在mrxsmb.sys模块中,详细分析如下:

    f6be6b07 0002            add     byte ptr [edx],al

    f6be6b09 3b4dfc          cmp     ecx,dword ptr [ebp-4]

    f6be6b0c 7606            jbe     mrxsmb!BowserWriteErrorLogEntry+0x168 (f6be6b14)

    f6be6b0e 8b45fc          mov     eax,dword ptr [ebp-4]

    f6be6b11 d1e8            shr     eax,1

    f6be6b13 48              dec    eax

    f6be6b14 85c0            test    eax,eax   ; eax=0xffffffff

    f6be6b16 7639            jbe     mrxsmb!BowserWriteErrorLogEntry+0x1a5 (f6be6b51)

    f6be6b18 8d0c00          lea     ecx,[eax+eax]

    f6be6b1b 8bd1            mov    edx,ecx    ;此时edx=0xfffffffe

    f6be6b1d c1e902          shr     ecx,2   ;右移ecx = 0x3fffffff,造成堆数据复制溢出

    f6be6b20 f3a5            rep movs dword ptr es:[edi],dword ptr [esi]  ;造成溢出的指令

    f6be6b22 8bca            mov     ecx,edx

     

    出现mrxsmb.sys模块crash时的寄存器环境:

    eax=ffffffff ebx=81ab8940 ecx=3ffeb2b2 edx=fffffffe esi=e1662ffe edi=81b0bf0c

    eip=f6be6b20 esp=f78cacb4 ebp=f78caccc iopl=0         nv up ei pl nz ac pe cy

    cs=0008  ss=0010  ds=0023  es=0023  fs=0030  gs=0000             efl=00010217

    mrxsmb!BowserWriteErrorLogEntry+0x174:

    f6be6b20 f3a5            rep movs dword ptr es:[edi],dword ptr [esi] es:0023:81b0bf0c=00000000 ds:0023:e1662ffe=????????

    Resetting default scope

     

    相关链接

    Poc代码 http://www.exploit-db.com/exploits/16166/ .

    Active Directory设置 http://zhidao.baidu.com/question/18878152.html 

    最新回复(0)