playing with ie11 activex 0days - power of communitypowerofcommunity.net/poc2017/james.pdf• the...

29
Playing with IE11 ActiveX 0days

Upload: others

Post on 17-Mar-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Playing with IE11 ActiveX 0days - Power Of Communitypowerofcommunity.net/poc2017/james.pdf• The ways to render HTML in Internet Explorer 11 • IE11 Information disclosure and Content

Playing with IE11 ActiveX 0days

Page 2: Playing with IE11 ActiveX 0days - Power Of Communitypowerofcommunity.net/poc2017/james.pdf• The ways to render HTML in Internet Explorer 11 • IE11 Information disclosure and Content

About Me

• James Lee

• Math geek

• Passionate about Security vulnerability research

Page 3: Playing with IE11 ActiveX 0days - Power Of Communitypowerofcommunity.net/poc2017/james.pdf• The ways to render HTML in Internet Explorer 11 • IE11 Information disclosure and Content

• The ways to render HTML in Internet Explorer 11

• IE11 Information disclosure and Content spoofing

• HTML Help viewer

• Local file detection and Top frame issue

Agenda

Page 4: Playing with IE11 ActiveX 0days - Power Of Communitypowerofcommunity.net/poc2017/james.pdf• The ways to render HTML in Internet Explorer 11 • IE11 Information disclosure and Content

The ways to render HTML in IE11

• IFRAME, OBJECT and even an EMBED tag.

• implementation.createDocument, implementation.createHTMLDocument and XMLHttpRequest

• ActiveXObject

Page 5: Playing with IE11 ActiveX 0days - Power Of Communitypowerofcommunity.net/poc2017/james.pdf• The ways to render HTML in Internet Explorer 11 • IE11 Information disclosure and Content

• implementation.createDocument, implementation.createHTMLDocument and XMLHttpRequest return a document object instead of text/xml

• These documents have their limitations, they miss methods like window.open and more

• ActiveXObject has limitations also, but it's capable of running scripts.

The ways to render HTML in IE11

Page 6: Playing with IE11 ActiveX 0days - Power Of Communitypowerofcommunity.net/poc2017/james.pdf• The ways to render HTML in Internet Explorer 11 • IE11 Information disclosure and Content

• You can logically render invisible scripts by instantiating an htmlFile with ActiveXObject.

• test = new ActiveXObject("htmlFile");

• This ActiveXObject returns a reference to its document object.

The ways to render HTML in IE11

Page 7: Playing with IE11 ActiveX 0days - Power Of Communitypowerofcommunity.net/poc2017/james.pdf• The ways to render HTML in Internet Explorer 11 • IE11 Information disclosure and Content

• Local file detection issue

• 16 == RT_VERSION (Source: https://msdn.microsoft.com/en-us/library/windows/desktop/ms648009(v=vs.85).aspx )

• 16”\\”e0 == 16e0 == 16*e^0 == 16

IE11 Information disclosure and Content spoofing

Page 8: Playing with IE11 ActiveX 0days - Power Of Communitypowerofcommunity.net/poc2017/james.pdf• The ways to render HTML in Internet Explorer 11 • IE11 Information disclosure and Content

IE11 Information disclosure and Content spoofing

• Create a htmlFile from an IFRAME

• Destroy the contents of the IFRAME, while keeping wut1 alive, (because we have a reference to it outside the IFRAME itself)

Page 9: Playing with IE11 ActiveX 0days - Power Of Communitypowerofcommunity.net/poc2017/james.pdf• The ways to render HTML in Internet Explorer 11 • IE11 Information disclosure and Content

• Create a new htmlFile inside the previous one

• Create another htmlFile from an IFRAME

• Done, its window.open method can't be seen

• Now we can throw Pop-ups with no restrictions while the user is navigating on any site

IE11 Information disclosure and Content spoofing

Page 10: Playing with IE11 ActiveX 0days - Power Of Communitypowerofcommunity.net/poc2017/james.pdf• The ways to render HTML in Internet Explorer 11 • IE11 Information disclosure and Content

IE11 Information disclosure and Content spoofing

Page 11: Playing with IE11 ActiveX 0days - Power Of Communitypowerofcommunity.net/poc2017/james.pdf• The ways to render HTML in Internet Explorer 11 • IE11 Information disclosure and Content

IE11 Information disclosure and Content spoofing

Page 12: Playing with IE11 ActiveX 0days - Power Of Communitypowerofcommunity.net/poc2017/james.pdf• The ways to render HTML in Internet Explorer 11 • IE11 Information disclosure and Content

• HTML Help Executable has an embedded IE11 feature

• hh.exe http://temporarygc.blogspot.co.uk

HTML Help viewer

Page 13: Playing with IE11 ActiveX 0days - Power Of Communitypowerofcommunity.net/poc2017/james.pdf• The ways to render HTML in Internet Explorer 11 • IE11 Information disclosure and Content

• iexplore.exe inside hh.exe runs as Medium Integrity Level

• So basically you are dealing with the Medium IL Internet Explorer while you are browsing an Internet Zone.

• ActiveX controls via HTML?

HTML Help viewer

Page 14: Playing with IE11 ActiveX 0days - Power Of Communitypowerofcommunity.net/poc2017/james.pdf• The ways to render HTML in Internet Explorer 11 • IE11 Information disclosure and Content

• Well it turns out ActiveX/COM controls are restricted due to other Device guard UMCI bypass discovery (Source: https://msitpros.com/?p=3909)

• So you will get this error when you instantiate WScript.Shell

HTML Help viewer

Page 15: Playing with IE11 ActiveX 0days - Power Of Communitypowerofcommunity.net/poc2017/james.pdf• The ways to render HTML in Internet Explorer 11 • IE11 Information disclosure and Content

• It’s quite easy to bypass MSHTML restriction

• I used a mp3 player to detect the file presence

Local file detection

Page 16: Playing with IE11 ActiveX 0days - Power Of Communitypowerofcommunity.net/poc2017/james.pdf• The ways to render HTML in Internet Explorer 11 • IE11 Information disclosure and Content

• You can change param.url to your desired file to detect.

• But you will get a prompt before the detection.

Local file detection

Page 17: Playing with IE11 ActiveX 0days - Power Of Communitypowerofcommunity.net/poc2017/james.pdf• The ways to render HTML in Internet Explorer 11 • IE11 Information disclosure and Content

• I used invalid mp3 file name “CONIN$.mp3” to bypass the prompt

Local file detection

Page 18: Playing with IE11 ActiveX 0days - Power Of Communitypowerofcommunity.net/poc2017/james.pdf• The ways to render HTML in Internet Explorer 11 • IE11 Information disclosure and Content

Local file detection

Page 19: Playing with IE11 ActiveX 0days - Power Of Communitypowerofcommunity.net/poc2017/james.pdf• The ways to render HTML in Internet Explorer 11 • IE11 Information disclosure and Content

• Using an IFRAME, you can detect the file without user interaction

Local file detection

Page 20: Playing with IE11 ActiveX 0days - Power Of Communitypowerofcommunity.net/poc2017/james.pdf• The ways to render HTML in Internet Explorer 11 • IE11 Information disclosure and Content

CVE-2017-11768

Page 21: Playing with IE11 ActiveX 0days - Power Of Communitypowerofcommunity.net/poc2017/james.pdf• The ways to render HTML in Internet Explorer 11 • IE11 Information disclosure and Content

• Using an ActiveX mp3 player you can spoof the full screen

• Imagine if your Windows UI screen is spoofed and something is going on silently behind the screen

Windows UI Spoofing + Executing Arbitrary Protocol?

Page 22: Playing with IE11 ActiveX 0days - Power Of Communitypowerofcommunity.net/poc2017/james.pdf• The ways to render HTML in Internet Explorer 11 • IE11 Information disclosure and Content

Windows UI Spoofing + Executing Arbitrary Protocol?

Page 23: Playing with IE11 ActiveX 0days - Power Of Communitypowerofcommunity.net/poc2017/james.pdf• The ways to render HTML in Internet Explorer 11 • IE11 Information disclosure and Content

• about: URI scheme provides a similar (though more limited) facility to the data: URI scheme

• iexplore.exe in hh.exe thinks it’s the top when you run ActiveXObject via about: URI scheme

About URI scheme Top frame issue

Page 24: Playing with IE11 ActiveX 0days - Power Of Communitypowerofcommunity.net/poc2017/james.pdf• The ways to render HTML in Internet Explorer 11 • IE11 Information disclosure and Content

• We have an iframe pointing to about: URI scheme which can access this top window DOM bypassing the SOP policy.

• If we run it against the top window NO matter how deeply framed we are, IE thinks the main window was opened with scripting and it allows us to close it without confirmations.

• But we need to block the IFRAME thread so IE does not have a chance to destroy our reference

Passing a reference to the top

Page 25: Playing with IE11 ActiveX 0days - Power Of Communitypowerofcommunity.net/poc2017/james.pdf• The ways to render HTML in Internet Explorer 11 • IE11 Information disclosure and Content

• We can simply use alert to prevent IE from destroying the ActiveXObject.

• We are using a setTimeout to execute the blocking alert. That’s because if we do the alert directly on the iframe, it will block the UI and not execute what’s coming below. 

• Now we can freely access this blank from our domainless htmlFile. (SOP bypass/UXSS)

Passing a reference to the top

Page 26: Playing with IE11 ActiveX 0days - Power Of Communitypowerofcommunity.net/poc2017/james.pdf• The ways to render HTML in Internet Explorer 11 • IE11 Information disclosure and Content

• Our script will always be with you even after iexplore.exe is closed without confirmations.

Passing a reference to the top

Page 27: Playing with IE11 ActiveX 0days - Power Of Communitypowerofcommunity.net/poc2017/james.pdf• The ways to render HTML in Internet Explorer 11 • IE11 Information disclosure and Content

Passing a reference to the top

Page 28: Playing with IE11 ActiveX 0days - Power Of Communitypowerofcommunity.net/poc2017/james.pdf• The ways to render HTML in Internet Explorer 11 • IE11 Information disclosure and Content

Q&A

Page 29: Playing with IE11 ActiveX 0days - Power Of Communitypowerofcommunity.net/poc2017/james.pdf• The ways to render HTML in Internet Explorer 11 • IE11 Information disclosure and Content

Thanks!