From 8f11f7c250e3b181fc0910c21eb49f67849d4906 Mon Sep 17 00:00:00 2001 From: "theAtropos4n6 (Evangelos D.)" <70748441+theAtropos4n6@users.noreply.github.com> Date: Sun, 14 Jul 2024 18:52:29 +0300 Subject: [PATCH 01/11] Update notificationhistory.py - The parser incorrectly reported the status of the 'notification history' feature when the corresponding value did not exist in settings_secure.xml. - This issue has been fixed in this update. --- scripts/artifacts/notificationHistory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/artifacts/notificationHistory.py b/scripts/artifacts/notificationHistory.py index 238de5db..3919eca6 100644 --- a/scripts/artifacts/notificationHistory.py +++ b/scripts/artifacts/notificationHistory.py @@ -45,7 +45,7 @@ def get_notificationHistory(files_found, report_folder, seeker, wrap_text, time_ for setting in root.findall(".//setting"): if setting.attrib.get('name') == 'notification_history_enabled': value = setting.attrib.get('value') - value = "Disabled" if value == "0" else "Enabled" + value = "Enabled" if value == "1" else "Disabled" if value == "0" else "Unknown" data_list.append((value, user)) else: pass # setting not available From 9b192342f6bdf70ff5d52636ef086b9704d99bfd Mon Sep 17 00:00:00 2001 From: Brigs Date: Wed, 24 Jul 2024 08:38:00 +1200 Subject: [PATCH 02/11] Create sharedProto.py SBrowser downloads as located in a levelDB store --- scripts/artifacts/sharedProto.py | 122 +++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 scripts/artifacts/sharedProto.py diff --git a/scripts/artifacts/sharedProto.py b/scripts/artifacts/sharedProto.py new file mode 100644 index 00000000..48c3176f --- /dev/null +++ b/scripts/artifacts/sharedProto.py @@ -0,0 +1,122 @@ +__artifacts_v2__ = { + "sharedProto": { + "name": "Shared Proto Data", + "description": "Shared Proto data from Samsung Browser", + "author": "@AlexisBrignoni", + "version": "0.0.1", + "date": "2024-07-23", + "requirements": "none", + "category": "Samsung Browser", + "notes": "", + "paths": ('*/data/com.sec.android.app.sbrowser/app_sbrowser/Default/shared_proto_db/*'), + "function": "get_sharedProto" + } +} +import pathlib +import sqlite3 +import textwrap +import blackboxprotobuf +import traceback +import scripts.ccl_leveldb +from datetime import datetime, timedelta + +from scripts.artifact_report import ArtifactHtmlReport +from scripts.ilapfuncs import logfunc, tsv, timeline, is_platform_windows, open_sqlite_db_readonly, kmlgen, does_table_exist, convert_ts_human_to_utc, convert_utc_human_to_timezone + +def get_sharedProto(files_found, report_folder, seeker, wrap_text, time_offset): + + data_list = [] + + in_dirs = set(pathlib.Path(x).parent for x in files_found) + for in_db_dir in in_dirs: + leveldb_records = scripts.ccl_leveldb.RawLevelDb(in_db_dir) + + for record in leveldb_records.iterate_records_raw(): + #print(record.seq, record.user_key, record.value) + record_sequence = record.seq + record_key = record.user_key + record_value = record.value + origin = str(record.origin_file) + + p = str(pathlib.Path(origin).parent.name) + f = str(pathlib.Path(origin).name) + pf = f'{p}/{f}' + + recordkey = record_key.decode() + #print(record_value) + protostuff, types = blackboxprotobuf.decode_message(record_value) + + data = (protostuff.get('1','nodata')) + if data == 'nodata': + pass + else: + #print(protostuff) + + try: + #guid = protostuff['1']['1'] + #print(guid.decode()) + #print(protostuff) + + urlone = protostuff['1']['4']['1'] + if isinstance(urlone, list): + agg = '' + for url in urlone: + + agg = url.decode() + '

' + agg + else: + agg = urlone.decode() + + domain = protostuff['1']['4']['2'] + urltwo = protostuff['1']['4']['4'].decode() + timestamp = protostuff['1']['4'].get('9','') + timestamptwo = protostuff['1']['4'].get('16','') + if timestamptwo != '': + seconds = timestamptwo / 1000 + + # Define the epoch start time (January 1, 1601) + epoch_start = datetime(1601, 1, 1) + + # Calculate the final datetime + timestamptwo = epoch_start + timedelta(seconds=seconds) + """ + if isinstance(timestamp, bytes): + timestamp = timestamp.decode() + timestamp = timestamp.split(' ') + + year = timestamp[3] + day = timestamp[1] + time = timestamp[4] + month = monthletter(timestamp[2]) + timestamp = (f'{year}-{month}-{day} {time}') + else: + pass + """ + content = (protostuff['1']['4']['13'].decode()) + data_list.append((timestamptwo,timestamp,recordkey,record_sequence,agg,urltwo,domain,content,pf)) + except: + pass + + + + + if len(data_list) > 0: + maindirectory = str(pathlib.Path(in_db_dir).parent) + report = ArtifactHtmlReport('Samsung Browser Shared Proto') + report.start_artifact_report(report_folder, 'Samsung Browser Shared Proto') + report.add_script() + data_headers = ('Timestamp','Timestamp B','Record Key','Record Sequence','ULR One','URL Two','Domain','Data','Origin') + + report.write_artifact_data_table(data_headers, data_list, maindirectory,html_escape=False) + report.end_artifact_report() + + tsvname = f'Samsung Browser Shared Proto' + tsv(report_folder, data_headers, data_list, tsvname) + + tlactivity = f'Samsung Browser Shared Proto' + timeline(report_folder, tlactivity, data_list, data_headers) + + + else: + logfunc('No Samsung Browser Shared Proto data available') + + \ No newline at end of file From 51e86e1f5c8395b67108ce0ab01cfca2268e5db3 Mon Sep 17 00:00:00 2001 From: Brigs Date: Wed, 24 Jul 2024 08:41:38 +1200 Subject: [PATCH 03/11] Update report.py Added Samsung browser icon. --- scripts/report.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/report.py b/scripts/report.py index 22fb6988..390e2611 100644 --- a/scripts/report.py +++ b/scripts/report.py @@ -707,6 +707,7 @@ 'HOURLY': 'thermometer', '_mode': 'search', }, + 'SAMSUNG BROWSER': 'globe', 'SAMSUNG_CMH': 'disc', 'SCREENTIME': 'monitor', 'SCRIPT LOGS': 'archive', From 9f91fc47a8f3535953cbc9e49adf3a3101135ed5 Mon Sep 17 00:00:00 2001 From: "Yogesh Khatri (@swiftforensics)" Date: Wed, 14 Aug 2024 16:14:15 +1000 Subject: [PATCH 04/11] Remove python 3.12 warnings --- scripts/html_parts.py | 2 +- scripts/ilapfuncs.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/html_parts.py b/scripts/html_parts.py index 2c2c35f8..fe77aea0 100755 --- a/scripts/html_parts.py +++ b/scripts/html_parts.py @@ -154,7 +154,7 @@ """ # body_main_data is a placeholder, replace content with real data body_main_data = \ -""" +r"""
All dates and times are in UTC unless stated otherwise.