Grandstream Networks UCM6200 Series SQLi (SIP) - Nessus

Critical   Plugin ID: 160532

This page contains detailed information about the Grandstream Networks UCM6200 Series SQLi (SIP) Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 160532
Name: Grandstream Networks UCM6200 Series SQLi (SIP)
Filename: grandstream_sip_cve-2020-5722.nasl
Vulnerability Published: 2020-03-23
This Plugin Published: 2022-05-05
Last Modification Time: 2022-05-05
Plugin Version: 1.2
Plugin Type: remote
Plugin Family: Misc.
Dependencies: grandstream_sip_detect.nbin
Required KB Items [?]: installed_sw/Grandstream VoIP Device

Vulnerability Information


Severity: Critical
Vulnerability Published: 2020-03-23
Patch Published: 2020-02-03
CVE [?]: CVE-2020-5722
CPE [?]: N/A

Synopsis

The remote device is vulnerable and can be compromised

Description

A SQL injection vulnerability exists in Grandstream UCM6200 Series devices. An unauthenticated, remote attacker can exploit this to execute shell commands as root on versions before 1.0.19.20 or inject HTML in password recovery emails in versions before 1.0.20.17.

Note that Nessus has not tested for this issue but has instead relied only on the application's self-reported version number.

Solution

Update to the fixed version as per the advisory.

Public Exploits


Target Network Port(s): N/A
Target Asset(s): N/A
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 Grandstream Networks UCM6200 Series SQLi (SIP) vulnerability:

  1. Metasploit: exploit/linux/http/grandstream_ucm62xx_sendemail_rce
    [Grandstream UCM62xx IP PBX sendPasswordEmail RCE]
  2. Exploit-DB: exploits/hardware/webapps/48247.py
    [EDB-48247: UCM6202 1.0.18.13 - Remote Command Injection]

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

Go back to menu.

Plugin Source


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

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

include('compat.inc');

if (description)
{
  script_id(160532);
  script_version("1.2");
  script_set_attribute(attribute:"plugin_modification_date", value:"2022/05/05");

  script_cve_id("CVE-2020-5722");
  script_xref(name:"CISA-KNOWN-EXPLOITED", value:"2022/07/28");

  script_name(english:"Grandstream Networks UCM6200 Series SQLi (SIP)");

  script_set_attribute(attribute:"synopsis", value:
"The remote device is vulnerable and can be compromised");
  script_set_attribute(attribute:"description", value:
"A SQL injection vulnerability exists in Grandstream UCM6200 Series devices. An unauthenticated, remote attacker can
exploit this to execute shell commands as root on versions before 1.0.19.20 or inject HTML in password recovery emails
in versions before 1.0.20.17. 

Note that Nessus has not tested for this issue but has instead relied only on the application's self-reported version
number.");
  script_set_attribute(attribute:"see_also", value:"https://www.tenable.com/security/research/tra-2020-15");
  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:H/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:H/RL:O/RC:C");
  script_set_attribute(attribute:"cvss_score_source", value:"CVE-2020-5722");

  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 UCM62xx IP PBX sendPasswordEmail RCE');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2020/03/23");
  script_set_attribute(attribute:"patch_publication_date", value:"2020/02/03");
  script_set_attribute(attribute:"plugin_publication_date", value:"2022/05/05");

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

  script_dependencies("grandstream_sip_detect.nbin");
  script_require_keys("installed_sw/Grandstream VoIP Device");

  exit(0);
}

include('vcf.inc');

var app = 'Grandstream VoIP Device';

get_install_count(app_name:app, exit_if_zero:TRUE);
var installs = get_combined_installs(app_name:app);

if (installs[0] != IF_OK)
  audit(AUDIT_NOT_DETECT, app);

var vuln = FALSE;
var report = NULL;

var models = {
  'UCM6202' : { 'constraints': [{ 'fixed_version' : '1.0.20.17' }]},
  'UCM6204' : { 'constraints': [{ 'fixed_version' : '1.0.20.17' }]},
  'UCM6208' : { 'constraints': [{ 'fixed_version' : '1.0.20.17' }]}
};

# loop through the installs
# obtain the model/version of each detected install
# alert if matching the known affected assets
foreach var install (installs[1])
{
  var model = install.Model;
  var version = install.version;
  if(empty_or_null(model) || empty_or_null(version))
    continue;

  # if the model is found, check for a version less than... 
  var 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_version'] +
    '\n  Port / Protocol   : ' + install.protocol + '/' + install.port +
    '\n';
  }
}

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

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_cve-2020-5722.nasl
  • Windows:
    C:\ProgramData\Tenable\Nessus\nessus\plugins\grandstream_sip_cve-2020-5722.nasl
  • Mac OS X:
    /Library/Nessus/run/lib/nessus/plugins/grandstream_sip_cve-2020-5722.nasl

Go back to menu.

How to Run


Here is how to run the Grandstream Networks UCM6200 Series SQLi (SIP) 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 Grandstream Networks UCM6200 Series SQLi (SIP) plugin ID 160532.
  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_cve-2020-5722.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

/opt/nessus/bin/nasl -a grandstream_sip_cve-2020-5722.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_cve-2020-5722.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_cve-2020-5722.nasl -t <IP/HOST>

Go back to menu.

References


See also: Similar and related Nessus plugins:
  • 160530 - Grandstream Networks UCM6200 Series SQLi (Phone Web UI)
  • 160531 - Grandstream Networks UCM6200 Series SQLi (Web UI)
  • 123520 - Multiple Command Injection Vulnerabilities in Grandstream Products
  • 123796 - Blind Command Injection Vulnerability in Grandstream Products
  • 124173 - Multiple Command Injection Vulnerabilities in Grandstream Products
  • 101982 - Debian DLA-1040-1 : resiprocate security update
  • 111311 - Debian DLA-1439-1 : resiprocate security update
  • 156386 - Debian DLA-2865-1 : resiprocate - LTS security update
  • 152072 - FreeBSD : asterisk -- Remote Crash Vulnerability in PJSIP channel driver (ffa364e1-ebf5-11eb-aef1-0897988a1c07)
  • 156017 - SIP Script Remote Command Execution via log4shell
  • 55402 - Polycom SoundPoint IP Phones reg_1.html SIP Information Disclosure
  • 78822 - SIP Script Remote Command Execution via Shellshock
  • 22092 - sipXtapi INVITE Message CSeq Field Header Remote Overflow
  • 64293 - ViArt Shop sips_response.php DATA Parameter Request Parsing Remote Shell Command Execution
  • 48273 - ZoIPer < 2.24 Crafted SIP INVITE Request Remote DoS

Version


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

Go back to menu.