Vulnerabilities > CVE-2007-0446 - Buffer Overflow vulnerability in HP products

047910
CVSS 10.0 - CRITICAL
Attack vector
NETWORK
Attack complexity
LOW
Privileges required
NONE
Confidentiality impact
COMPLETE
Integrity impact
COMPLETE
Availability impact
COMPLETE
network
low complexity
hp
critical
nessus

Summary

Stack-based buffer overflow in magentproc.exe for Hewlett-Packard Mercury LoadRunner Agent 8.0 and 8.1, Performance Center Agent 8.0 and 8.1, and Monitor over Firewall 8.1 allows remote attackers to execute arbitrary code via a packet with a long server_ip_name field to TCP port 54345, which triggers the overflow in mchan.dll.

Nessus

NASL familyGain a shell remotely
NASL idLOADRUNNER_AGENT_SERVER_IP_NAME_OVERFLOW.NASL
descriptionThe version of the LoadRunner Agent installed on the remote host contains a buffer overflow in
last seen2020-06-01
modified2020-06-02
plugin id24327
published2007-02-13
reporterThis script is Copyright (C) 2007-2018 Tenable Network Security, Inc.
sourcehttps://www.tenable.com/plugins/nessus/24327
titleMercury LoadRunner Agent server_ip_name Field Remote Buffer Overflow
code
#
# (C) Tenable Network Security, Inc.
#

include("compat.inc");

if (description)
{
  script_id(24327);
  script_version("1.20");
 script_cvs_date("Date: 2018/11/15 20:50:22");

  script_cve_id("CVE-2007-0446");
  script_bugtraq_id(22487);

  script_name(english:"Mercury LoadRunner Agent server_ip_name Field Remote Buffer Overflow");
  script_summary(english:"Sends an invalid request to a LoadRunner agent");

  script_set_attribute(attribute:"synopsis", value:"The remote server is affected by a buffer overflow vulnerability.");
  script_set_attribute(attribute:"description", value:
"The version of the LoadRunner Agent installed on the remote host
contains a buffer overflow in 'mchan.dll' that can be exploited by an
unauthenticated, remote attacker using a request with a long
'server_ip_name' field to crash the affected service or execute
arbitrary code subject to the permissions of the user id under which the
agent runs.");
  script_set_attribute(attribute:"see_also", value:"https://www.zerodayinitiative.com/advisories/ZDI-07-007/");
  script_set_attribute(attribute:"see_also", value:"https://seclists.org/fulldisclosure/2007/Feb/176");
  script_set_attribute(attribute:"see_also", value:"https://www.securityfocus.com/archive/1/459496");
  script_set_attribute(attribute:"solution", value:
"HP no longer supports version 8.x of this product and patches may
no longer be available. HP recommends all users upgrade to latest
available version of 9.x.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:C/I:C/A:C");
  script_set_cvss_temporal_vector("CVSS2#E:F/RL:OF/RC:C");
  script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
  script_set_attribute(attribute:"exploit_available", value:"true");
  script_set_attribute(attribute:"exploit_framework_canvas", value:"true");
  script_set_attribute(attribute:"canvas_package", value:'D2ExploitPack');

 script_set_attribute(attribute:"vuln_publication_date", value:"2007/02/08");
 script_set_attribute(attribute:"plugin_publication_date", value:"2007/02/13");

  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:hp:loadrunner");
  script_end_attributes();

  script_category(ACT_ATTACK);
  script_family(english:"Gain a shell remotely");
  script_copyright(english:"This script is Copyright (C) 2007-2018 Tenable Network Security, Inc.");

  script_dependencies("hp_loadrunner_cve-2013-4800.nbin");
  script_require_ports("Services/loadrunner_agent");

  exit(0);
}

include("audit.inc");
include("byte_func.inc");
include("global_settings.inc");
include("misc_func.inc");

port = get_service(svc: "loadrunner_agent", default: 54345, exit_on_fail: TRUE);

# Check port state before sending probes
if (!get_port_state(port)) audit(AUDIT_PORT_CLOSED, port, "TCP");

# Establish a connection.
soc = open_sock_tcp(port);
if (!soc) audit(AUDIT_SOCK_FAIL, port, "TCP");


function mk_padded_string(str)
{
  return mkdword(strlen(str)) + str + crap(data:mkbyte(0), length:4-(strlen(str) % 4));
}

# Define some constants.
guid = base64(str:rand_str(length:17));
pid = rand() % 0xffff;
tid = rand() % 0xffff;
rand16 = crap(16);
# nb: don't change these!!!
server_name = "nessus";
server_full_name = server_name;
server_ip = server_name;
server_port = 12345;


# Send an invalid request.
#
# - first part.
req1 = mkdword(0x19);
send(socket:soc, data:req1);

# - second part.
req2_1 = guid + "0";

req2_2 =
      mkdword(7) +
      mk_padded_string(
        str:server_name + ";" + pid + ";" + tid
      ) +
      mk_padded_string(
        str:string(
          "(-server_type=8)",
          "(-server_name=", server_name, ")",
          "(-server_full_name=", server_name, ")",
          "(-server_ip_name=", server_ip, ")",
          "(-server_port=", server_port, ")",
          "(-server_fd_secondary=4)",
          "(-guid_identifier=", guid, ")",
          # nb: crap length is chosen so that the length of the subpacket
          #     is 0x400, which in a patched version will cause the
          #     thread to just close.
          "(-crap=", crap(data:"A", length:0x34a), ")"
        )
      ) +
      mkdword(0x7530);
req2_2 = mkdword(4 + strlen(req2_2)) + req2_2;
req2_2 =
    mkdword(0x1c) +
    mkdword(0x05) +
    mkdword(0x01) +
    rand16 +
    req2_2;
req2_2 = mkdword(strlen(req2_2)) + req2_2;
req2 = req2_1 + req2_2;

send(socket:soc, data:req2);


# There's a problem if we see a response.
res = recv(socket:soc, length:4);
close(soc);
if (strlen(res) == 4 && getdword(blob:res, pos:0) == 0x1c) security_hole(port);
else audit(AUDIT_LISTEN_NOT_VULN, "service", port);

Saint

bid22487
descriptionHP Mercury LoadRunner mchan.dll buffer overflow
idmisc_mercuryloadrunnerbo
osvdb33132
titlehp_mercury_mchan
typeremote