Multiple Command Injection Vulnerabilities in Grandstream Products - Nessus

Critical   Plugin ID: 124173

This page contains detailed information about the Multiple Command Injection Vulnerabilities in Grandstream Products Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 124173
Name: Multiple Command Injection Vulnerabilities in Grandstream Products
Filename: grandstream_sip_2019_003.nasl
Vulnerability Published: 2019-03-22
This Plugin Published: 2019-04-19
Last Modification Time: 2022-02-09
Plugin Version: 1.7
Plugin Type: remote
Plugin Family: Misc.
Dependencies: grandstream_sip_detect.nbin

Vulnerability Information


Severity: Critical
Vulnerability Published: 2019-03-22
Patch Published: 2019-03-22
CVE [?]: CVE-2019-10655, CVE-2019-10659, CVE-2019-10660, CVE-2019-10661, CVE-2019-10662, CVE-2019-10663
CPE [?]: N/A

Synopsis

The remote device is vulnerable and can be compromised

Description

Multiple Vulnerabilities in Grandstream devices.

- The affected devices are: GAC2500, GVC3202, GXP2200, GXV3275, GXV3240, GXV3611IR_HD, GXV3611IR_HD, GXV3611IR_HD, UCM6204, GXV3370, & WP820.

- A remote command execution vulnerability exists in the 'priority' and 'logserver' parameters. An unauthenticated, remote attacker can exploit them to bypass authentication and execute arbitrary commands with root privileges.

- A blind command injection vulnerability exists in the 'file-backup' parameter. An unauthenticated, remote attacker can exploit this to bypass authentication and obtain a root shell.

Solution

Update to the fixed version as per the advisory.

Public Exploits


Target Network Port(s): N/A
Target Asset(s): Services/sip, Services/udp/sip
Exploit Available: True (Metasploit Framework, GitHub)
Exploit Ease: Exploits are available

Here's the list of publicly known exploits and PoCs for verifying the Multiple Command Injection Vulnerabilities in Grandstream Products vulnerability:

  1. Metasploit: exploit/linux/http/grandstream_gxv3175_settimezone_unauth_cmd_exec
    [Grandstream GXV3175 'settimezone' Unauthenticated Command Execution]
  2. Metasploit: exploit/linux/http/grandstream_gxv31xx_settimezone_unauth_cmd_exec
    [Grandstream GXV31XX 'settimezone' Unauthenticated Command Execution]
  3. Metasploit: exploit/linux/http/grandstream_ucm62xx_sendemail_rce
    [Grandstream UCM62xx IP PBX sendPasswordEmail RCE]
  4. GitHub: https://github.com/scarvell/grandstream_exploits
    [CVE-2019-10655]
  5. GitHub: https://github.com/scarvell/grandstream_exploits
    [CVE-2019-10659]
  6. GitHub: https://github.com/scarvell/grandstream_exploits
    [CVE-2019-10660]
  7. GitHub: https://github.com/scarvell/grandstream_exploits
    [CVE-2019-10662]

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-2019-10661
CVSS V2 Vector: AV:N/AC:L/Au:N/C:C/I:C/A:C/E:F/RL:OF/RC:C
CVSS Base Score:10.0 (High)
Impact Subscore:10.0
Exploitability Subscore:10.0
CVSS Temporal Score:8.3 (High)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:8.3 (High)
CVSS V3 Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:F/RL:O/RC:C
CVSS Base Score:9.8 (Critical)
Impact Subscore:5.9
Exploitability Subscore:3.9
CVSS Temporal Score:9.1 (Critical)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:9.1 (Critical)

Go back to menu.

Plugin Source


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

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

include('compat.inc');

if (description)
{
  script_id(124173);
  script_version("1.7");
  script_set_attribute(attribute:"plugin_modification_date", value:"2022/02/09");

  script_cve_id(
    "CVE-2019-10655",
    "CVE-2019-10659",
    "CVE-2019-10660",
    "CVE-2019-10661",
    "CVE-2019-10662",
    "CVE-2019-10663"
  );

  script_name(english:"Multiple Command Injection Vulnerabilities in Grandstream Products");

  script_set_attribute(attribute:"synopsis", value:
"The remote device is vulnerable and can be compromised");
  script_set_attribute(attribute:"description", value:
"Multiple Vulnerabilities in Grandstream devices.

   - The affected devices are: GAC2500, GVC3202, GXP2200, 
     GXV3275, GXV3240, GXV3611IR_HD, GXV3611IR_HD, GXV3611IR_HD, 
     UCM6204, GXV3370, & WP820.

   - A remote command execution vulnerability exists in the 'priority' 
     and 'logserver' parameters. An unauthenticated, remote attacker can exploit 
     them to bypass authentication and execute arbitrary commands
     with root privileges. 

   - A blind command injection vulnerability exists in the 
     'file-backup' parameter. An unauthenticated, remote attacker can
     exploit this to bypass authentication and obtain a root shell.");
  script_set_attribute(attribute:"solution", value:
"Update to the fixed version as per the advisory.");
  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_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:N/UI:N/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:"cvss_score_source", value:"CVE-2019-10661");

  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:'Grandstream GXV31XX settimezone Unauthenticated Command Execution');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2019/03/22");
  script_set_attribute(attribute:"patch_publication_date", value:"2019/03/22");
  script_set_attribute(attribute:"plugin_publication_date", value:"2019/04/19");

  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) 2019-2022 and is owned by Tenable, Inc. or an Affiliate thereof.");

  script_dependencies("grandstream_sip_detect.nbin");
  script_require_ports("Services/sip", "Services/udp/sip");

  exit(0);
}

include('audit.inc');
include('global_settings.inc');
include('misc_func.inc');
include('vcf.inc');
include('obj.inc');

# obtain ports/proto detected or exit...
detected_on = get_kb_list('sip/grandstream');

if (empty_or_null(detected_on))
  exit(0, "No Grandstream Models were found in the global KB.");


# Flatten the entries out to get the list of URLs.
detected_on = list_uniq(make_list(detected_on));

# initialize... before chking / appending any possible results
vuln = FALSE;
report = NULL;

# what's affected...
models = {
  'GAC2500' : { 'constraints': [{'max_version' : '1.0.3.30', 'fixed_version' : '1.0.3.35', 'fixed_display' : '1.0.3.35'}]},
  'GVC3200' : { 'constraints': [{'max_version' : '1.0.3.51', 'fixed_version' : '1.0.3.57', 'fixed_display' : '1.0.3.57 (Beta)'}]},
  'GVC3202' : { 'constraints': [{'max_version' : '1.0.3.51', 'fixed_version' : '1.0.3.57', 'fixed_display' : '1.0.3.57 (Beta)'}]},
  'GXP2200' : { 'constraints': [{'max_version' : '1.0.3.27', 'fixed_version': '9.9.9.99', 'fixed_display' : 'this device is at the end-of-life'}]},
  'GXV3240' : { 'constraints': [{'max_version' : '1.0.3.210', 'fixed_version' : '1.0.3.219', 'fixed_display' : '1.0.3.219 (Beta)'}]},
  'GXV3275' : { 'constraints': [{'max_version' : '1.0.3.210', 'fixed_version' : '1.0.3.219', 'fixed_display' : '1.0.3.219 (Beta)'}]},
  'GXV3611IR_HD' : { 'constraints': [{'max_version' : '1.0.3.21', 'fixed_version' : '1.0.3.23', 'fixed_display' : '1.0.3.23'}]},
  'UCM6204' : { 'constraints': [{'max_version' : '1.0.18.12', 'fixed_version' : '1.0.19.20', 'fixed_display' : '1.0.19.20 (Beta)'}]},
  'GXV3370' : { 'constraints': [{'max_version' : '1.0.1.33', 'fixed_version' : '1.0.1.41', 'fixed_display' : '1.0.1.41 (Beta)'}]},
  'WP820'   : { 'constraints': [{'max_version' : '1.0.1.15', 'fixed_version' : '1.0.3.6', 'fixed_display' : '1.0.3.6'}]}
};


# loop through the detected_on (proto/port) assets
# obtain the model/version of the associated proto/port
# alert if matching the known affected assets
foreach port_proto (detected_on)
{
  model = get_kb_item("sip/grandstream/" + port_proto + "/model");
  version = get_kb_item("sip/grandstream/" + port_proto + "/version");
  if(empty_or_null(model) || empty_or_null(version))
    continue;

  # if the model is found, check for a version less than... 
  output = vcf::check_version(version:vcf::parse_version(version), constraints:models[model]['constraints']);

  if(!vcf::is_error(output) && !isnull(output))
  {
    vuln = TRUE;
    report +=
    '\n  Model             : ' + model +
    '\n  Installed Version : ' + version +
    '\n  Fixed Version     : ' + models[model]['constraints'][0]['fixed_display'] +
    '\n  Port / Protocol   : ' + port_proto +
    '\n';
  }
}

if(!vuln) audit(AUDIT_INST_PATH_NOT_VULN, 'The Grandstream asset' ); # is installed and not affected....
# we will have one or many ports... zeroing out...
security_report_v4(port:0, severity:SECURITY_HOLE, extra:report);

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

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

Go back to menu.

How to Run


Here is how to run the Multiple Command Injection Vulnerabilities in Grandstream Products 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 Multiple Command Injection Vulnerabilities in Grandstream Products plugin ID 124173.
  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 grandstream_sip_2019_003.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

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

Go back to menu.

References


See also: Similar and related Nessus plugins:
  • 123520 - Multiple Command Injection Vulnerabilities in Grandstream Products
  • 160530 - Grandstream Networks UCM6200 Series SQLi (Phone Web UI)
  • 123796 - Blind Command Injection Vulnerability in Grandstream Products
  • 160531 - Grandstream Networks UCM6200 Series SQLi (Web UI)
  • 160532 - Grandstream Networks UCM6200 Series SQLi (SIP)
  • 11197 - Multiple Ethernet Driver Frame Padding Information Disclosure (Etherleak)
  • 49217 - Multiple Switch Vendors '__super' Account Backdoor
  • 44937 - Multiple Adobe Products XML External Entity (XXE) Injection (APSB10-05)
  • 49003 - Multiple Vulnerabilities in the IOS FTP Server
  • 49017 - Multiple Cisco Products Vulnerable to DNS Cache Poisoning Attacks
  • 139545 - Multiple Vulnerabilities in Treck IP Stack Affecting Cisco Products: June 2020 (cisco-sa-treck-ip-stack-JyBQ5GyC)
  • 11748 - Multiple Dangerous CGI Script Detection
  • 33447 - Multiple Vendor DNS Query ID Field Prediction Cache Poisoning
  • 10821 - Multiple FTPD glob Command Arbitrary Command Execution
  • 10084 - Multiple FTP Server Command Handling Overflow
  • 10930 - Multiple Web Server on Windows MS/DOS Device Request Remote DOS
  • 11337 - Multiple Linux rpc.mountd Remote Overflow
  • 10176 - Multiple Vendor phf CGI Arbitrary Command Execution
  • 10249 - Multiple Mail Server EXPN/VRFY Information Disclosure
  • 40449 - Multiple Vendor HMAC Authentication SNMPv3 Authentication Bypass
  • 10282 - Multiple Vendor test-cgi Arbitrary File Access
  • 11136 - Multiple OS /bin/login Remote Overflow
  • 80475 - Multiple Slider Plugins for WordPress 'img' Parameter Local File Inclusion Vulnerability
  • 31683 - Multiple Vendor NIS rpc.ypupdated YP Map Update Arbitrary Remote Command Execution

Version


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

Go back to menu.