Re: [Linux4nano-dev] iPhone firmware encryption

2007-09-15 Thread mat h
heres a preview of my thourough disection of the ipod firmware

ive been studying ipod firmware 19.8.1.3 using xvi32 these are my notes

0x0A seems to be a verry common end of data bit possible EOF?

line 5e10 - IPODRESOURCEFAT16
Fat16? That could come in use, fat16 partitions have a standard header.
Could be used to verify a successfull decryption

line 61ed - character sets
Characters are printed in hex:
00 01 02 01 03 - FF

 line 63F1 - character set again
00 02 01 02 - FF
after FF there is another FF. is it like null termination?

 ... lots more character sets with different seperating numbers.

line E012 - Ipod resources
each letter sepperated by 0x00

 ... 0x00s

line 127F6 - data starts again with multiple references to
 miles xml (http://www.miles8.com/xna/)? http://www.miles8.com/xna/
calorie(always seprated by other bits)
calorie.x (always seprated by other bits) xml?
 I'm thinking mabe a bitswapping alogrithim (moving places)

 line 12FDB - start of xml data
category=calorie
Appears to be the language data for things like menu names, etc
vp... items, control handlers? Could be usefull in a buffer overflow.

 140A6 - start of zeros

147FF - end of zeros
xml data relating to multilingual nike running thinggi.
again more vptriggers possible buffer overflows.

 15801 - start 0's

15FF - end 0's
more xml data same kinda thing as above.

 1707E - start 0's

177FF - end 0's, more xml data relating to nike running thing

188AA - start 0's

18FFF - end 0's
I think each 1 of these nike xml files are different pages on the ipod.

1A054 - start 0's

1A7FF - end 0's
more xml data for nike (YAWN im sick of bloody nike)

to be continued in next message

On 9/15/07, Emmanuel Fleury [EMAIL PROTECTED] wrote:

 Emmanuel Fleury wrote:
 
  PS: I'm still fighting against this WebDAV crap !!!

 Finally done... I went back to the bzip2 format... don't ask me why but
 it worked (I guess it has something to do with the file checksum,
 changing the name is not enough):

 Get it at:
 http://www.labri.fr/~fleury/download/ipodnano/firmwares-nano.tar.bz2

 This archive is complete and has a proper script that must work properly.

 Sorry for this long long serie of Yes, it's uploaded, No, it's not,
 Yes, it is, No, it's not, ... :)

 Regards
 --
 Emmanuel Fleury

 I worry about my child and the Internet all the time, even though
 she's too young to have logged on yet. Here's what I worry about.
 I worry that 10 or 15 years from now, she will come to me and say
 'Daddy, where were you when they took freedom of the press away
 from the Internet?'.
   -- Mike Godwin

 ___
 Linux4nano-dev mailing list
 Linux4nano-dev@gna.org
 https://mail.gna.org/listinfo/linux4nano-dev
 http://www.linux4nano.org




-- 
We explore... and you call us criminals.
We seek after knowledge... and you call us criminals.
We exist without skin color, without nationality, without religious bias...
and you call us criminals.
You build atomic bombs, you wage wars, you murder, cheat, and lie to us and
try to make us believe it's for our own good...
yet we're the criminals.

WAUSHARE ROX __
Join the dark side we've got cheese
Annoying people since 1992
If you hate me, I love you too. It ain't my fault I'm better than you
Save Water, Drink Beer
God Made Women First, Then He Had A Better Idea.
If Barbie is soo popular...how come you have to buy her friends?
Don't play stupid with me... I'm better at it!
You were so cute when you were a baby...What happened?
My folks were always asking me to wear underpants. What am I, the pope?
I'm calling the police!... Right after I flush some tings.
Join the army, see the world, meet interesting people, and kill them.
___
Linux4nano-dev mailing list
Linux4nano-dev@gna.org
https://mail.gna.org/listinfo/linux4nano-dev
http://www.linux4nano.org

Re: [Linux4nano-dev] iPhone firmware encryption

2007-09-15 Thread Emmanuel Fleury
Emmanuel Fleury wrote:
 Emmanuel Fleury wrote:
 PS: I'm still fighting against this WebDAV crap !!!
 
 Finally done... I went back to the bzip2 format... don't ask me why but
 it worked (I guess it has something to do with the file checksum,
 changing the name is not enough):
 
 Get it at:
 http://www.labri.fr/~fleury/download/ipodnano/firmwares-nano.tar.bz2
 
 This archive is complete and has a proper script that must work properly.
 
 Sorry for this long long serie of Yes, it's uploaded, No, it's not,
 Yes, it is, No, it's not, ... :)
 
 Regards

One very last bit of information, the latest iPod Nano 2G firmware
(26.1.0.1) seems to be different from the others:

***

26.1.0.1.ipsw
Archive:  ../archives/iPod_26.1.0.1.ipsw
  inflating: Firmware-26.9.0.1
  inflating: manifest.plist
../extract2g/extract2g compiled at 09:31:02 Sep 15 2007.

Cannot find at least one valid part in the dump.

***

I don't have time to look at it now (I have to prepare courses for next
week). So, if somebody has some spare time, feel free to try (and, yes,
it's still a zip format ;)).

PS: JD, it could be nice to add an auto-detect scheme in the extract2g
tool to extract 1G, 2G (and, why not, 3G) firmwares. :-P

Regards
-- 
Emmanuel Fleury

And in the end, reality always tends to hit theory hard in the
face when you least expect it.
  -- Linus Torvalds

___
Linux4nano-dev mailing list
Linux4nano-dev@gna.org
https://mail.gna.org/listinfo/linux4nano-dev
http://www.linux4nano.org


Re: [Linux4nano-dev] iPhone firmware encryption

2007-09-15 Thread JD
On 15/09/2007, Emmanuel Fleury [EMAIL PROTECTED] wrote:
 Emmanuel Fleury wrote:
  Emmanuel Fleury wrote:
  PS: I'm still fighting against this WebDAV crap !!!
 
  Finally done... I went back to the bzip2 format... don't ask me why but
  it worked (I guess it has something to do with the file checksum,
  changing the name is not enough):
 
  Get it at:
  http://www.labri.fr/~fleury/download/ipodnano/firmwares-nano.tar.bz2
 
  This archive is complete and has a proper script that must work properly.
 
  Sorry for this long long serie of Yes, it's uploaded, No, it's not,
  Yes, it is, No, it's not, ... :)
 
  Regards

 One very last bit of information, the latest iPod Nano 2G firmware
 (26.1.0.1) seems to be different from the others:

 ***

 26.1.0.1.ipsw
 Archive:  ../archives/iPod_26.1.0.1.ipsw
   inflating: Firmware-26.9.0.1
   inflating: manifest.plist
 ../extract2g/extract2g compiled at 09:31:02 Sep 15 2007.

 Cannot find at least one valid part in the dump.

 ***

 I don't have time to look at it now (I have to prepare courses for next
 week). So, if somebody has some spare time, feel free to try (and, yes,
 it's still a zip format ;)).

 PS: JD, it could be nice to add an auto-detect scheme in the extract2g
 tool to extract 1G, 2G (and, why not, 3G) firmwares. :-P

I'm on it ;)

JD.

___
Linux4nano-dev mailing list
Linux4nano-dev@gna.org
https://mail.gna.org/listinfo/linux4nano-dev
http://www.linux4nano.org


Re: [Linux4nano-dev] iPhone firmware encryption

2007-09-14 Thread mat h
ok if your right then in vfdecrypt.c we need to edit these 2 lines with the
ipod nano 2g key and it should work. Can anyone find these keys in a copy of
the firmware (I don't have):
convert_hex(28c909fc6d322fa18940f03279d70880, aes_key, 16);
convert_hex(e59a4507998347c70d5b8ca7ef090e15e82d, hmacsha1_key, 20);

hope this is helpfull,
mat :)



On 9/11/07, Emmanuel Fleury [EMAIL PROTECTED] wrote:

 Hi,

 Nice ! We should dig this.

 The key might differ but maybe some other hints can tell us if the
 encryption scheme is the same (then we can try to get the key).

 Regards
 --
 Emmanuel Fleury

 In God We Trust - All others must pay cash.
   -- Unknown

 ___
 Linux4nano-dev mailing list
 Linux4nano-dev@gna.org
 https://mail.gna.org/listinfo/linux4nano-dev
 http://www.linux4nano.org




-- 
We explore... and you call us criminals.
We seek after knowledge... and you call us criminals.
We exist without skin color, without nationality, without religious bias...
and you call us criminals.
You build atomic bombs, you wage wars, you murder, cheat, and lie to us and
try to make us believe it's for our own good...
yet we're the criminals.

WAUSHARE ROX __
Join the dark side we've got cheese
Annoying people since 1992
If you hate me, I love you too. It ain't my fault I'm better than you
Save Water, Drink Beer
God Made Women First, Then He Had A Better Idea.
If Barbie is soo popular...how come you have to buy her friends?
Don't play stupid with me... I'm better at it!
You were so cute when you were a baby...What happened?
My folks were always asking me to wear underpants. What am I, the pope?
I'm calling the police!... Right after I flush some tings.
Join the army, see the world, meet interesting people, and kill them.
___
Linux4nano-dev mailing list
Linux4nano-dev@gna.org
https://mail.gna.org/listinfo/linux4nano-dev
http://www.linux4nano.org

Re: [Linux4nano-dev] iPhone firmware encryption

2007-09-14 Thread JD
Previously in 24:
Jack Bauer is on the track of iPhone encryption and discovers that a
bunch of terrorists already crack Apple algorithms using an undercover
agent located in a inoffensive recovery tool.
While Jack shoot some kneecaps CTU still doesn't know exactly which
encryption algorithms Apple use in their iPhones...
Did Nadia will finally approve an interrogation technique that might
prove fatal to iPods ?

Day 2 : 8:00 PM - 9:00 PM

(And back to serious things :D)

I continue to look for informations about iPhone encryption (and try
to link them with nanos):

The iPhone firmware located in the .dmg file is encrypted using
FileVault (http://www.apple.com/fr/macosx/features/filevault/) an
Apple branded encryption system for HFS+ partitions
(http://developer.apple.com/technotes/tn/tn1150.html#VolumeHeader).

I'm unable to find any clear specification about .dmg files but, in our case:
- Clear .dmg  seems to enclose an HFS+ partition (.dmg start with an
header and some zero padding bytes after we've got a HFS+ header).
- Crypted .dmg start with an different header and payload data seems
to be encrypted.

So, the iPhone firmware is encrypted with the FileVault technology.
And the crypted data is enclosed in the .dmg file (which also contains
some cryptographic informations).

Ralf-Philipp Weinmann, Jacob Appelbaum, and Christian Fromme did a
FileVault reverse engineering a while ago (before iPhone I mean):
http://crypto.nsa.org/vilefault/
http://crypto.nsa.org/vilefault/23C3-VileFault.pdf

They wrote vfdecrypt as a part of their work. A modified version of
this tool was used by iPhone hackers to decrypt the .dmg firmware.

They only change a few things (recovering more data from headers, keys
format, ...) because the firmware .dmg (seems to) use FileVault
headers.

The header is:
typedef struct {
  unsigned char sig[8];
  uint32_t version;
  uint32_t enc_iv_size;
  uint32_t unk1;
  uint32_t unk2;
  uint32_t unk3;
  uint32_t unk4;
  uint32_t unk5;
  unsigned char uuid[16];
  uint32_t blocksize;
  uint64_t datasize;
  uint64_t dataoffset;
  uint8_t filler1[0x260];
  uint32_t kdf_algorithm;
  uint32_t kdf_prng_algorithm;
  uint32_t kdf_iteration_count;
  uint32_t kdf_salt_len; /* in bytes */
  uint8_t  kdf_salt[32];
  uint32_t blob_enc_iv_size;
  uint8_t  blob_enc_iv[32];
  uint32_t blob_enc_key_bits;
  uint32_t blob_enc_algorithm;
  uint32_t blob_enc_padding;
  uint32_t blob_enc_mode;
  uint32_t encrypted_keyblob_size;
  uint8_t  encrypted_keyblob[0x30];
} cencrypted_v2_pwheader;

Header is 832 bytes long (including unknown fields).

Our Nano headers doesn't look like to be the same as the FileVault one's.
That doesn't mean nano 2g aren't encrypted with FileVault algorithms because
FileVault exist before nano2g come to stores and I really think Apple
doesn't have time to build from scratch a strong encryption system
when they got a working one (Or Apple hire a bunch of trainees in
their crypto labs in summer 2k6 :) ).

Summary:
- iPhone firmware use FileVault encryption.
- iPod Nano 2g firmware doesn't seems to use exactly the same
FileVault system...
- ... but nano 2g probably use similar algorithms.

And, last minute thoughts, maybe nano2g use OLD versions of FileVault
(maybe the release version of FV when nano2g was developped).

Enjoy,
JD.

___
Linux4nano-dev mailing list
Linux4nano-dev@gna.org
https://mail.gna.org/listinfo/linux4nano-dev
http://www.linux4nano.org


Re: [Linux4nano-dev] iPhone firmware encryption

2007-09-11 Thread Manuel Naranjo
mat h escribió:
 good work JD!


W Good work JD, I hope this can help us :D.


___
Linux4nano-dev mailing list
Linux4nano-dev@gna.org
https://mail.gna.org/listinfo/linux4nano-dev
http://www.linux4nano.org