diff --git a/src/mvt/android/artifacts/dumpsys_appops.py b/src/mvt/android/artifacts/dumpsys_appops.py index 6f066c89..12c81143 100644 --- a/src/mvt/android/artifacts/dumpsys_appops.py +++ b/src/mvt/android/artifacts/dumpsys_appops.py @@ -51,7 +51,7 @@ def check_indicators(self) -> None: and perm["access"] == "allow" ): self.log.info( - "Package %s with REQUEST_INSTALL_PACKAGES " "permission", + "Package %s with REQUEST_INSTALL_PACKAGES permission", result["package_name"], ) diff --git a/src/mvt/android/artifacts/dumpsys_packages.py b/src/mvt/android/artifacts/dumpsys_packages.py index 2ca7e4c3..22041804 100644 --- a/src/mvt/android/artifacts/dumpsys_packages.py +++ b/src/mvt/android/artifacts/dumpsys_packages.py @@ -16,8 +16,7 @@ def check_indicators(self) -> None: for result in self.results: if result["package_name"] in ROOT_PACKAGES: self.log.warning( - "Found an installed package related to " - 'rooting/jailbreaking: "%s"', + 'Found an installed package related to rooting/jailbreaking: "%s"', result["package_name"], ) self.detected.append(result) diff --git a/src/mvt/android/modules/adb/base.py b/src/mvt/android/modules/adb/base.py index bdc26859..72df7944 100644 --- a/src/mvt/android/modules/adb/base.py +++ b/src/mvt/android/modules/adb/base.py @@ -326,8 +326,7 @@ def _generate_backup(self, package_name: str) -> bytes: if not header["backup"]: self.log.error( - "Extracting SMS via Android backup failed. " - "No valid backup data found." + "Extracting SMS via Android backup failed. No valid backup data found." ) return None diff --git a/src/mvt/android/modules/adb/packages.py b/src/mvt/android/modules/adb/packages.py index 078d8dc1..1d9c8213 100644 --- a/src/mvt/android/modules/adb/packages.py +++ b/src/mvt/android/modules/adb/packages.py @@ -75,8 +75,7 @@ def check_indicators(self) -> None: for result in self.results: if result["package_name"] in ROOT_PACKAGES: self.log.warning( - "Found an installed package related to " - 'rooting/jailbreaking: "%s"', + 'Found an installed package related to rooting/jailbreaking: "%s"', result["package_name"], ) self.detected.append(result) diff --git a/src/mvt/android/modules/adb/sms.py b/src/mvt/android/modules/adb/sms.py index 63c1de66..673e56a5 100644 --- a/src/mvt/android/modules/adb/sms.py +++ b/src/mvt/android/modules/adb/sms.py @@ -70,7 +70,7 @@ def serialize(self, record: dict) -> Union[dict, list]: "timestamp": record["isodate"], "module": self.__class__.__name__, "event": f"sms_{record['direction']}", - "data": f"{record.get('address', 'unknown source')}: \"{body}\"", + "data": f'{record.get("address", "unknown source")}: "{body}"', } def check_indicators(self) -> None: diff --git a/src/mvt/android/modules/androidqf/packages.py b/src/mvt/android/modules/androidqf/packages.py index e3de0f5a..1d36777d 100644 --- a/src/mvt/android/modules/androidqf/packages.py +++ b/src/mvt/android/modules/androidqf/packages.py @@ -44,8 +44,7 @@ def check_indicators(self) -> None: for result in self.results: if result["name"] in ROOT_PACKAGES: self.log.warning( - "Found an installed package related to " - 'rooting/jailbreaking: "%s"', + 'Found an installed package related to rooting/jailbreaking: "%s"', result["name"], ) self.detected.append(result) diff --git a/src/mvt/common/command.py b/src/mvt/common/command.py index b44a56b8..d65555e7 100644 --- a/src/mvt/common/command.py +++ b/src/mvt/common/command.py @@ -81,7 +81,7 @@ def _setup_logging(self): os.path.join(self.results_path, "command.log") ) formatter = logging.Formatter( - "%(asctime)s - %(name)s - " "%(levelname)s - %(message)s" + "%(asctime)s - %(name)s - %(levelname)s - %(message)s" ) file_handler.setLevel(logging.DEBUG) file_handler.setFormatter(formatter) diff --git a/src/mvt/common/indicators.py b/src/mvt/common/indicators.py index a73938d0..25296613 100644 --- a/src/mvt/common/indicators.py +++ b/src/mvt/common/indicators.py @@ -383,8 +383,7 @@ def check_url(self, url: str) -> Union[dict, None]: for ioc in self.get_iocs("urls"): if ioc["value"] == url: self.log.warning( - "Found a known suspicious URL %s " - 'matching indicator "%s" from "%s"', + 'Found a known suspicious URL %s matching indicator "%s" from "%s"', url, ioc["value"], ioc["name"], diff --git a/src/mvt/ios/cli.py b/src/mvt/ios/cli.py index a74eb32c..1d06c966 100644 --- a/src/mvt/ios/cli.py +++ b/src/mvt/ios/cli.py @@ -100,7 +100,7 @@ def decrypt_backup(ctx, destination, password, key_file, hashes, backup_path): if key_file: if MVT_IOS_BACKUP_PASSWORD in os.environ: log.info( - "Ignoring %s environment variable, using --key-file" "'%s' instead", + "Ignoring %s environment variable, using --key-file'%s' instead", MVT_IOS_BACKUP_PASSWORD, key_file, ) @@ -114,7 +114,7 @@ def decrypt_backup(ctx, destination, password, key_file, hashes, backup_path): if MVT_IOS_BACKUP_PASSWORD in os.environ: log.info( - "Ignoring %s environment variable, using --password" "argument instead", + "Ignoring %s environment variable, using --passwordargument instead", MVT_IOS_BACKUP_PASSWORD, ) @@ -168,8 +168,7 @@ def extract_key(password, key_file, backup_path): if MVT_IOS_BACKUP_PASSWORD in os.environ: log.info( - "Ignoring %s environment variable, using --password " - "argument instead", + "Ignoring %s environment variable, using --password argument instead", MVT_IOS_BACKUP_PASSWORD, ) elif MVT_IOS_BACKUP_PASSWORD in os.environ: diff --git a/src/mvt/ios/modules/backup/backup_info.py b/src/mvt/ios/modules/backup/backup_info.py index 5fdc65fe..c8f55f60 100644 --- a/src/mvt/ios/modules/backup/backup_info.py +++ b/src/mvt/ios/modules/backup/backup_info.py @@ -41,7 +41,7 @@ def run(self) -> None: info_path = os.path.join(self.target_path, "Info.plist") if not os.path.exists(info_path): raise DatabaseNotFoundError( - "No Info.plist at backup path, unable to extract device " "information" + "No Info.plist at backup path, unable to extract device information" ) with open(info_path, "rb") as handle: diff --git a/src/mvt/ios/modules/backup/manifest.py b/src/mvt/ios/modules/backup/manifest.py index 107d6457..ccbc459c 100644 --- a/src/mvt/ios/modules/backup/manifest.py +++ b/src/mvt/ios/modules/backup/manifest.py @@ -110,8 +110,7 @@ def check_indicators(self) -> None: ioc = self.indicators.check_url(part) if ioc: self.log.warning( - 'Found mention of domain "%s" in a backup file with ' - "path: %s", + 'Found mention of domain "%s" in a backup file with path: %s', ioc["value"], rel_path, ) diff --git a/src/mvt/ios/modules/base.py b/src/mvt/ios/modules/base.py index ef56a5d4..f96d99aa 100644 --- a/src/mvt/ios/modules/base.py +++ b/src/mvt/ios/modules/base.py @@ -74,7 +74,7 @@ def _recover_sqlite_db_if_needed( if not shutil.which("sqlite3"): raise DatabaseCorruptedError( - "failed to recover without sqlite3 binary: please install " "sqlite3!" + "failed to recover without sqlite3 binary: please install sqlite3!" ) if '"' in file_path: raise DatabaseCorruptedError( diff --git a/src/mvt/ios/modules/mixed/sms.py b/src/mvt/ios/modules/mixed/sms.py index 12eef0c7..34c064b0 100644 --- a/src/mvt/ios/modules/mixed/sms.py +++ b/src/mvt/ios/modules/mixed/sms.py @@ -43,7 +43,7 @@ def __init__( def serialize(self, record: dict) -> Union[dict, list]: text = record["text"].replace("\n", "\\n") - sms_data = f"{record['service']}: {record['guid']} \"{text}\" from {record['phone_number']} ({record['account']})" + sms_data = f'{record["service"]}: {record["guid"]} "{text}" from {record["phone_number"]} ({record["account"]})' records = [ { "timestamp": record["isodate"], diff --git a/src/mvt/ios/modules/mixed/webkit_session_resource_log.py b/src/mvt/ios/modules/mixed/webkit_session_resource_log.py index 19ba8a28..0ae25450 100644 --- a/src/mvt/ios/modules/mixed/webkit_session_resource_log.py +++ b/src/mvt/ios/modules/mixed/webkit_session_resource_log.py @@ -100,7 +100,7 @@ def check_indicators(self) -> None: redirect_path += ", ".join(source_domains) redirect_path += " -> " - redirect_path += f"ORIGIN: \"{entry['origin']}\"" + redirect_path += f'ORIGIN: "{entry["origin"]}"' if len(destination_domains) > 0: redirect_path += " -> "