Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone 4 Unlocking. NCK-Bruteforce Research

Every iPhone has a NORID (8 bytes) & CHIPID (12 bytes) unique to each phone.

  • Where is this stored? NOR? seczone? Can it be dumped?

An iPhone requires a NCK to unlock. From what I understand the NCK is 15 characters.

  • Is it numeric, alpha or alphanumeric?

The security token for check if the NCK is valid is stored encrypted at +0x400 in the seczone.

  • Is this correct?

Based on what I've read from dogbert's blog, the security token is created using a method similar to the following pseudo code:

deviceKey = SHA1_hash(norID+chipID)

nckKey = custom_hash(norID, chipID, SHA1_hash(NCK), deviceKey)

rawSignature = generateSignature(SHA1_hash(norID+chipID), SHA1_hash(chipID))

Signature = RSA_encrypt(rawSignature, RSAkey)

security token = TEA_encrypt_cbc(Signature, nckKey)
  • Is the pseudocode correct? If it is then what is the custom hash that is being used? What is being used to generate the rawSignature? What is the RSAKey that is being used? Is it a public key that can be found in the phone?

If the above pseudocode is CORRECT. Then we would have to bruteforce all 15 character combinations to find the correct NCK key right? Because, even though we are able to recover the NORID and CHIPID, we will not be able to use that information to shorten the amount of characters which we need to find.

  • Correct?

New generations of iPhone OS contains a wildcardticket that is generated during activation process.

  • but this should be no problem generating once we have the NCK right? Correct?
like image 413
d123 Avatar asked Nov 18 '11 10:11

d123


1 Answers

  1. The NOR ID is the hardware chip id burned into the baseband chip of the device. I don't know where you are getting the 8 bytes from but it is actually burned into the chip and the size is 64 bytes for iPhone 3G and 128 bytes for the iPhone 3GS.

  2. The NCK is a 15 digit (base 10 so it is not alpha-numeric). ie. the max NCK would be 999999999999999

Your device key is wrong.

It should read:

deviceUniqueKey = SHA(NCK + CHIPID + NORID)

teaEncryptedData = &seczone[0x400]

rsaEncryptedData = TEA_DECRYPT(teaEncryptedData, deviceUniqueKey)

validRSAMessage = RSA_DECRYPT(rsaEncryptedData, rsaKey)

When your NCK produces a valid RSA message, you have found the correct NCK to unlock your device.

like image 189
Chris Moran Avatar answered Oct 25 '22 09:10

Chris Moran