Rapid7 Vulnerability & Exploit Database

Mac OS X TimeMachine (tmdiagnose) Command Injection Privilege Escalation

Back to Search

Mac OS X TimeMachine (tmdiagnose) Command Injection Privilege Escalation

Disclosed
04/13/2019
Created
06/29/2019

Description

This module exploits a command injection in TimeMachine on macOS <= 10.14.3 in order to run a payload as root. The tmdiagnose binary on OSX <= 10.14.3 suffers from a command injection vulnerability that can be exploited by creating a specially crafted disk label. The tmdiagnose binary uses awk to list every mounted volume, and composes shell commands based on the volume labels. By creating a volume label with the backtick character, we can have our own binary executed with root priviledges.

Author(s)

  • CodeColorist
  • timwr

Development

Module Options

To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':

msf > use exploit/osx/local/timemachine_cmd_injection
msf exploit(timemachine_cmd_injection) > show targets
    ...targets...
msf exploit(timemachine_cmd_injection) > set TARGET < target-id >
msf exploit(timemachine_cmd_injection) > show options
    ...show and set options...
msf exploit(timemachine_cmd_injection) > exploit

Time is precious, so I don’t want to do something manually that I can automate. Leveraging the Metasploit Framework when automating any task keeps us from having to re-create the wheel as we can use the existing libraries and focus our efforts where it matters.

– Jim O’Gorman | President, Offensive Security

;