From d356489a4aabdfbcab7ac19a59197878a12b9594 Mon Sep 17 00:00:00 2001 From: Maxime Biette Date: Mon, 29 May 2017 10:55:36 -0400 Subject: [PATCH 1/2] Add decryption for iOS 10.2 Manifest.DB (fixes #14) --- python_scripts/backup_tool.py | 14 ++++++++-- python_scripts/backups/backup10.py | 44 ++++++++++++++++++++++++++++-- python_scripts/keystore/keybag.py | 39 ++++++++++++++++++++++---- 3 files changed, 88 insertions(+), 9 deletions(-) diff --git a/python_scripts/backup_tool.py b/python_scripts/backup_tool.py index 63408ea..a855760 100755 --- a/python_scripts/backup_tool.py +++ b/python_scripts/backup_tool.py @@ -7,6 +7,7 @@ import os import sys import plistlib +import struct showinfo = ["Device Name", "Display Name", "Last Backup Date", "IMEI", "Serial Number", "Product Type", "Product Version", "iTunes Version"] @@ -51,15 +52,24 @@ def extract_backup(backup_path, output_path, password=""): print "python keychain_tool.py -d \"%s\" \"%s\"" % (output_path + "/KeychainDomain/keychain-backup.plist", output_path + "/Manifest.plist") elif os.path.exists(backup_path + "/Manifest.db"): - manifset_db = ManifestDB(backup_path) + if 'ManifestKey' in manifest: + kb = Keybag.createWithBackupManifest(manifest, password, ios102=True) + else: + kb = Keybag.createWithBackupManifest(manifest, password) - kb = Keybag.createWithBackupManifest(manifest, password) if not kb: return manifest["password"] = password makedirs(output_path) plistlib.writePlist(manifest, output_path + "/Manifest.plist") + manifest_key = None + if 'ManifestKey' in manifest: + clas = struct.unpack(' Date: Mon, 10 Jul 2017 13:48:58 -0400 Subject: [PATCH 2/2] Fix typo in filename --- python_scripts/backups/backup10.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python_scripts/backups/backup10.py b/python_scripts/backups/backup10.py index b9702de..d1cb943 100644 --- a/python_scripts/backups/backup10.py +++ b/python_scripts/backups/backup10.py @@ -90,7 +90,7 @@ def __init__ (self, path, key=None): #If a key is provided, try to decrypt the DB if key: mdb_path_encrypted = mdb_path - mdb_path = os.path.join(path,'Manifest.db-decypted') + mdb_path = os.path.join(path,'Manifest.db-decrypted') self.decrypt_manifest_db(mdb_path_encrypted, mdb_path, key) conn = sqlite3.connect(mdb_path)