Windows 7 UAC第二个漏洞技术分析与实验

2009/2/6 11:04:19    编辑:Windows7之家 - Mary Jane     字体:【

Win7之家www.win7china.com):Windows 7 UAC第二个漏洞技术分析与实验

 前天发表了第一篇关于Win7 UAC的漏洞,当然那个实现比较简单,甚至有点“幼稚”。这不,第二弹马上出来了。国外的技术blog作者都在议论这个东西,我结合自己的理解和实验也来谈几点:
1.白名单

最早爆出新漏洞的仍旧是上次的2位作者withinwindows.com的Rafael Rivera和istartedsomething.com的Long Zheng。其中Rafael引用了这篇文章的分析,大致的意思就是说在Win7里面的UAC引入了一个“白名单”机制,下面是作者的原文:

Windows 7's UAC Whitelist:

The default UAC setting in Windows 7 is: "Don't notify me when I make changes to Windows settings."

What this really means is: "Don't notify me when Microsoft applications require administrator rights."

There is a hardcoded whitelist which allows only Microsoft's own applications (whether under interactive user control or not) to perform actions requiring admin rights (e.g. modifying C:Program Files) without triggering UAC prompts. If the user chooses to do the same operation in a competitor's program then they will see a UAC prompt (assuming the program supports UAC at all and UAC has not been completely disabled).

The whitelisted, silent elevation is only for Microsoft's software and the user cannot add or remove items on the whitelist.

而事实上,这个白名单不光光是这么简单,作者在第二句话中强调了Microsoft applications,这里Asuka做一个很简单的实验,首先把win7中的记事本文件notepad.exe从system32目录下拷贝到桌 面,然后双击打开,这个时候在打开的记事本中点击文件->打开->然后把路径定位到C:Program Files目录,随便找一个文件比如Internet Explorer,尝试把它改一个名字,这个时候发现会弹出UAC的对话框

而如果用系统默认的记事本(位于System32路径下),做同样的操作,可以发现并没有弹出UAC的对话框。

这也就证明What this really means is: "Don't notify me when Microsoft applications require administrator rights."这个结论是不正确的。因为第一次用的记事本文件也是Microsoft applications,而结果也需要提权才能够进行操作。

至于正确的结论,现在微软还没有公布相应的文档,而上面提到的白名单也是存在的,但是估计还和路径有关,这也是Asuka个人的猜测,就像在Vista Beta的时候,盆盆也做了很多的猜测,后来很多还真准!

2.新漏洞

根据Rafael Rivera的新实验,新漏洞的产生原因大致是这样,由于Rundll32.exe位于白名单上,因此值得信任,在需要获得high level权限的时候不需要UAC对话框确认,就可以实现。

因此,可以把Rundll32.exe做一个代理,而后面把一段有害的代码编译成dll,用rundll32.exe去调用,就可以轻而易举的绕过UAC。

作者并因此写了个程序,在这里可以下载。

hml

本文作者:Asuka