{"id":2280,"date":"2014-02-09T06:28:52","date_gmt":"2014-02-09T06:28:52","guid":{"rendered":"http:\/\/www.hexacorn.com\/blog\/?p=2280"},"modified":"2014-09-20T22:22:53","modified_gmt":"2014-09-20T22:22:53","slug":"beyond-good-ol-run-key-part-7","status":"publish","type":"post","link":"https:\/\/www.hexacorn.com\/blog\/2014\/02\/09\/beyond-good-ol-run-key-part-7\/","title":{"rendered":"Beyond good ol\u2019 Run key, Part 7"},"content":{"rendered":"<p>In my last post of this series I discussed the <a title=\"Beyond good ol\u2019 Run key, Part 6\" href=\"https:\/\/www.hexacorn.com\/blog\/2014\/01\/10\/beyond-good-ol-run-key-part-6-2\/\">VBA Monitor mechanism<\/a> that can be used to execute code anytime Visual Basic application is started. Today&#8217;s topic is similar and talks about yet another internal Microsoft component that could be abused to load arbitrary code &#8211; this time it happens anytime the application crashes. As far as I can tell, it only works on XP, so it&#8217;s a bit old and not that practically useful, but given the fact XP is still out there in large quantities it is worth documenting it.<\/p>\n<p>The component that we will abuse is called OAClient. It is an agent that is a part of a distributed test management system called Oasys (Office Automation System) and which is used internally by Microsoft to test their Office suites.<\/p>\n<p>How do I know?<\/p>\n<p>I have read about it in this <a href=\"http:\/\/www.uploads.pnsqc.org\/2011\/papers\/T-29_Hartmann_paper.pdf\">pdf<\/a> (&#8216;Exploring Cross-Platform Testing Strategies at Microsoft&#8221;) that I found online while looking for the meaning of the HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\OASys\\OAClient key &#8211; and I looked for it, because I spotted this key being queried by DWWIN.EXE anytime the application crashes under Windows XP.<\/p>\n<p>Once I found out, all I had to do is to add the key, force the application to crash<\/p>\n<p><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2014\/02\/notepad_crash.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-2282\" alt=\"notepad_crash\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2014\/02\/notepad_crash.png\" width=\"419\" height=\"199\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2014\/02\/notepad_crash.png 419w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2014\/02\/notepad_crash-300x142.png 300w\" sizes=\"(max-width: 419px) 100vw, 419px\" \/><\/a><\/p>\n<p>&#8211; so that DWWIN.EXE is launched and then confirm that the presence of the OAClient key leads the DWWIN.EXE to attempt loading of the BTLOG.DLL file from c:\\windows\\system32.<\/p>\n<p><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2014\/02\/dwwin_load_btlog_dll.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-2281\" alt=\"dwwin_load_btlog_dll\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2014\/02\/dwwin_load_btlog_dll.png\" width=\"640\" height=\"178\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2014\/02\/dwwin_load_btlog_dll.png 640w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2014\/02\/dwwin_load_btlog_dll-300x83.png 300w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a>There you have it.<\/p>\n<p>To reproduce:<\/p>\n<ul>\n<li>Create %windir%\\system32\\BTLOG.DLL<\/li>\n<li>Add HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\OASys\\OAClient<\/li>\n<li>Now launch the application that crashes and loads DWWIN.EXE as a result of the crash (e.g. copy notepad.exe to notepad2.exe and patch its entry point with 0xCC = int 3); the DWWIN.EXE will load the btlog.dll.<\/li>\n<\/ul>\n<p>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In my last post of this series I discussed the VBA Monitor mechanism that can be used to execute code anytime Visual Basic application is started. Today&#8217;s topic is similar and talks about yet another internal Microsoft component that could &hellip; <a href=\"https:\/\/www.hexacorn.com\/blog\/2014\/02\/09\/beyond-good-ol-run-key-part-7\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[13,35,15,19,9],"tags":[],"_links":{"self":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/2280"}],"collection":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/comments?post=2280"}],"version-history":[{"count":1,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/2280\/revisions"}],"predecessor-version":[{"id":2283,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/2280\/revisions\/2283"}],"wp:attachment":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/media?parent=2280"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/categories?post=2280"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/tags?post=2280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}