Elevating rights to use mach_inject

我只是一个虾纸丫 提交于 2020-02-17 18:15:26

问题


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


回答1:


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.




回答2:


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).



来源:https://stackoverflow.com/questions/1258600/elevating-rights-to-use-mach-inject

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!