module

Mac OS X libxpc MITM Privilege Escalation

Disclosed
03/15/2018
Created
03/19/2019

Description

This module exploits a vulnerablity in libxpc on macOS
The task_set_special_port API allows callers to overwrite their bootstrap port,
which is used to communicate with launchd. This port is inherited across forks:
child processes will use the same bootstrap port as the parent.
By overwriting the bootstrap port and forking a child processes, we can now gain
a MitM position between our child and launchd.

To gain root we target the sudo binary and intercept its communication with
opendirectoryd, which is used by sudo to verify credentials. We modify the
replies from opendirectoryd to make it look like our password was valid.

Author

saelo

Platform

OSX

Architectures

x64

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/libxpc_mitm_ssudo
    msf /(o) > show actions
        ...actions...
    msf /(o) > set ACTION < action-name >
    msf /(o) > show options
        ...show and set options...
    msf /(o) > run
  
Title
NEW

Explore Exposure Command

Confidently identify and prioritize exposures from endpoint to cloud with full attack surface visibility and threat-aware risk context.