FreeBSD : webmin -- unauthenticated remote code execution (ece65d3b-c20c-11e9-8af4-bcaec55be5e5) - Nessus

Critical   Plugin ID: 127954

This page contains detailed information about the FreeBSD : webmin -- unauthenticated remote code execution (ece65d3b-c20c-11e9-8af4-bcaec55be5e5) Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 127954
Name: FreeBSD : webmin -- unauthenticated remote code execution (ece65d3b-c20c-11e9-8af4-bcaec55be5e5)
Filename: freebsd_pkg_ece65d3bc20c11e98af4bcaec55be5e5.nasl
Vulnerability Published: 2019-08-17
This Plugin Published: 2019-08-20
Last Modification Time: 2022-03-29
Plugin Version: 1.7
Plugin Type: local
Plugin Family: FreeBSD Local Security Checks
Dependencies: ssh_get_info.nasl
Required KB Items [?]: Host/FreeBSD/pkg_info, Host/FreeBSD/release, Host/local_checks_enabled

Vulnerability Information


Severity: Critical
Vulnerability Published: 2019-08-17
Patch Published: 2019-08-17
CVE [?]: CVE-2019-15107
CPE [?]: cpe:/o:freebsd:freebsd, p-cpe:/a:freebsd:freebsd:usermin, p-cpe:/a:freebsd:freebsd:webmin

Synopsis

The remote FreeBSD host is missing one or more security-related updates.

Description

Joe Cooper reports :

I've rolled out Webmin version 1.930 and Usermin version 1.780 for all repositories. This release includes several security fixes, including one potentially serious one caused by malicious code inserted into Webmin and Usermin at some point on our build infrastructure. We're still investigating how and when, but the exploitable code has never existed in our github repositories, so we've rebuilt from git source on new infrastructure (and checked to be sure the result does not contain the malicious code).

I don't have a changelog for these releases yet, but I wanted to announce them immediately due to the severity of this issue. To exploit the malicious code, your Webmin installation must have Webmin -> Webmin Configuration -> Authentication -> Password expiry policy set to Prompt users with expired passwords to enter a new one. This option is not set by default, but if it is set, it allows remote code execution.

This release addresses CVE-2019-15107, which was disclosed earlier today. It also addresses a handful of XSS issues that we were notified about, and a bounty was awarded to the researcher (a different one) who found them.

Solution

Update the affected packages.

Public Exploits


Target Network Port(s): N/A
Target Asset(s): N/A
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 FreeBSD : webmin -- unauthenticated remote code execution (ece65d3b-c20c-11e9-8af4-bcaec55be5e5) vulnerability:

  1. Metasploit: exploit/linux/http/webmin_backdoor
    [Webmin password_change.cgi Backdoor]
  2. Exploit-DB: exploits/linux/webapps/47293.sh
    [EDB-47293: Webmin 1.920 - Remote Code Execution]
  3. GitHub: https://github.com/0xaniketB/TryHackMe-Wreath
    [CVE-2019-15107]
  4. GitHub: https://github.com/3gstudent/Homework-of-Python
    [CVE-2019-15107]
  5. GitHub: https://github.com/Mr-xn/Penetration_Testing_POC
    [CVE-2019-15107]
  6. GitHub: https://github.com/MuirlandOracle/CVE-2019-15107
    [CVE-2019-15107]
  7. GitHub: https://github.com/Pichuuuuu/CVE-2019-15107
    [CVE-2019-15107]
  8. GitHub: https://github.com/SexyBeast233/SecBooks
    [CVE-2019-15107]
  9. GitHub: https://github.com/Tuz-Wwsd/CVE-2019-15107_detection
    [CVE-2019-15107]
  10. GitHub: https://github.com/YeezyTaughtMe1/HTB-Postman
    [CVE-2019-15107]
  11. GitHub: https://github.com/cd6629/Python-scripts
    [CVE-2019-15107]
  12. GitHub: https://github.com/cdedmondson/Modified-CVE-2019-15107
    [CVE-2019-15107]
  13. GitHub: https://github.com/chalern/Pentest-Tools
    [CVE-2019-15107]
  14. GitHub: https://github.com/darrenmartyn/CVE-2019-15107
    [CVE-2019-15107: Something I wrote for CVE-2019-15107, a Webmin backdoor]
  15. GitHub: https://github.com/diegojuan/CVE-2019-15107
    [CVE-2019-15107]
  16. GitHub: https://github.com/f0rkr/CVE-2019-15107
    [CVE-2019-15107]
  17. GitHub: https://github.com/fengjixuchui/RedTeamer
    [CVE-2019-15107]
  18. GitHub: https://github.com/fofapro/vulfocus
    [CVE-2019-15107]
  19. GitHub: https://github.com/foxsin34/WebMin-1.890-Exploit-unauthorized-RCE
    [CVE-2019-15107]
  20. GitHub: https://github.com/hanc00l/some_pocsuite
    [CVE-2019-15107]
  21. GitHub: https://github.com/ianxtianxt/CVE-2019-15107
    [CVE-2019-15107]
  22. GitHub: https://github.com/jas502n/CVE-2019-15642
    [CVE-2019-15107]
  23. GitHub: https://github.com/lonehand/TIPS
    [CVE-2019-15107]
  24. GitHub: https://github.com/merlin-ke/CVE_2019_15107
    [CVE-2019-15107: POC Code for gaining foothold on a server vulnerable to CVE_2019_15107]
  25. GitHub: https://github.com/n0obit4/Webmin_1.890-POC
    [CVE-2019-15107: CVE-2019-15107 exploit]
  26. GitHub: https://github.com/puckiestyle/CVE-2019-15107
    [CVE-2019-15107]
  27. GitHub: https://github.com/ruthvikvegunta/CVE-2019-15107
    [CVE-2019-15107: Webmin <=1.920 RCE]
  28. GitHub: https://github.com/squid22/Webmin_CVE-2019-15107
    [CVE-2019-15107: CVE-2019–15107 - Unauthenticated RCE Webmin <=1.920]
  29. GitHub: https://github.com/tom0li/collection-document
    [CVE-2019-15107]
  30. GitHub: https://github.com/ugur-ercan/exploit-collection
    [CVE-2019-15107]
  31. GitHub: https://github.com/AdministratorGithub/CVE-2019-15107
    [CVE-2019-15107: CVE-2019-15107 webmin python3]
  32. GitHub: https://github.com/AleWong/WebminRCE-EXP-CVE-2019-15107-
    [CVE-2019-15107: Remote Code Execution Vulnerability in Webmin]
  33. GitHub: https://github.com/g0db0x/CVE_2019_15107
    [CVE-2019-15107: CVE_2019_15107 Webmin 1.920 Remote Code Execution Exploit]
  34. GitHub: https://github.com/HACHp1/webmin_docker_and_exp
    [CVE-2019-15107: Dockerfiles for CVE-2019-15107(webmin RCE) recurrence including v1.890 and v1.920 ...]
  35. GitHub: https://github.com/hacknotes/CVE-2019-15107-Exploit
    [CVE-2019-15107: Exploit para CVE-2019-15107 (Webmin 1.890-1.920) sin credenciales RCE escrito en ...]
  36. GitHub: https://github.com/jas502n/CVE-2019-15107
    [CVE-2019-15107: CVE-2019-15107 Webmin RCE (unauthorized)]
  37. GitHub: https://github.com/ketlerd/CVE-2019-15107
    [CVE-2019-15107: Implementation of CVE-2019-15107 exploit in python]
  38. GitHub: https://github.com/Rayferrufino/Make-and-Break
    [CVE-2019-15107: Built a custom Virtual Machine, running Ubuntu 18.04.1 and Webmin 1.810. Using ...]
  39. GitHub: https://github.com/ChakoMoonFish/webmin_CVE-2019-15107
    [CVE-2019-15107: Webmin_CVE-2019-15107]
  40. GitHub: https://github.com/hannob/webminex
    [CVE-2019-15107: Poc exploit for webmin backdoor (CVE-2019-15107 and CVE-2019-15231)]
  41. GitHub: https://github.com/whokilleddb/CVE-2019-15107
    [CVE-2019-15107: CVE-2019-15107 Webmin Exploit in C]

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-15107
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 freebsd_pkg_ece65d3bc20c11e98af4bcaec55be5e5.nasl nessus plugin source code. This script is Copyright (C) 2019-2022 and is owned by Tenable, Inc. or an Affiliate thereof.

#%NASL_MIN_LEVEL 70300
#
# (C) Tenable Network Security, Inc.
#
# The descriptive text and package checks in this plugin were  
# extracted from the FreeBSD VuXML database :
#
# Copyright 2003-2022 Jacques Vidrine and contributors
#
# Redistribution and use in source (VuXML) and 'compiled' forms (SGML,
# HTML, PDF, PostScript, RTF and so forth) with or without modification,
# are permitted provided that the following conditions are met:
# 1. Redistributions of source code (VuXML) must retain the above
#    copyright notice, this list of conditions and the following
#    disclaimer as the first lines of this file unmodified.
# 2. Redistributions in compiled form (transformed to other DTDs,
#    published online in any format, converted to PDF, PostScript,
#    RTF and other formats) must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer
#    in the documentation and/or other materials provided with the
#    distribution.
# 
# THIS DOCUMENTATION IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
# OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
# OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS DOCUMENTATION,
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

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

if (description)
{
  script_id(127954);
  script_version("1.7");
  script_set_attribute(attribute:"plugin_modification_date", value:"2022/03/29");

  script_cve_id("CVE-2019-15107");
  script_xref(name:"CISA-KNOWN-EXPLOITED", value:"2022/04/15");

  script_name(english:"FreeBSD : webmin -- unauthenticated remote code execution (ece65d3b-c20c-11e9-8af4-bcaec55be5e5)");
  script_summary(english:"Checks for updated packages in pkg_info output");

  script_set_attribute(
    attribute:"synopsis",
    value:
"The remote FreeBSD host is missing one or more security-related
updates."
  );
  script_set_attribute(
    attribute:"description",
    value:
"Joe Cooper reports :

I've rolled out Webmin version 1.930 and Usermin version 1.780 for all
repositories. This release includes several security fixes, including
one potentially serious one caused by malicious code inserted into
Webmin and Usermin at some point on our build infrastructure. We're
still investigating how and when, but the exploitable code has never
existed in our github repositories, so we've rebuilt from git source
on new infrastructure (and checked to be sure the result does not
contain the malicious code).

I don't have a changelog for these releases yet, but I wanted to
announce them immediately due to the severity of this issue. To
exploit the malicious code, your Webmin installation must have Webmin
-> Webmin Configuration -> Authentication -> Password expiry policy
set to Prompt users with expired passwords to enter a new one. This
option is not set by default, but if it is set, it allows remote code
execution.

This release addresses CVE-2019-15107, which was disclosed earlier
today. It also addresses a handful of XSS issues that we were notified
about, and a bounty was awarded to the researcher (a different one)
who found them."
  );
  script_set_attribute(
    attribute:"see_also",
    value:"https://virtualmin.com/node/66890"
  );
  # https://vuxml.freebsd.org/freebsd/ece65d3b-c20c-11e9-8af4-bcaec55be5e5.html
  script_set_attribute(
    attribute:"see_also",
    value:"http://www.nessus.org/u?a23b81f6"
  );
  script_set_attribute(attribute:"solution", value:"Update the affected packages.");
  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-2019-15107");
  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 password_change.cgi Backdoor');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");

  script_set_attribute(attribute:"plugin_type", value:"local");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:freebsd:freebsd:usermin");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:freebsd:freebsd:webmin");
  script_set_attribute(attribute:"cpe", value:"cpe:/o:freebsd:freebsd");

  script_set_attribute(attribute:"vuln_publication_date", value:"2019/08/17");
  script_set_attribute(attribute:"patch_publication_date", value:"2019/08/17");
  script_set_attribute(attribute:"plugin_publication_date", value:"2019/08/20");
  script_set_attribute(attribute:"generated_plugin", value:"current");
  script_end_attributes();

  script_category(ACT_GATHER_INFO);
  script_copyright(english:"This script is Copyright (C) 2019-2022 and is owned by Tenable, Inc. or an Affiliate thereof.");
  script_family(english:"FreeBSD Local Security Checks");

  script_dependencies("ssh_get_info.nasl");
  script_require_keys("Host/local_checks_enabled", "Host/FreeBSD/release", "Host/FreeBSD/pkg_info");

  exit(0);
}


include("audit.inc");
include("freebsd_package.inc");


if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
if (!get_kb_item("Host/FreeBSD/release")) audit(AUDIT_OS_NOT, "FreeBSD");
if (!get_kb_item("Host/FreeBSD/pkg_info")) audit(AUDIT_PACKAGE_LIST_MISSING);


flag = 0;

if (pkg_test(save_report:TRUE, pkg:"webmin<1.930")) flag++;
if (pkg_test(save_report:TRUE, pkg:"usermin<1.780")) flag++;

if (flag)
{
  if (report_verbosity > 0) security_hole(port:0, extra:pkg_report_get());
  else security_hole(0);
  exit(0);
}
else audit(AUDIT_HOST_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/freebsd_pkg_ece65d3bc20c11e98af4bcaec55be5e5.nasl
  • Windows:
    C:\ProgramData\Tenable\Nessus\nessus\plugins\freebsd_pkg_ece65d3bc20c11e98af4bcaec55be5e5.nasl
  • Mac OS X:
    /Library/Nessus/run/lib/nessus/plugins/freebsd_pkg_ece65d3bc20c11e98af4bcaec55be5e5.nasl

Go back to menu.

How to Run


Here is how to run the FreeBSD : webmin -- unauthenticated remote code execution (ece65d3b-c20c-11e9-8af4-bcaec55be5e5) 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 FreeBSD Local Security Checks plugin family.
  6. On the right side table select FreeBSD : webmin -- unauthenticated remote code execution (ece65d3b-c20c-11e9-8af4-bcaec55be5e5) plugin ID 127954.
  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 freebsd_pkg_ece65d3bc20c11e98af4bcaec55be5e5.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

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

Go back to menu.

References


See also: Similar and related Nessus plugins:
  • 127911 - Webmin 1.890 - 1.920 Remote Command Execution (CVE-2019-15107, CVE-2019-15231)
  • 128280 - Webmin < 1.930 Remote Code Execution Vulnerability

Version


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

Go back to menu.