[0-day]Vulnerability in Windows Help and Support Center Could Allow Remote Code Execution
위험한_친구들/친절한_Windows군 2010. 6. 21. 21:58General Information
Affected and Non-Affected Software
This advisory discusses the following software.
Affected Software (영향받는 소프트웨어) |
Windows XP Service Pack 2 and Windows XP Service Pack 3 |
Windows XP Professional x64 Edition Service Pack 2 |
Windows Server 2003 Service Pack 2 |
Windows Server 2003 x64 Edition Service Pack 2 |
Windows Server 2003 with SP2 for Itanium-based Systems |
Non-Affected Software (영향받지 않는 소프트웨어) |
Microsoft Windows 2000 Service Pack 4 |
Windows Vista Service Pack 1 and Windows Vista Service Pack 2 |
Windows Vista x64 Edition Service Pack 1 and Windows Vista x64 Edition Service Pack 2 |
Windows Server 2008 for 32-bit Systems and Windows Server 2008 for 32-bit Systems Service Pack 2 |
Windows Server 2008 for x64-based Systems and Windows Server 2008 for x64-based Systems Service Pack 2 |
Windows Server 2008 for Itanium-based Systems and Windows Server 2008 for Itanium-based Systems Service Pack 2 |
Windows 7 for 32-bit Systems |
Windows 7 for x64-based Systems |
Windows Server 2008 R2 for x64-based Systems |
Windows Server 2008 R2 for Itanium-based Systems |
Tavis Ormandy라는 구글 엔지니어라는데.. 취약성 코드도 공개했습니다.
아래와 같이 테스트 해보시면 됩니다.. ㅎㅎ
--------------------
Affected Software
------------------------
At least Microsoft Windows XP, and Windows Server 2003 are affected. The attack
is enhanced against IE >= 8 and other major browsers if Windows Media Player is
available, but an installation is still vulnerable without it.
Machines running version of IE less than 8 are, as usual, in even more trouble.
In general, choice of browser, mail client or whatever is not relevant, they
are all equally vulnerable.
--------------------
Consequences
-----------------------
Upon successful exploitation, a remote attacker is able to execute arbitrary
commands with the privileges of the current user.
I've prepared a demonstration for a typical Windows XP installation with
Internet Explorer 8, and the default Windows Media Player 9.
http://lock.cmpxchg8b.com/b10a58b75029f79b5f93f4add3ddf992/launchurl.html
In IE7 on Windows XP, just visiting this URL should be sufficient:
http://lock.cmpxchg8b.com/b10a58b75029f79b5f93f4add3ddf992/starthelp.html
Some minor modifications will be required to target other configurations, this
is simply an attempt to demonstrate the problem. I'm sure the smart guys at
metasploit will work on designing reliable attacks, as security professionals
require these to do their jobs.
Additionally, my demonstration is not intended to be stealthy, a real
attack would barely be noticable to the victim. Perhaps the only unavoidable
signal would be the momentary appearance of the Help Centre window before the
attacker hides it. There are multiple trivial techniques that can be used to
accomplish this.
Browsers are useful to demonstrate the problem, but there are certainly other
attack vectors, such as MUAs, documents, etc. Protocol handlers are designed to
be used across applications.
-------------------
Mitigation
-----------------------
If you believe you may be affected, you should consider applying one of the
workarounds described below.
Few users rely on Help Centre urls, it is safe to temporarily disable them
by removing HKCR\HCP\shell\open. This modification can be deployed easily using
GPOs. For more information on Group Policy, see Microsoft's Group Policy site,
here
http://technet.microsoft.com/en-us/windowsserver/bb310732.aspx
A few caveats,
* I am aware that some support technicians rely on the Remote Assistance
tool provided by the Help Center application using shortcuts like
"explorer.exe hcp://CN=Microsoft%20Corporation,L=Re...". You can continue
to use this technique by substituting "explorer.exe hcp://..." for
"helpctr.exe /url hcp://...", without relying on the protocol handler.
* One or two links in explorer, such as selecting "Help" from the Control
Panel category view, may no longer function. If this concerns you, it is
possible to gracefully degrade by replacing the protocol handler with a
command to open a static intranet support page, e.g.
"chrome.exe http://techsupport.intranet";.
* As always, if you do not use this feature, consider permanently disabling
it in order to reduce attack surface. Historically, disabling unused
protocol handlers has always proven to be a wise investment in security.
In the unlikely event that you heavily rely on the use of hcp://, I have
created an unofficial (temporary) hotfix. You may use it under the terms of
the GNU General Public License, version 2 or later. Of course, you should only
use it as a last resort, carefully test the patch and make sure you understand
what it does (full source code is included). It may be necessary to modify it
to fit your needs.
The package is availble for x86 here:
http://lock.cmpxchg8b.com/b10a58b75029f79b5f93f4add3ddf992/hcphotfix.zip
[ NOTE: Please avoid linking to this file out of context, it is intended for
consideration as a potential mitigation by experienced administrators,
and is not suitable for consumption by end-users ]
The hotfix intercepts helpctr.exe invokations, and patches MPC::HexToNum() to
return zero on error, rather than -1. Nothing is changed on disk, and it can be
safely removed at anytime. Of course, the result of an invalid unescape is still
incorrect, but this specific vulnerability should be rendered inert. I would be
greatful if the community could contribute bugfixes, testing, an x64 port, and
so on. Once information is in the open, we can all collaborate on our
collective security.
Some clarifications,
* Fixing the XSS is not a solution, the root cause is the whitelist
evasion, any mitigation that does not address this is simply papering
over the issue. An army of researchers that specialise in XSS exists, and
i'm sure they will turn their attention to help documents once they
realise their value. Assume more will be discovered.
* That said, if you are an XSS expert, examples in whitelisted pages
(/services/index, /services/search, etc.) would be useful, your skills
could be helpful making this important software safe.
* Removing Windows Media player is not a solution, it simply makes a fun
demo for IE8 and other modern browsers.
Finally, you should take this opportunity to disable all browser plugins and
SFS ActiveX controls that are not regularly used. End users can do this
themselves in Google Chrome by viewing about:plugins and disabling the plugins
that are not required. In Mozilla Firefox, use the Tools->Add-ons->Plugins
interface.
-------------------
Solution
-----------------------
Microsoft was informed about this vulnerability on 5-Jun-2010, and they
confirmed receipt of my report on the same day.
Protocol handlers are a popular source of vulnerabilities, and hcp:// itself
has been the target of attacks multiple times in the past. I've concluded that
there's a significant possibility that attackers have studied this component,
and releasing this information rapidly is in the best interest of security.
Those of you with large support contracts are encouraged to tell your support
representatives that you would like to see Microsoft invest in developing
processes for faster responses to external security reports.
-------------------
Credit
-----------------------
This bug was discovered by Tavis Ormandy.
-------------------
Greetz
-----------------------
Greetz to Neel, Mark, Redpig, Spoonm, Skylined, asiraP, LiquidK, ScaryBeasts,
Hawkes, Jagger, and all my other pimp colleagues.
Special thanks to lcamtuf for his assistance with the deferred execution
problem. You should read his Browser Security Handbook if you need to
understand how web browser security /really/ works.
http://code.google.com/p/browsersec/wiki/Main
A colleague is organising a conference in Lucerne, Switzerland. He would really
appreciate interesting papers from security people who want to talk about
their research (travel, hotel, etc. covered).
https://www.hashdays.ch/
-------------------
Notes
-----------------------
I would like to point out that if I had reported the MPC::HexToNum() issue
without a working exploit, I would have been ignored.
Without access to extremely smart colleagues, I would likely have given up,
leaving you vulnerable to attack from those who just want root on your network
and do not care about disclosure policies.
This is another example of the problems with bug secrecy (or in PR speak,
"responsible disclosure"), those of us who work hard to keep networks safe are
forced to work in isolation without the open collaboration with our peers that
we need, especially in complex cases like this, where creative thinking and
input from experts in multiple disciplines is required to join the dots.
A good place to start researching full disclosure would be this accessible
and insightful essay by Bruce Schneier.
http://www.schneier.com/essay-146.html
His balanced coverage of the debate is also available in this essay.
http://www.schneier.com/crypto-gram-0111.html#1
Finally, a reminder that this documents contains my own opinions, I do
not speak for or represent anyone but myself.
-------------------
References
-----------------------
hcp:// has been broken a few times over the years, for example:
- http://seclists.org/bugtraq/2002/Aug/225, Delete arbitrary files using Help and Support Center
- http://www.microsoft.com/technet/security/bulletin/ms03-044.mspx, HCP memory corruption by Dave Litchfield.
The current design is actually pretty sound, I'm sure Microsoft are
dissapointed they missed this flaw. In their defense, I think there's a good
chance I would have also missed this in code review.
--
-------------------------------------
taviso () cmpxchg8b com | pgp encrypted mail preferred
-------------------------------------------------------
아래는 집에서 테스팅~ 샷
'위험한_친구들 > 친절한_Windows군' 카테고리의 다른 글
Microsoft IIS Tilde Character Short File/Folder Name Disclosure (0) | 2012.07.18 |
---|---|
윈도우 RDP (Remote Desktop Protocol) 활성화 (0) | 2012.02.28 |
Userland Hooking in Windows (0) | 2011.08.17 |