The two recent jailbreaks, unc0ver and Electra, have finally enabled file system extraction for Apple devices running iOS 11.4 and 11.4.1. At this time, all versions of iOS 11 can be jailbroken regardless of hardware. Let’s talk about forensic consequences of today’s release: keychain and file system extraction.
iOS is secure enough. Privilege escalation alone is not enough to develop a working jailbreak. Today’s jailbreaks exploit a chain of vulnerabilities to escape sandbox, obtain root privileges, remount the file system and perform several other steps to deliver a package that can be installed and used by an expert, developer or enthusiast.
Discovering vulnerabilities that can be exploited is even more difficult, requiring coordinated efforts of teams of researchers. One of such teams is called Google Project Zero. The work of this team helped jailbreaking community develop working jailbreaks for the last versions of iOS 10 and most versions of iOS 11 prior to iOS 11.4.
Thanks to Project Zero, we now have two jailbreaks for the two last versions of iOS 11: iOS 11.4 and 11.4.1.
unc0ver
Download: https://github.com/pwn20wndstuff/Undecimus/releases
Instructions: https://www.youtube.com/watch?v=TqHYjLHO0zs
Electra
Download: https://coolstar.org/electra/
Google Project Zero (Exploit with tfp0 for iOS 11.4.x to 12.1.2):
https://bugs.chromium.org/p/project-zero/issues/detail?id=1731#c10
Note: If you search for jailbreaks, the first results may lead you to one of the many Web sites distributing malware. Please make sure to download the jailbreaks directly from the two links listed above.
How can the forensic community use these jailbreaks? We use them to perform the full file system extraction.
The required pre-requisite to accessing the file system is unlocking the device. If you don’t know the passcode, you’d have to break it first with a solution such as GrayKey. However, extracting the content of the device is far from trivial even if you do know the passcode or the passcode is empty.
Since early days, iOS devices were using secure encryption to protect user data against hardware attacks. iOS 8 brought additional improvements, making even Apple unable to extract information without a passcode. The release of the iPhone 5s brought yet another security measure. Secure Enclave now protects the encryption key.
For older iPhones, physical acquisition used to mean the imaging of the data partition with subsequent decryption of the data. Low-level storage access was required to perform the imaging. This low-level access could be only provided by a jailbreak (or privilege-escalation exploit based on similar principle). Starting with the iPhone 5s, the encryption key is no longer accessible even with a jailbreak. The key is protected by Secure Enclave, a hardware and software subsystem introduced with Apple’s first 64-bit SoC. For the iPhone 5s and all newer iPhones (except for the iPhone 5c), experts using physical acquisition will receive a copy of the file system (files and folders) as opposed to full memory dump.
A working jailbreak is still needed to access the file system. Until today, public jailbreaks were available for all versions of iOS 11 except the two last releases: iOS 11.4 and 11.4.1. unc0ver and Electra jailbreaks have finally broken these two versions of iOS, allowing forensic experts to gain low-level access to the content of iOS devices via physical acquisition.
Physical acquisition offers numerous benefits compared to all other acquisition options. Thanks to the low-level access to protected parts of the file system, experts can extract information stored in apps’ sandboxed data sets, gain access to system logs, temporary files, write-ahead logs and much more. With low-level access to the file system, experts can analyze comprehensive location history and detailed usage history of the device. They can read email messages and conversation histories of many instant messaging apps; those are not present in cloud or local backups (even if one manages to break or reset the password).
While we developed methods to decrypt the content of both local and iCloud Keychain, physical acquisition remains the only method for decrypting keychain items targeting the highest protection class. In other words, file system extraction gains full access to application sandboxes and all system areas.
All of the latest jailbreaks are installed by sideloading the jailbreak .ipa file via Cydia Impactor from a computer or by using an online service to perform the same task on the iPhone. The online service method is easier to use, but has many security implications since nobody knows exactly what’s going to be installed on the iPhone being jailbroken.
Note: in order to obtain a certificate for sideloading the jailbreak .ipa onto the iPhone, you will need to provide a login and password to an Apple ID. While you can use your own Apple ID for that, we recommend creating a disposable Apple account without two-factor authentication.
WARNING: If you try to Google one of these jailbreaks, you may stumble upon one of the many Web sites distributing malware. We urge you to only download unc0ver and Electra jailbreaks only from trusted sources.
Note: the unc0ver jailbreak does not come with a bundled SSH daemon. Since iOS Forensic Toolkit requires an SSH connection, we recommend installing OpenSSH from Cydia. The previous version of Electra did bundle an SSH daemon, and OpenSSH installation was not required. We did not test the current version of Electra.
Using accounts with two-factor authentication requires generating an app-specific password:
As already mentioned, in order to sideload an IPA file and run it on the iOS device, you will need to sign the IPA file. While we generally recommend using a disposable Apple ID account to obtain a digital signature, doing so carries a certain risk. Signing the IPA file requires a working Internet connection on the computer. In order to run the newly signed IPA file, you may be required to “trust” the certificate on the iOS device you’re attempting to jailbreak. Establishing trust requires a working Internet connection, this time on the iOS device itself. This in turn has the associated risk of allowing the device connect to Apple’s Find My iPhone service, making it potentially vulnerable to remote lock/remote erase commands.
You may avoid this risk entirely by using an Apple ID account enrolled in Apple’s developer program to sign the jailbreak IPA. If you sign the jailbreak file with a developer Apple ID, you won’t have to “trust” the certificate on the device, and you won’t need a working Internet connection.
A jailbreak signed with a developer certificate can be used for 1 year. IPA files signed with a disposable Apple ID can be launched during the 7-day period, after which you’ll have to repeat the entire process (starting with sideloading).
There are two different jailbreaks available for iOS 11.4 to 11.4.1. We only had one device running an eligible version of iOS, so we were only able to test one of the two jailbreaks. For our purpose, the unc0ver jailbeak required several attempts with multiple reboots. That said, while we didn’t test Electra, we expect it to work in a similar fashion. We studied the previous version of Electra in Using iOS 11.2-11.3.1 Electra Jailbreak for iPhone Physical Acquisition.
Once the jailbreak is installed, extracting the file system is relatively easy.
The acquisition process extracts the complete image of the device file system in UNIX format. Some characters allowed in UNIX paths and file names are forbidden in Windows. For this reason, we chose to make use of the TAR format to save the content of the file system as opposed to ZIP. In order to analyze the data, you may either unpack or mount the TAR archive. However, we built a tool for analyzing such TAR files.
Elcomsoft Phone Viewer can open iOS TAR files produced by Elcomsoft iOS Forensic Toolkit. In addition, the tool can open ZIP archives of the file system produced by GrayKey. With it, you will get comprehensive location data, history of Apple Pay transactions, notifications and more.
There are alternatives to physical extraction via jailbreak. First, there’s GrayKey, a forensic solution made by GrayShift. GrayKey is exclusively available to select law enforcement and government agencies in select regions. GrayKey uses the same or similar exploits to those that are used in jailbreaks. For obvious reasons, the company does not disclose technical details of their solutions. Unfortunately, GrayShift does not disclose device compatibility matrix either.
If you have access to Cellebrite services, they are a real alternative to jailbreak extraction and GrayKey. This company (based in Israel) is even more secretive than GrayShift, so we can’t really comment on what combinations of hardware and software they support.
Thanks to Google Project Zero, we finally have working jailbreaks for the last two versions of iOS 11. Researchers have already discovered vulnerabilities in iOS 12.0 through 12.1.2 (the latest version of iOS is 12.1.3 at the time of this writing, but downgrading to iOS 12.1.2 and even 12.1.1 is still possible right now). These vulnerabilities have already resulted in successful privilege escalation exploits, yet we’re still far from a working jailbreak. However, it is theoretically possible to gain full access to iOS 12 file system even without a jailbreak but using these exploits directly. Stay tuned for an update!