Skip to content

Commit

Permalink
Merge pull request abrignoni#473 from BrunoFischerGermany/main
Browse files Browse the repository at this point in the history
Update aleappGUI.py
  • Loading branch information
stark4n6 authored Apr 2, 2024
2 parents 85328a6 + 855ede3 commit e357aa9
Show file tree
Hide file tree
Showing 2 changed files with 120 additions and 2 deletions.
4 changes: 2 additions & 2 deletions aleappGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def select_input(button_type):
if button_type == 'file':
input_filename = tk_filedialog.askopenfilename(parent=main_window,
title='Select a file',
filetypes=(('tar file', '*.tar'), ('zip file', '*.zip'), ('gz file', '*.gz')))
filetypes=(('All supported files', '*.tar *.zip *.gz'), ('tar file', '*.tar'), ('zip file', '*.zip'), ('gz file', '*.gz')))
else:
input_filename = tk_filedialog.askdirectory(parent=main_window, title='Select a folder')
input_entry.delete(0, 'end')
Expand Down Expand Up @@ -521,4 +521,4 @@ def load_case():
### Progress bar
progress_bar = ttk.Progressbar(main_window, orient='horizontal')

main_window.mainloop()
main_window.mainloop()
118 changes: 118 additions & 0 deletions scripts/artifacts/kleinanzeigen.de.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# kleinanzeigen.de App
# Author: Bruno Fischer (@BrunoFischerGermany)
# Version: 1.0.0
# https://play.google.com/store/apps/details?id=com.ebay.kleinanzeigen
# kleinanzeigen.de App Version Tested: 15.23.0 from 2024-03-08
# Requirements: xmltodict, json, datetime
#
# Description: The kleinanzeigen.de app is one of the largest classified ad portals in Germany. There are probably messages between app users.
#

import xmltodict
import json
import datetime

from scripts.artifact_report import ArtifactHtmlReport
from scripts.ilapfuncs import logfunc, tsv, timeline, is_platform_windows, open_sqlite_db_readonly, does_column_exist_in_db, media_to_html

def get_kleinanzeigenrecentsearchescaches(files_found, report_folder, seeker, wrap_text, time_offset):
for file_found in files_found:
#logfunc(f"{file_found}")
if('RECENT_SEARCHES_CACHE' in file_found):
logfunc("kleinanzeigen.de - recent searches cache found")
with open(file_found, encoding='utf-8') as fd:
json_data = json.load(fd)
data = []
number_search_terms = sum(1 for entry in json_data if 'searchTerm' in entry)
for entry in json_data:
updated_at = datetime.datetime.utcfromtimestamp(entry['termSearchTimestamp'] / 1000).strftime('%Y-%m-%d %H:%M:%S')
data.append((entry['searchTerm'], entry['category']['localizedName'], ))

if(len(data)>0):
report = ArtifactHtmlReport('kleinanzeigen.de - recent search caches')
report.start_artifact_report(report_folder,'kleinanzeigen.de - retent search caches')
report.add_script()
data_headers = ('Search Term', 'Category', 'Search Timestamp')
data_list = []
for row in data:
data_list.append((row[0], row[1], row[2]))
report.write_artifact_data_table(data_headers, data_list, file_found, html_escape=False)
report.end_artifact_report()

tsvname = "kleinanzeigen.de - Recent Search Cache Data"
tsv(report_folder, data_headers, data_list,tsvname)

else:
logfunc("No kleinanzeigen.de - Recent Search Cache data found")

def get_kleinanzeigenaccount(files_found, report_folder, seeker, wrap_text, time_offset):
for file_found in files_found:

if('com.ebay.kleinanzeigen_preferences.xml' in file_found):
keys_to_check = [
'USERPROFILE_NAME_KEY', # Account Profile Name
'USERPROFILE_INITIALS', # Account Profile Initials
'LAST_EMAIL_USED', # Account Last used Email Address
'AUTH_USER_EMAIL', # Account Authenticated User Email Address
'USERPROFILE_PHONE_NUMBER_KEY', # Account Phone Number'
'USERPROFILE_ACCOUNT_TYPE_KEY', # Account Type maybe PRIVATE
'USERPROFILE_USER_SINCE_DATE_KEY', # Account Since - Timestamp - ISO 8601 Format
'USERPROFILE_LOCATION_LONGITUDE_KEY', # Saved Location Longitude
'USERPROFILE_LOCATION_LATITUDE_KEY' # Saved Location Latitude
]
logfunc("kleinanzeigen.de - Account data found")
with open(file_found, encoding='utf-8') as fd:
xml_dict = xmltodict.parse(fd.read())
string_dict = xml_dict.get('map', {}).get('string', [])
data = []
for key in keys_to_check:
value = ""
for item in string_dict:
if item.get('@name') == key:
value = item.get('#text', '')
break
data.append(value)

if(len(data)>0):
report = ArtifactHtmlReport('kleinanzeigen.de - account details')
report.start_artifact_report(report_folder,'kleinanzeigen.de - account details')
report.add_script()
data_headers = ('Account Profile Name', 'Account Profile Initials', 'Account Last Used Email Address', 'Account Authenticated Email Address', 'Account Phone Number', 'Account Type', 'Account Registered since', 'Saved Location Longitude', 'Saved Location Latitude')
data_list = []
data_list.append((data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7], data[8]))
report.write_artifact_data_table(data_headers, data_list, file_found, html_escape=False)
report.end_artifact_report()

tsvname = "kleinanzeigen.de - Account Data"
tsv(report_folder, data_headers, data_list,tsvname)

else:
logfunc("No kleinanzeigen.de - Account data found")


__artifacts_v2__ = {
"get_kleinanzeigenaccount": {
"name": "kleinanzeigen.de App - Account Details",
"description": "Extracts Account Details",
"author": "@BrunoFischerGermany",
"version": "0.1",
"date": "2024-04-02",
"requirements": "none",
"category": "kleinanzeigen.de App",
"notes": "",
"paths": ('*/com.ebay.kleinanzeigen/shared_prefs/com.ebay.kleinanzeigen_preferences.xml'),
"function": "get_kleinanzeigenaccount"
},
"get_kleinanzeigenrecentsearchescaches": {
"name": "kleinanzeigen.de App - Recent Searches Cache",
"description": "Extracts Recent Searches Cache",
"author": "@BrunoFischerGermany",
"version": "0.1",
"date": "2024-04-02",
"requirements": "none",
"category": "kleinanzeigen.de App",
"notes": "",
"paths": ('*/com.ebay.kleinanzeigen/files/RECENT_SEARCHES_CACHE'),
"function": "get_kleinanzeigenrecentsearchescaches"
}
}

0 comments on commit e357aa9

Please sign in to comment.