Conformed browerstate plugin to others with similar structure

This commit is contained in:
Nex
2022-08-08 16:44:54 +02:00
parent c5ccaef0c4
commit 804ade3a40
2 changed files with 9 additions and 10 deletions

View File

@@ -123,18 +123,16 @@ class SafariBrowserState(IOSExtraction):
def run(self) -> None:
if self.is_backup:
for backup_file in self._get_backup_files_from_manifest(relative_path=SAFARI_BROWSER_STATE_BACKUP_RELPATH):
self.file_path = self._get_backup_file_from_id(backup_file["file_id"])
if self.file_path:
self.log.info("Found Safari browser state database at path: %s", self.file_path)
self._process_browser_state_db(self.file_path)
else:
self.log.info("Safari browser state database exists in the manifest file (%s) but is not in the folder", backup_file["file_id"])
browserstate_path = self._get_backup_file_from_id(backup_file["file_id"])
if not browserstate_path:
continue
self.log.info("Found Safari browser state database at path: %s", browserstate_path)
self._process_browser_state_db(browserstate_path)
elif self.is_fs_dump:
for safari_browserstate_path in self._get_fs_files_from_patterns(SAFARI_BROWSER_STATE_ROOT_PATHS):
self.file_path = safari_browserstate_path
self.log.info("Found Safari browser state database at path: %s", self.file_path)
self._process_browser_state_db(self.file_path)
for browserstate_path in self._get_fs_files_from_patterns(SAFARI_BROWSER_STATE_ROOT_PATHS):
self.log.info("Found Safari browser state database at path: %s", browserstate_path)
self._process_browser_state_db(browserstate_path)
self.log.info("Extracted a total of %d tab records and %d session history entries",
len(self.results), self._session_history_count)

View File

@@ -125,6 +125,7 @@ class WebkitSessionResourceLog(IOSExtraction):
log_path = self._get_backup_file_from_id(log_file["file_id"])
if not log_path:
continue
self.log.info("Found Safari browsing session resource log at path: %s", log_path)
self.results[log_path] = self._extract_browsing_stats(log_path)
elif self.is_fs_dump: