Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Elevating rights to use mach_inject

How do you elevate user rights to root using the Authorization API so that it is possible to use mach_inject?

like image 555
James Hu Avatar asked Aug 11 '09 05:08

James Hu


2 Answers

You don't need to be root to use mach_inject; instead, you need to sign your code. For testing purposes only (and in 10.4/10.5) you can also make your application setgid procmod.

See TN2206 for more information.

like image 190
Nicholas Riley Avatar answered Nov 17 '22 06:11

Nicholas Riley


Old question, but incorrect answer:

Unless you own the pid/task, you actually do need to EITHER be root or be a member of procmod. In OS X, this has little to do with code signing. Mach_inject/Mach_star use by the Mach trap task_for_pid(), which requires the above privileges. In iOS , you also need the corresponding entitlement (task_for_pid-allow), which is where code signing would come in handy (using ldid for self signing).

like image 43
Technologeeks Avatar answered Nov 17 '22 04:11

Technologeeks