diff --git a/mvt/ios/modules/backup/configuration_profiles.py b/mvt/ios/modules/backup/configuration_profiles.py index 20159ca..1c89afa 100644 --- a/mvt/ios/modules/backup/configuration_profiles.py +++ b/mvt/ios/modules/backup/configuration_profiles.py @@ -1,3 +1,4 @@ + # Mobile Verification Toolkit (MVT) # Copyright (c) 2021 The MVT Project Authors. # Use of this software is governed by the MVT License 1.1 that can be found at @@ -27,10 +28,21 @@ class ConfigurationProfiles(IOSExtraction): continue with open(conf_file_path, "rb") as handle: - conf_plist = plistlib.load(handle) + try: + conf_plist = plistlib.load(handle) + except: + conf_plist = {} if "SignerCerts" in conf_plist: conf_plist["SignerCerts"] = [b64encode(x) for x in conf_plist["SignerCerts"]] + if "PushTokenDataSentToServerKey" in conf_plist: + conf_plist["PushTokenDataSentToServerKey"] = b64encode(conf_plist["PushTokenDataSentToServerKey"]) + if "LastPushTokenHash" in conf_plist: + conf_plist["LastPushTokenHash"] = b64encode(conf_plist["LastPushTokenHash"]) + if "PayloadContent" in conf_plist: + for x in range(len(conf_plist["PayloadContent"])): + if "PERSISTENT_REF" in conf_plist["PayloadContent"]: + conf_plist["PayloadContent"][x]["PERSISTENT_REF"] = b64encode(conf_plist["PayloadContent"][x]["PERSISTENT_REF"]) self.results.append({ "file_id": conf_file["file_id"], @@ -39,4 +51,4 @@ class ConfigurationProfiles(IOSExtraction): "plist": conf_plist, }) - self.log.info("Extracted details about %d configuration profiles", len(self.results)) + self.log.info("Extracted details about %d configuration profiles", len(self.results)) \ No newline at end of file