Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 18 additions & 13 deletions scripts/artifacts/parsecdCache.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,24 @@ def get_parseCDCache(files_found, report_folder, seeker, wrap_text, timezone_off
report_file = file_found
db = open_sqlite_db_readonly(file_found)

cursor = db.cursor()
cursor.execute('''
select
datetime(engagement_date + 978307200,'unixepoch') as engagement_date,
input,
completion,
transformed,
score
FROM completion_cache_engagement
''')

all_rows = cursor.fetchall()

# Bug-Fix: give this exception handling in case db is malformed or columns are missing
try:
cursor = db.cursor()
cursor.execute('''
select
datetime(engagement_date + 978307200,'unixepoch') as engagement_date,
input,
completion,
transformed,
score
FROM completion_cache_engagement
''')

all_rows = cursor.fetchall()
except Exception as e:
all_rows = []
print(f'Error reading ParseCD Cache database: {e}')

for row in all_rows:
timestamp = row[0]
timestamp = convert_ts_human_to_utc(timestamp)
Expand Down
34 changes: 20 additions & 14 deletions scripts/artifacts/photosDbexif.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,27 @@ def get_photosDbexif(files_found, report_folder, seeker, wrap_text, timezone_off
data_list =[]
#sqlite portion
db = open_sqlite_db_readonly(file_found)
cursor = db.cursor()
cursor.execute('''
SELECT
DATETIME(ZASSET.ZDATECREATED+978307200,'UNIXEPOCH') AS DATECREATED,
DATETIME(ZASSET.ZMODIFICATIONDATE+978307200,'UNIXEPOCH') AS MODIFICATIONDATE,
ZASSET.ZDIRECTORY,
ZASSET.ZFILENAME,
ZASSET.ZLATITUDE,
ZASSET.ZLONGITUDE,
ZADDITIONALASSETATTRIBUTES.ZCREATORBUNDLEID
FROM ZASSET
INNER JOIN ZADDITIONALASSETATTRIBUTES ON ZASSET.Z_PK = ZADDITIONALASSETATTRIBUTES.Z_PK
''')

all_rows = cursor.fetchall()
# Bug-Fix: give this exception handling in case db is malformed or columns are missing
try:
cursor = db.cursor()
cursor.execute('''
SELECT
DATETIME(ZASSET.ZDATECREATED+978307200,'UNIXEPOCH') AS DATECREATED,
DATETIME(ZASSET.ZMODIFICATIONDATE+978307200,'UNIXEPOCH') AS MODIFICATIONDATE,
ZASSET.ZDIRECTORY,
ZASSET.ZFILENAME,
ZASSET.ZLATITUDE,
ZASSET.ZLONGITUDE,
ZADDITIONALASSETATTRIBUTES.ZCREATORBUNDLEID
FROM ZASSET
INNER JOIN ZADDITIONALASSETATTRIBUTES ON ZASSET.Z_PK = ZADDITIONALASSETATTRIBUTES.Z_PK
''')

all_rows = cursor.fetchall()
except Exception as e:
all_rows = []
print(f'Error reading photos database: {e}')
usageentries = len(all_rows)


Expand Down
41 changes: 24 additions & 17 deletions scripts/artifacts/trustedPeers.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,31 @@ def get_trustedPeers(files_found, report_folder, seeker, wrap_text, timezone_off
break

db = open_sqlite_db_readonly(file_found)
cursor = db.cursor()
cursor.execute('''
SELECT
DISTINCT datetime(client.ZSECUREBACKUPMETADATATIMESTAMP + 978307200, 'unixepoch') AS "Timestamp",
client.ZDEVICEMODEL AS "Model",
client.ZDEVICEMODELVERSION AS "Model Version",
client.ZDEVICENAME AS "Device Name",
metadata.ZSERIAL AS "Serial Number",
client.ZSECUREBACKUPNUMERICPASSPHRASELENGTH AS "Passcode Length"
FROM
ZESCROWCLIENTMETADATA AS client
LEFT JOIN
ZESCROWMETADATA AS metadata
ON
client.ZESCROWMETADATA = metadata.Z_PK;
''')

# Bug-Fix: give this exception handling in case db is malformed or no such table exists
try:
cursor = db.cursor()
cursor.execute('''
SELECT
DISTINCT datetime(client.ZSECUREBACKUPMETADATATIMESTAMP + 978307200, 'unixepoch') AS "Timestamp",
client.ZDEVICEMODEL AS "Model",
client.ZDEVICEMODELVERSION AS "Model Version",
client.ZDEVICENAME AS "Device Name",
metadata.ZSERIAL AS "Serial Number",
client.ZSECUREBACKUPNUMERICPASSPHRASELENGTH AS "Passcode Length"
FROM
ZESCROWCLIENTMETADATA AS client
LEFT JOIN
ZESCROWMETADATA AS metadata
ON
client.ZESCROWMETADATA = metadata.Z_PK;
''')

all_rows = cursor.fetchall()
all_rows = cursor.fetchall()
except Exception as e:
all_rows = []
print(f'Error reading trusted peers database: {e}')

usageentries = len(all_rows)
data_list = []

Expand Down