06-30-2019, 03:42 PM
Hey, I am having some issues getting apps to inherit root privileges. Since the app will not use jailbreakd i am wondering how to go about this. Any help? * Note * the app IS installed to /Applications.
(06-30-2019, 03:50 PM)Chr0nicT Wrote: [ -> ]Give it proper entitlements for some stuff (platform-application would probably be your best bet) but also give it an option to pull for jailbreakd because some jailbreaks will honor that, instead.I have entitled it with jtool with this plist
An example of what I mean can be seen with Zebras supersling and/or cydias cydo
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>platform-application</key>
<true/>
<key>com.apple.private.skip-library-validation</key>
<true/>
<key>com.apple.private.security.no-container</key>
<true/>
</dict>
</plist>
(06-30-2019, 03:42 PM)Brandon Plank Wrote: [ -> ]Hey, I am having some issues getting apps to inherit root privileges. Since the app will not use jailbreakd i am wondering how to go about this. Any help? * Note * the app IS installed to /Applications.
com.apple.private.security.no-sandbox
com.apple.security.app-sandbox
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>platform-application</key>
<true/>
<key>com.apple.private.security.container-required</key>
<false/>
</dict>
</plist>
void getRootForPid(pid_t pid) { // Your Application's PID
uint64_t proc = proc_of_pid(pid);
uint64_t ucred = ReadAnywhere64(proc + off_p_ucred);
WriteAnywhere_32(ucred + off_ucred_cr_uid, 0);
WriteAnywhere_32(ucred + off_ucred_cr_ruid, 0);
WriteAnywhere_32(ucred + off_ucred_cr_svuid, 0);
WriteAnywhere_32(ucred + off_ucred_cr_rgid, 0);
WriteAnywhere_32(ucred + off_ucred_cr_svgid, 0);
}
(06-30-2019, 03:53 PM)GeoSn0w Wrote: [ -> ]So basically if i call that during the view did load, It should work?(06-30-2019, 03:42 PM)Brandon Plank Wrote: [ -> ]Hey, I am having some issues getting apps to inherit root privileges. Since the app will not use jailbreakd i am wondering how to go about this. Any help? * Note * the app IS installed to /Applications.
Hi Brandon.
Normally, on a jailbroken iOS device the privilege escalation for installed applications is done by the jailbreakd daemon, or a separate root daemon. It does not matter that the app is in /Applications, if you wanna rootify it and unsandbox it, you must make sure the right entitlements are set in the binary and that it can get root somehow.
For sandbox escape entitlements:
Code:com.apple.private.security.no-sandbox
com.apple.security.app-sandbox
Make sure you also have these entitlements:
Code:<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>platform-application</key>
<true/>
<key>com.apple.private.security.container-required</key>
<false/>
</dict>
</plist>
As for running as root, you have 3 options on iOS 12 / 11:
- Make a daemon cli program that is owned by root:wheel, and give it tfp0 + the logic to find your App's pid and write the patched data to the kernel memory, something like this:
Code:void getRootForPid(pid_t pid) { // Your Application's PID
uint64_t proc = proc_of_pid(pid);
uint64_t ucred = ReadAnywhere64(proc + off_p_ucred);
WriteAnywhere_32(ucred + off_ucred_cr_uid, 0);
WriteAnywhere_32(ucred + off_ucred_cr_ruid, 0);
WriteAnywhere_32(ucred + off_ucred_cr_svuid, 0);
WriteAnywhere_32(ucred + off_ucred_cr_rgid, 0);
WriteAnywhere_32(ucred + off_ucred_cr_svgid, 0);
}
- Or have jailbreakd grant you permissions.
- Include the exploit in your Application to automatically get root (NOT RECOMMENDED!)
(06-30-2019, 03:59 PM)Brandon Plank Wrote: [ -> ]Add the entitlements he listed to your current apps entitlements(06-30-2019, 03:53 PM)GeoSn0w Wrote: [ -> ]So basically if i call that during the view did load, It should work?(06-30-2019, 03:42 PM)Brandon Plank Wrote: [ -> ]Hey, I am having some issues getting apps to inherit root privileges. Since the app will not use jailbreakd i am wondering how to go about this. Any help? * Note * the app IS installed to /Applications.
Hi Brandon.
Normally, on a jailbroken iOS device the privilege escalation for installed applications is done by the jailbreakd daemon, or a separate root daemon. It does not matter that the app is in /Applications, if you wanna rootify it and unsandbox it, you must make sure the right entitlements are set in the binary and that it can get root somehow.
For sandbox escape entitlements:
Code:com.apple.private.security.no-sandbox
com.apple.security.app-sandbox
Make sure you also have these entitlements:
Code:<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>platform-application</key>
<true/>
<key>com.apple.private.security.container-required</key>
<false/>
</dict>
</plist>
As for running as root, you have 3 options on iOS 12 / 11:
- Make a daemon cli program that is owned by root:wheel, and give it tfp0 + the logic to find your App's pid and write the patched data to the kernel memory, something like this:
Code:void getRootForPid(pid_t pid) { // Your Application's PID
uint64_t proc = proc_of_pid(pid);
uint64_t ucred = ReadAnywhere64(proc + off_p_ucred);
WriteAnywhere_32(ucred + off_ucred_cr_uid, 0);
WriteAnywhere_32(ucred + off_ucred_cr_ruid, 0);
WriteAnywhere_32(ucred + off_ucred_cr_svuid, 0);
WriteAnywhere_32(ucred + off_ucred_cr_rgid, 0);
WriteAnywhere_32(ucred + off_ucred_cr_svgid, 0);
}
- Or have jailbreakd grant you permissions.
- Include the exploit in your Application to automatically get root (NOT RECOMMENDED!)
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>platform-application</key>
<true/>
<key>com.apple.private.security.container-required</key>
<false/>
</dict>
</plist>
(06-30-2019, 04:03 PM)GeoSn0w Wrote: [ -> ]If you wanna grant yourself privileges from the viewDIDLoad(), you need tfp0. If it is exported (HGSP4), then you can do so.The real question is does the jailbreaks for iOS 8 - 10.3.3 do it?
(06-30-2019, 04:05 PM)Brandon Plank Wrote: [ -> ](06-30-2019, 04:03 PM)GeoSn0w Wrote: [ -> ]If you wanna grant yourself privileges from the viewDIDLoad(), you need tfp0. If it is exported (HGSP4), then you can do so.The real question is does the jailbreaks for iOS 8 - 10.3.3 do it?
(06-30-2019, 04:07 PM)GeoSn0w Wrote: [ -> ](06-30-2019, 04:05 PM)Brandon Plank Wrote: [ -> ](06-30-2019, 04:03 PM)GeoSn0w Wrote: [ -> ]If you wanna grant yourself privileges from the viewDIDLoad(), you need tfp0. If it is exported (HGSP4), then you can do so.The real question is does the jailbreaks for iOS 8 - 10.3.3 do it?
Here is a list of those that do: https://www.theiphonewiki.com/wiki/Hgsp4_patch