MacOS 10.13 root Authentication Bypass (Security Update 2017-001) - Nessus

High   Plugin ID: 104814

This page contains detailed information about the MacOS 10.13 root Authentication Bypass (Security Update 2017-001) Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 104814
Name: MacOS 10.13 root Authentication Bypass (Security Update 2017-001)
Filename: macosx_high_sierra_empty_root_password.nasl
Vulnerability Published: 2017-11-28
This Plugin Published: 2017-11-28
Last Modification Time: 2019-11-12
Plugin Version: 1.12
Plugin Type: local
Plugin Family: MacOS X Local Security Checks
Dependencies: ssh_get_info.nasl
Required KB Items [?]: Host/local_checks_enabled, Host/MacOSX/Version

Vulnerability Information


Severity: High
Vulnerability Published: 2017-11-28
Patch Published: 2017-11-29
CVE [?]: CVE-2017-13872
CPE [?]: cpe:/o:apple:macos, cpe:/o:apple:mac_os_x
In the News: True

Synopsis

The remote host is running a version of MacOS that is affected by a root authentication bypass vulnerability.

Description

The remote host is running a version of MacOS 10.13 or 10.13.1 that is missing a security update. It is, therefore, affected by a root authentication bypass vulnerability. A local attacker or a remote attacker with credentials for a standard user account has the ability to blank out the root account password. This can allow an attacker to escalate privileges to root and execute commands and read files as a system administrator.

Solution

Install Security Update 2017-001 or later. Alternatively, enable the root account and set a strong root account password.

Public Exploits


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

Here's the list of publicly known exploits and PoCs for verifying the MacOS 10.13 root Authentication Bypass (Security Update 2017-001) vulnerability:

  1. Metasploit: exploit/osx/local/root_no_password
    [Mac OS X Root Privilege Escalation]
  2. Metasploit: auxiliary/scanner/vnc/ard_root_pw
    [Apple Remote Desktop Root Vulnerability]
  3. GitHub: https://github.com/TH3-HUNT3R/Root-MacOS
    [CVE-2017-13872]
  4. GitHub: https://github.com/axelvf/tools-highsierraroot
    [CVE-2017-13872]
  5. GitHub: https://github.com/giovannidispoto/CVE-2017-13872-Patch
    [CVE-2017-13872]
  6. GitHub: https://github.com/swisskyrepo/WHID_Toolkit
    [CVE-2017-13872]
  7. GitHub: https://github.com/thehappydinoa/rootOS
    [CVE-2017-13872]

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-2017-13872
CVSS V2 Vector: AV:N/AC:M/Au:N/C:C/I:C/A:C/E:F/RL:OF/RC:C
CVSS Base Score:9.3 (High)
Impact Subscore:10.0
Exploitability Subscore:8.6
CVSS Temporal Score:7.7 (High)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:7.7 (High)
CVSS V3 Vector: CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H/E:F/RL:O/RC:C
CVSS Base Score:8.1 (High)
Impact Subscore:5.9
Exploitability Subscore:2.2
CVSS Temporal Score:7.5 (High)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:7.5 (High)

Go back to menu.

Plugin Source


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

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

include("compat.inc");

if (description)
{
  script_id(104814);
  script_version("1.12");
  script_cvs_date("Date: 2019/11/12");

  script_cve_id("CVE-2017-13872");
  script_bugtraq_id(101981);
  script_xref(name:"APPLE-SA", value:"APPLE-SA-2017-11-29-1");

  script_name(english:"MacOS 10.13 root Authentication Bypass (Security Update 2017-001)");
  script_summary(english:"Checks for the presence of Security Update 2017-001.");

  script_set_attribute(attribute:"synopsis", value:
"The remote host is running a version of MacOS that is affected by
a root authentication bypass vulnerability.");
  script_set_attribute(attribute:"description", value:
"The remote host is running a version of MacOS 10.13 or 10.13.1 that
is missing a security update. It is, therefore, affected by a root
authentication bypass vulnerability. A local attacker or a remote
attacker with credentials for a standard user account has the ability
to blank out the root account password. This can allow an attacker to
escalate privileges to root and execute commands and read files as a
system administrator.");
  # https://objective-see.com/blog/blog_0x24.html
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?2cf4b55a");
  # https://twitter.com/lemiorhan/status/935578694541770752
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?9ff9ff45");
  # https://www.theregister.co.uk/2017/11/28/root_access_bypass_macos_high_sierra/
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?1e5890f3");
  # https://www.theverge.com/2017/11/28/16711782/apple-macos-high-sierra-critical-password-security-flaw
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?f367aab4");
  # https://support.apple.com/en-us/HT204012
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?f9f9bbc3");
  script_set_attribute(attribute:"see_also", value:"https://support.apple.com/en-us/HT208315");
  script_set_attribute(attribute:"solution", value:
"Install Security Update 2017-001 or later. Alternatively, enable the
root account and set a strong root account password.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:M/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:H/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-2017-13872");

  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:'Mac OS X Root Privilege Escalation');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");
  script_set_attribute(attribute:"in_the_news", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2017/11/28");
  script_set_attribute(attribute:"patch_publication_date", value:"2017/11/29");
  script_set_attribute(attribute:"plugin_publication_date", value:"2017/11/28");

  script_set_attribute(attribute:"plugin_type", value:"local");
  script_set_attribute(attribute:"cpe", value:"cpe:/o:apple:mac_os_x");
  script_set_attribute(attribute:"cpe", value:"cpe:/o:apple:macos");
  script_end_attributes();

  script_category(ACT_GATHER_INFO);
  script_family(english:"MacOS X Local Security Checks");

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

  script_dependencies("ssh_get_info.nasl");
  script_require_keys("Host/local_checks_enabled", "Host/MacOSX/Version");

  exit(0);
}

include("audit.inc");
include("global_settings.inc");
include("misc_func.inc");
include("ssh_func.inc");
include("macosx_func.inc");

if(sshlib::get_support_level() >= sshlib::SSH_LIB_SUPPORTS_COMMANDS)
  enable_ssh_wrappers();
else disable_ssh_wrappers();

if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);

os = get_kb_item_or_exit("Host/MacOSX/Version");

if (!preg(pattern:"Mac OS X 10\.13(\.[0-1]|[^0-9]|$)", string:os))
  audit(AUDIT_OS_NOT, "Mac OS X 10.13 / 10.13.1");

patch = "2017-001";
ver = UNKNOWN_VER;

cmd = "what /usr/libexec/opendirectoryd";
result = exec_cmd(cmd:cmd);
matches = pregmatch(pattern:"PROJECT:opendirectoryd-([0-9.]*)", string:result);
if (!isnull(matches) && !isnull(matches[1]))
  ver = matches[1];

if (preg(pattern:"Mac OS X 10\.13\.1([^0-9]|$)", string:os)) # 10.13.1
  fix = "483.20.7";
else # 10.13 / 10.13.0
  fix = "483.1.5";

if (ver == UNKNOWN_VER)
  audit(AUDIT_UNKNOWN_APP_VER, "opendirectoryd");

if (ver_compare(ver:ver, fix:fix, strict:FALSE) < 0)
{
  report = '\n  Missing security update : ' + patch +
           '\n  opendirectoryd version  : ' + ver +
           '\n  Fixed version           : ' + fix +
           '\n';
  security_report_v4(port:0, severity:SECURITY_HOLE, extra:report);
}
else
  audit(AUDIT_INST_VER_NOT_VULN, "opendirectoryd", ver);

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

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

Go back to menu.

How to Run


Here is how to run the MacOS 10.13 root Authentication Bypass (Security Update 2017-001) 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 MacOS X Local Security Checks plugin family.
  6. On the right side table select MacOS 10.13 root Authentication Bypass (Security Update 2017-001) plugin ID 104814.
  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 macosx_high_sierra_empty_root_password.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

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

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: APPLE-SA | Apple Security Advisory:
  • 2017-11-29-1
See also: Similar and related Nessus plugins:
  • 105080 - macOS 10.13.x < 10.13.2 Multiple Vulnerabilities (Meltdown)
  • 105003 - macOS 10.13 Authentication Bypass Remote Check (CVE-2017-13872)
  • 104848 - macOS 10.13 root Authentication Bypass Direct Check
  • 105081 - macOS and Mac OS X Multiple Vulnerabilities (Security Update 2017-002 and 2017-005)
  • 104379 - macOS and Mac OS X Multiple Vulnerabilities (Security Update 2017-001 and 2017-004)

Version


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

Go back to menu.