Rapid7

module

Mac OS X TimeMachine (tmdiagnose) Command Injection Privilege Escalation

Disclosed
Apr 13, 2019
Created
Jun 29, 2019

Description

This module exploits a command injection in TimeMachine on macOS order to run a payload as root. The tmdiagnose binary on OSX 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.

Authors

CodeColorist
timwr

Platform

OSX,Python,Unix

Architectures

x64, python, cmd

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

Title
Rapid7 Labs

2026 Global Threat Landscape Report

The predictive window has collapsed. Exploitation follows disclosure in days. See how attackers are accelerating and how to stay ahead.