1
mirror of https://github.com/mvt-project/mvt synced 2025-10-21 22:42:15 +02:00

Compare commits

..

5 Commits

Author SHA1 Message Date
besendorf
14ebc9ee4e Merge branch 'main' into fix/tcc 2025-07-22 18:56:10 +02:00
besendorf
de53cc07f8 Merge pull request #660 from mvt-project/fix/safari_browserstate
catch sqlite exception in safari_browserstate.py
2025-07-22 18:33:39 +02:00
besendorf
22e066fc4a Merge branch 'main' into fix/safari_browserstate 2025-07-22 18:20:07 +02:00
besendorf
b691de2cc0 catch sqlite exception in safari_browserstate.py 2025-07-04 17:52:05 +02:00
besendorf
10915f250c catch tcc error 2025-07-04 17:46:50 +02:00
3 changed files with 24 additions and 34 deletions

View File

@@ -95,14 +95,17 @@ class SafariBrowserState(IOSExtraction):
)
except sqlite3.OperationalError:
# Old version iOS <12 likely
cur.execute(
try:
cur.execute(
"""
SELECT
title, url, user_visible_url, last_viewed_time, session_data
FROM tabs
ORDER BY last_viewed_time;
"""
SELECT
title, url, user_visible_url, last_viewed_time, session_data
FROM tabs
ORDER BY last_viewed_time;
"""
)
)
except sqlite3.OperationalError as e:
self.log.error(f"Error executing query: {e}")
for row in cur:
session_entries = []

View File

@@ -116,13 +116,16 @@ class TCC(IOSExtraction):
)
db_version = "v2"
except sqlite3.OperationalError:
cur.execute(
"""SELECT
service, client, client_type, allowed,
prompt_count
FROM access;"""
)
db_version = "v1"
try:
cur.execute(
"""SELECT
service, client, client_type, allowed,
prompt_count
FROM access;"""
)
db_version = "v1"
except sqlite3.OperationalError as e:
self.log.error(f"Error parsing TCC database: {e}")
for row in cur:
service = row[0]

View File

@@ -127,24 +127,6 @@ class WebkitSessionResourceLog(IOSExtraction):
browsing_stats = file_plist["browsingStatistics"]
for item in browsing_stats:
most_recent_interaction, last_seen = None, None
if "mostRecentUserInteraction" in item:
try:
most_recent_interaction = convert_datetime_to_iso(
item["mostRecentUserInteraction"]
)
except Exception:
self.log.error(
f'Error converting date of Safari resource"most recent interaction": {item["mostRecentUserInteraction"]}'
)
if "lastSeen" in item:
try:
last_seen = convert_datetime_to_iso(item["lastSeen"])
except Exception:
self.log.error(
f'Error converting date of Safari resource"last seen": {item["lastSeen"]}'
)
items.append(
{
"origin": item.get("PrevalentResourceOrigin", ""),
@@ -157,8 +139,10 @@ class WebkitSessionResourceLog(IOSExtraction):
"subresourceUnderTopFrameOrigins", ""
),
"user_interaction": item.get("hadUserInteraction"),
"most_recent_interaction": most_recent_interaction,
"last_seen": last_seen,
"most_recent_interaction": convert_datetime_to_iso(
item["mostRecentUserInteraction"]
),
"last_seen": convert_datetime_to_iso(item["lastSeen"]),
}
)