Extracting Entitlements From Compiled Application
Page copied form https://mobile-security.gitbook.io/mobile-security-testing-guide/ios-testing-guide/0x06h-testing-platform-interaction#universal-links****
If you only have the app's IPA or simply the installed app on a jailbroken device, you normally won't be able to find .entitlements
files. This could be also the case for the embedded.mobileprovision
file. Still, you should be able to extract the entitlements property lists from the app binary yourself (which you've previously obtained as explained in the "iOS Basic Security Testing" chapter, section "Acquiring the App Binary").
The following steps should work even when targeting an encrypted binary. If for some reason they don't, you'll have to decrypt and extract the app with e.g. Clutch (if compatible with your iOS version), frida-ios-dump or similar.
Extracting the Entitlements Plist from the App Binary
If you have the app binary in your computer, one approach is to use binwalk to extract (-e
) all XML files (-y=xml
):
Or you can use radare2 (-qc
to quietly run one command and exit) to search all strings on the app binary (izz
) containing "PropertyList" (~PropertyList
):
In both cases (binwalk or radare2) we were able to extract the same two plist
files. If we inspect the first one (0x0015d2a4) we see that we were able to completely recover the original entitlements file from Telegram.
Note: the
strings
command will not help here as it will not be able to find this information. Better use grep with the-a
flag directly on the binary or use radare2 (izz
)/rabin2 (-zz
).
If you access the app binary on the jailbroken device (e.g via SSH), you can use grep with the -a, --text
flag (treats all files as ASCII text):
Play with the -A num, --after-context=num
flag to display more or less lines. You may use tools like the ones we presented above as well, if you have them also installed on your jailbroken iOS device.
This method should work even if the app binary is still encrypted (it was tested against several App Store apps).
Last updated