Webmin <= 1.910 Remote Command Execution - Nessus

High   Plugin ID: 146488

This page contains detailed information about the Webmin <= 1.910 Remote 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: 146488
Name: Webmin <= 1.910 Remote Command Execution
Filename: webmin_1_920.nasl
Vulnerability Published: 2019-06-15
This Plugin Published: 2021-02-15
Last Modification Time: 2021-02-19
Plugin Version: 1.3
Plugin Type: remote
Plugin Family: CGI abuses
Dependencies: webmin.nasl
Required KB Items [?]: Settings/ParanoidReport, www/webmin

Vulnerability Information


Severity: High
Vulnerability Published: 2019-06-15
Patch Published: 2019-06-15
CVE [?]: CVE-2019-12840
CPE [?]: cpe:/a:webmin:webmin

Synopsis

The remote web server is affected by a remote command execution vulnerability.

Description

A remote command execution vulnerability exists in Package Updates module. An authenticated, remote attacker can exploit this if they are authorized to the Package Updates module via the data parameter to update.cgi in order to execute arbitrary commands with root privileges.

Solution

Upgrade to Webmin 1.920 or later.

Public Exploits


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

Here's the list of publicly known exploits and PoCs for verifying the Webmin <= 1.910 Remote Command Execution vulnerability:

  1. Metasploit: exploit/linux/http/webmin_packageup_rce
    [Webmin Package Updates Remote Command Execution]
  2. Exploit-DB: exploits/linux/remote/46984.rb
    [EDB-46984: Webmin 1.910 - 'Package Updates' Remote Command Execution (Metasploit)]
  3. Exploit-DB: exploits/linux/webapps/49318.rb
    [EDB-49318: Webmin 1.962 - 'Package Updates' Escape Bypass RCE (Metasploit)]
  4. GitHub: https://github.com/WizzzStark/CVE-2019-12840.py
    [CVE-2019-12840: POC: CVE-2019-12840 (Authenticated RCE - Webmin Package Updates)]
  5. GitHub: https://github.com/zAbuQasem/CVE-2019-12840
    [CVE-2019-12840]
  6. GitHub: https://github.com/anasbousselham/webminscan
    [CVE-2019-12840: Webmin Exploit Scanner CVE-2020-35606 CVE-2019-12840]
  7. GitHub: https://github.com/bkaraceylan/CVE-2019-12840_POC
    [CVE-2019-12840: PoC for Webmin Package Update Authenticated Remote Command Execution]
  8. GitHub: https://github.com/KrE80r/webmin_cve-2019-12840_poc
    [CVE-2019-12840: A standalone POC for CVE-2019-12840]

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-12840
CVSS V2 Vector: AV:N/AC:L/Au:S/C:C/I:C/A:C/E:F/RL:OF/RC:C
CVSS Base Score:9.0 (High)
Impact Subscore:10.0
Exploitability Subscore:8.0
CVSS Temporal Score:7.4 (High)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:7.4 (High)
CVSS V3 Vector: CVSS:3.0/AV:N/AC:L/PR:L/UI:N/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 webmin_1_920.nasl nessus plugin source code. This script is Copyright (C) 2021 and is owned by Tenable, Inc. or an Affiliate thereof.

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

include('compat.inc');

if (description)
{
  script_id(146488);
  script_version("1.3");
  script_set_attribute(attribute:"plugin_modification_date", value:"2021/02/19");

  script_cve_id("CVE-2019-12840");

  script_name(english:"Webmin <= 1.910 Remote Command Execution");

  script_set_attribute(attribute:"synopsis", value:
"The remote web server is affected by a remote command execution vulnerability.");
  script_set_attribute(attribute:"description", value:
"A remote command execution vulnerability exists in Package Updates module. An authenticated, remote attacker can
exploit this if they are authorized to the Package Updates module via the data parameter to update.cgi in order to
execute arbitrary commands with  root privileges.");
  script_set_attribute(attribute:"see_also", value:"http://www.webmin.com/changes.html");
  script_set_attribute(attribute:"solution", value:
"Upgrade to Webmin 1.920 or later.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:S/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:L/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-12840");

  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:'Webmin Package Updates Remote Command Execution');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2019/06/15");
  script_set_attribute(attribute:"patch_publication_date", value:"2019/06/15");
  script_set_attribute(attribute:"plugin_publication_date", value:"2021/02/15");

  script_set_attribute(attribute:"potential_vulnerability", value:"true");
  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:webmin:webmin");
  script_end_attributes();

  script_category(ACT_GATHER_INFO);
  script_family(english:"CGI abuses");

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

  script_dependencies("webmin.nasl");
  script_require_keys("www/webmin", "Settings/ParanoidReport");
  script_require_ports("Services/www", 10000);

  exit(0);
}

include('vcf.inc');
include('http.inc');

if (report_paranoia < 2) audit(AUDIT_PARANOID);

app = 'Webmin';
port = get_http_port(default:10000, embedded: TRUE);

app_info = vcf::get_app_info(app:app, port:port, webapp:TRUE);
vcf::check_granularity(app_info:app_info, sig_segments:2);

constraints = [
  { 'max_version':'1.910', 'fixed_version':'1.920' }
];

vcf::check_version_and_report(
  app_info:app_info,
  constraints:constraints,
  severity:SECURITY_HOLE
);

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

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

Go back to menu.

How to Run


Here is how to run the Webmin <= 1.910 Remote 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 CGI abuses plugin family.
  6. On the right side table select Webmin <= 1.910 Remote Command Execution plugin ID 146488.
  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 webmin_1_920.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

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

Go back to menu.

References


See also: Similar and related Nessus plugins:
  • 108549 - Webmin < 1.250 miniserv.pl Remote Code Execution
  • 21785 - Webmin 'miniserv.pl' Arbitrary File Disclosure
  • 117602 - Webmin <= 1.590 Multiple Vulnerabilities
  • 127911 - Webmin 1.890 - 1.920 Remote Command Execution (CVE-2019-15107, CVE-2019-15231)
  • 146495 - Webmin < 1.970 Multiple Vulnerabilities
  • 20343 - Webmin 'miniserv.pl' 'username' Parameter Format String
  • 128280 - Webmin < 1.930 Remote Code Execution Vulnerability
  • 146531 - Webmin <= 1.941 Multiple Vulnerabilities
  • 22908 - Debian DSA-1199-1 : webmin - multiple vulnerabilities
  • 21789 - FreeBSD : webmin, usermin -- arbitrary file disclosure vulnerability (227475c2-09cb-11db-9156-000e0c2e438a)
  • 21504 - FreeBSD : perl, webmin, usermin -- perl format string integer wrap vulnerability (bb33981a-7ac6-11da-bf72-00123f589060)
  • 127954 - FreeBSD : webmin -- unauthenticated remote code execution (ece65d3b-c20c-11e9-8af4-bcaec55be5e5)
  • 20281 - GLSA-200512-02 : Webmin, Usermin: Format string vulnerability
  • 22169 - GLSA-200608-11 : Webmin, Usermin: File Disclosure
  • 20454 - Mandrake Linux Security Advisory : webmin (MDKSA-2005:223)
  • 23876 - Mandrake Linux Security Advisory : webmin (MDKSA-2006:125)
  • 73066 - Mandriva Linux Security Advisory : webmin (MDVSA-2014:062)

Version


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

Go back to menu.