‘But the absolute pwnage of the Phillies will be worth remembering.’ ‘If the rivalry pwnage wasn't at tragic levels going into last year, it certainly is now.’ ‘Stop being noobz and resist the pwnage that is brought down upon you!’ ‘This chapter is all about pwnage, lots and lots of death and destruction.’. Could this be the greatest wireless gaming mouse ever made? Pwnage website: https://pwnage.com/products/ultra-custom-wireless-ergoIndiegogo. Pwnage is focused on delivering innovative products, services & experiences for the gaming community. Life's a Game, Pwn it!
This exploit is in the S5L8900 bootrom, thus available in the iPhone, iPod touch, and iPhone 3G. The exploit is that the bootrom doesn't signature check LLB.
- 2Exploit
Credit
Exploit
S5L8900
Pwnage exploits a bad chain of trust in the boot sequence of the S5L8900 device. The boot sequence includes LLB and iBoot modules which are stored in the device's NOR flash and are typically encrypted (as of 1.1.*). However, they are not signed with RSA signature at that point, because the 8900 container is dropped away before the file is written to NOR. Pwnage exploits this vulnerability.
First, Apple assumes that if something is in NOR, it had necessarily passed through an RSA signature verification, and is therefore authentic Apple code. This is incorrect, because the only mechanism preventing the writing of unauthorized code to the NOR flash is the kernel. The iPhone/iPod touch kernel contains an extension designed specifically to write to NOR, called AppleImage2NORAccess. This extension performs an RSA signature verification on any data it tries to write. The verification itself is performed by the FairPlay extension, which is heavily obfuscated, but neutering the check is very simple. After the check is patched out, anything can be written to the NOR flash.
Second, Apple assumes that disabling the encryption keys in “normal” environment will prevent from writing firmware files to the NOR flash. Luckily, we have found a way to run our code in “secure” environment and use AppleImage2NORAccess extension the same way as Apple does it on restore.
Before iOS 2.0, the NOR was set up in a way that when the firmware images were flashed there, the RSA signatures were dropped along with the rest of the firmware container. So although iBoot signature checked the kernel, LLB did not signature check iBoot, and the VROM did not signature check LLB.
Pwnage starts by booting from a memory device (ramdisk) in “secure” environment to prevent the kernel from disabling encryption keys. Also, we add another memory device, pointed at the kernel's address space, to allow live kernel patching. After booting up, we patch out signature check from AppleImage2NorAccess extention and proceed with flashing our custom firmware files (iBoot, LLB, DeviceTree, and pictures). Because the signature check has been patched out, and encryption keys are available, AppleImage2NORAccess happily writes them to the suitable location in NOR flash. After that, the device can be restarted, and will accept any unsigned 8900 file without complaint.
One specific aspect of the attack that is worth examining more closely is the iBoot patch. iBoot is the last and most complicated bootloader on the devices, and is what actually loads up the kernel with DeviceTree. However, Apple made the decision to keep all the PKE (Public Key Encryption) logic out of iBoot, instead putting it in the secure bootloader. Thus, iBoot actually jumps into the secure bootloader when it wants to verify the authenticity of an 8900 file. This makes it hard to directly patch out the RSA signature verification from iBoot, as it actually occurs in the secure bootloader. Simply killing the jump into the secure bootloader is impossible, as it also fills in other information iBoot needs to proceed.
Because of the tight coupling between the secure bootloader and the higher-level bootloaders, Apple gave us a solution: the secure bootloader often needs to call functions in the higher-level bootloaders, but it has the problem of knowing where to jump, as functions move around in different revisions. To get around this, Apple made thunks out of the function calls, and makes the higher-level bootloaders patch the secure bootloader on the fly (in RAM) with the relevant jump addresses. They just copy the secure bootloader into RAM and blindly apply a list of patches to it. We exploited this pre-existing patching mechanism to patch out the RSA signature verification from secure bootloader.
Post-2.0, images are now written to NOR in a way that one can verify the other, like LLB verifying iBoot, the bootrom cannot be written to, so it still defaults to just reading LLB normally, un-signature checked.
The bootrom has a vulnerability in DFU Mode when processesing iBoot certificates which are on a DER format. It copies all the certificate information onto the stack, but the signature itself is copied without any sort of bounds checking. So then you have classic stack buffer overflow and then you just make the signature checking function return true.
More info.
S5L8720 and on
This exploit has been fixed on the iPod touch (2nd generation) and all devices released after it. The bootrom sigchecks LLB before jumping to it now, and if the LLB is patched, it will default to DFU Mode. The 0x24000 Segment Overflow exploit was later found in the first revisions of the iPod touch (2nd generation) and iPhone 3GSbootroms, allowing the device to be fully jailbroken. It has since been fixed with new bootrom revisions for these devices. Newer devices were never susceptible to the 0x24000 Segment Overflow.
Implementation
PwnageTool is an iOSjailbreak tool for Mac OS X that jailbreaks by creating a custom IPSW. You are allowed to change boot logos and add pre-installed packages to the IPSW. After an IPSW is created you can use it for restore using iTunes.
- 2Exploits Used
- 4Versions
Credit
Exploits Used
Version 1.0
Version 2.0
Version 4.0
- Bootrom exploit (used by limera1n and greenpois0n)
Models Supported
Model | Since |
---|---|
iPhone 3G | 19 Jul 2008 |
iPod touch (2nd generation) | 2 Oct 2009 |
iPhone 4 (iPhone3,1) | 20 Oct 2010 |
iPod touch (3rd generation) | 20 Oct 2010 |
iPod touch (4th generation) | 20 Oct 2010 |
iPad | 20 Oct 2010 |
Apple TV (2nd generation) | 20 Oct 2010 |
Please note that the iPad 2 and the iPhone 4S are not supported, as there is no publicly available bootrom exploit (like Pwnage, Pwnage 2.0, limera1n) for the A5-Processor.
Versions
PwnageTool was released 3 April 2008 but largely unused until version 2.0 was released 19 July 2008.The following versions that are shown here are not beta, alpha, or in development.
1.x: First release of PwnageTool
Version | Release Date | Features |
---|---|---|
1.0 | 3 Apr 2008 |
|
1.1 | 17 Apr 2008 |
|
2.x: Second major release of Pwnagetool
Version | Release date | Features |
---|---|---|
2.0 | 19 Jul 2008 |
|
2.0.1 | 4 Aug 2008 |
|
2.0.2 | 21 Aug 2008 |
|
2.0.3 | 25 Aug 2008 |
|
2.1 | 13 Sep 2008 |
|
2.2 | 21 Nov 2008 |
|
2.2.5 | 30 Jan 2009 |
|
3.x: Third Major Release of PwnageTool
Version | Release date | Features |
---|---|---|
3.0 | 19 Jun 2009 |
|
3.1 | 15 Sep 2009 |
|
3.1.3 | 2 Oct 2009 |
|
3.1.4 | 13 Oct 2009 |
|
3.1.5 | 7 Feb 2010 |
|
4.x: Fourth Major Release of PwnageTool
Version | Release date | Features |
---|---|---|
4.0 | 22 Jun 2010 |
|
4.01 | 23 Jun 2010 |
|
4.1 | 20 Oct 2010 |
|
4.1.1 | 22 Oct 2010 |
|
4.1.2 | 22 Oct 2010 |
|
4.1.3 | 28 Nov 2010 |
|
4.2 | 15 Feb 2011 |
|
4.3 | 3 Apr 2011 |
|
4.3.2 | 27 Dec 2011 |
|
4.3.3 | 8 Jun 2011 |
|
4.3.3.1 | 8 May 2011 |
|
5.x: Fifth Major Release of PwnageTool
Version | Release date | Features |
---|---|---|
5.0.1 | 27 Dec 2011 |
|
5.1.1 | 4 Jun 2012 |
|
Creating the Firmware
PwnageTool takes the IPSW file and patches it, creating a custom version. This enables a lot more features such as pre-installed packages, BootNeuter (iPhone software unlock), custom packages and boot logos. This method is usually less secure than the quick exploits such (redsn0w, QuickPwn, purplera1n, blackra1n, etc.).
Pwnagetool
How to create Custom Firmware Bundles
- Main article: Making PwnageTool Bundles
Problems
This method does have negative aspects. The most common errors are the 16xx range of errors, which mean that the either the firmware file is corrupt or you didn't put it in the right mode (Recovery, DFU Mode). Sometimes the problems could just be a computer problem such as the memory is full or the USB port is broken. The most common error is Error 1604 which means that the firmware file is corrupted.
Pwnage
Windows
PwnageTool is expected to remain exclusive to Mac OS X. As of October 2009, iH8sn0w, et. al. has announced that they made a project that will bring PwnageTool's functionality to Windows, called sn0wbreeze. [3]
License
PwnageTool is freeware.