mirror of
https://github.com/mvt-project/mvt.git
synced 2026-04-20 18:56:44 +02:00
Compare commits
2 Commits
accessibil
...
warn-encry
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6342e3261b | ||
|
|
642add21b0 |
@@ -11,7 +11,7 @@ from datetime import datetime
|
|||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from mvt.common.indicators import Indicators
|
from mvt.common.indicators import Indicators
|
||||||
from mvt.common.module import MVTModule, run_module, save_timeline
|
from mvt.common.module import EncryptedBackupError, MVTModule, run_module, save_timeline
|
||||||
from mvt.common.utils import (
|
from mvt.common.utils import (
|
||||||
convert_datetime_to_iso,
|
convert_datetime_to_iso,
|
||||||
generate_hashes_from_path,
|
generate_hashes_from_path,
|
||||||
@@ -244,7 +244,14 @@ class Command:
|
|||||||
except NotImplementedError:
|
except NotImplementedError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
try:
|
||||||
run_module(m)
|
run_module(m)
|
||||||
|
except EncryptedBackupError:
|
||||||
|
self.log.critical(
|
||||||
|
"The backup appears to be encrypted. "
|
||||||
|
"Please decrypt it first using `mvt-ios decrypt-backup`."
|
||||||
|
)
|
||||||
|
return
|
||||||
|
|
||||||
self.executed.append(m)
|
self.executed.append(m)
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,10 @@ class DatabaseCorruptedError(Exception):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class EncryptedBackupError(Exception):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class InsufficientPrivileges(Exception):
|
class InsufficientPrivileges(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@@ -169,6 +173,8 @@ def run_module(module: MVTModule) -> None:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
exec_or_profile("module.run()", globals(), locals())
|
exec_or_profile("module.run()", globals(), locals())
|
||||||
|
except EncryptedBackupError:
|
||||||
|
raise
|
||||||
except NotImplementedError:
|
except NotImplementedError:
|
||||||
module.log.exception(
|
module.log.exception(
|
||||||
"The run() procedure of module %s was not implemented yet!",
|
"The run() procedure of module %s was not implemented yet!",
|
||||||
|
|||||||
@@ -8,9 +8,10 @@ import io
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import plistlib
|
import plistlib
|
||||||
|
import sqlite3
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from mvt.common.module import DatabaseNotFoundError
|
from mvt.common.module import DatabaseNotFoundError, EncryptedBackupError
|
||||||
from mvt.common.url import URL
|
from mvt.common.url import URL
|
||||||
from mvt.common.utils import convert_datetime_to_iso, convert_unix_to_iso
|
from mvt.common.utils import convert_datetime_to_iso, convert_unix_to_iso
|
||||||
|
|
||||||
@@ -127,7 +128,14 @@ class Manifest(IOSExtraction):
|
|||||||
conn = self._open_sqlite_db(manifest_db_path)
|
conn = self._open_sqlite_db(manifest_db_path)
|
||||||
cur = conn.cursor()
|
cur = conn.cursor()
|
||||||
|
|
||||||
|
try:
|
||||||
cur.execute("SELECT * FROM Files;")
|
cur.execute("SELECT * FROM Files;")
|
||||||
|
except sqlite3.DatabaseError:
|
||||||
|
conn.close()
|
||||||
|
raise EncryptedBackupError(
|
||||||
|
"Manifest.db is not a valid SQLite database. "
|
||||||
|
"The backup may be encrypted."
|
||||||
|
)
|
||||||
names = [description[0] for description in cur.description]
|
names = [description[0] for description in cur.description]
|
||||||
|
|
||||||
for file_entry in cur:
|
for file_entry in cur:
|
||||||
|
|||||||
Reference in New Issue
Block a user