hackappcom / iloot

OpenSource tool for iCloud backup extraction
https://hackapp.com/
634 stars 203 forks source link

Suggestions for improvements/ bugfixes. #58

Open horrorho opened 8 years ago

horrorho commented 8 years ago

Hi, I'm currently writing a similar tool in Java, LiquidDonkey, which borrows heavily from iloot and iphone-dataprotection.

I've fixed a few issues which may still be problematic in iloot, although you may already be aware of them. I do not program in Python so please forgive my limited help and any shortfalls.

message MBSBackup {
    optional bytes backupUDID = 1;
    optional uint64 QuotaUsed = 2;
    repeated MBSSnapshot Snapshot = 3;
    optional MBSBackupAttributes Attributes = 4;
    optional uint64 KeysLastModified = 5;
}

This will allow you to retrieve all the available MBSSnapshots rather than relying on 1, latest -1, latest. The first snapshot doesn't always reside at 1. Also 4 snapshots may be present, with the last incomplete.

A MBSSnapshot/ Committed value of 0 indicates an incomplete snapshot.

At present iloot only considers Key[-1] when other entries may be present. (Key[0] being the Passcode). This may result in sub-optimal decryption.

        print "Got OTA Keybag"

        self.kb = Keybag(keys.Key[-1].KeyData)
        if not self.kb.unlockBackupKeybagWithPasscode(keys.Key[0].KeyData):
            print "Unable to unlock OTA keybag !"
            return

Due to my limited Python, I am unable to suggest any meaningful code changes. Sorry.