Skip to content

Commit

Permalink
Merge pull request #15 from lcfr123/master
Browse files Browse the repository at this point in the history
Added workaround for ‘flags == 16’.
  • Loading branch information
dinosec authored Dec 28, 2016
2 parents 241e52f + 0a26275 commit 866f834
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions python_scripts/backups/backup10.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ def __init__ (self, path):
relative_path = record[2]
flags = record[3]
file_blob = record[4]
self.files[filename] = MBFile(domain, relative_path, flags, file_blob)
if flags == 16:
warn("Flags == 16 for {0} {1} ({2})".format(domain, relative_path, file_blob))
else:
self.files[filename] = MBFile(domain, relative_path, flags, file_blob)

finally:
conn.close()
Expand Down Expand Up @@ -141,7 +144,7 @@ def _extract_file(self, filename, record, output_path):
if record.encryption_key is not None and self.keybag: # file is encrypted!
key = self.keybag.unwrapKeyForClass(record.protection_class, record.encryption_key[4:])
if not key:
warn("Cannot unwrap key")
warn("Cannot unwrap key for {0}".format(out_file))
return
aes = AES.new(key, AES.MODE_CBC, "\x00"*16)

Expand Down

0 comments on commit 866f834

Please sign in to comment.