Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding additional FCA artifacting #31

Merged
merged 46 commits into from
Jun 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
796cfc3
adding gps and contact artifacts
joedinsmoor Jun 5, 2023
003c726
Contacts filled
joedinsmoor Jun 5, 2023
ad77df8
adding better directory parsing
joedinsmoor Jun 6, 2023
d880305
Handles permission errors
joedinsmoor Jun 6, 2023
35f952c
contacts updated
joedinsmoor Jun 6, 2023
75909e0
fix dir parse
joedinsmoor Jun 6, 2023
00424bd
better
joedinsmoor Jun 6, 2023
1447399
better
joedinsmoor Jun 6, 2023
df03af2
fixes
joedinsmoor Jun 6, 2023
dd4f8ce
hm
joedinsmoor Jun 6, 2023
32a283a
ascii encoding
joedinsmoor Jun 6, 2023
c04133e
fixed double entries for diagnostics
joedinsmoor Jun 6, 2023
08797d0
never mind
joedinsmoor Jun 6, 2023
1559a46
boop
joedinsmoor Jun 6, 2023
455842e
fix dir issues
joedinsmoor Jun 8, 2023
5afb54a
dir issues
joedinsmoor Jun 8, 2023
538cb15
debugging
joedinsmoor Jun 8, 2023
ad55cd0
using proper logging
joedinsmoor Jun 8, 2023
4f2e294
hopes and prayers
joedinsmoor Jun 8, 2023
78816bc
added accessory logging
joedinsmoor Jun 8, 2023
41b9df3
fix dir name
joedinsmoor Jun 8, 2023
3c9aded
uh
joedinsmoor Jun 8, 2023
5f3da1d
fix
joedinsmoor Jun 8, 2023
2489081
yes
joedinsmoor Jun 8, 2023
5904afd
hmmmm
joedinsmoor Jun 8, 2023
6467960
fixes
joedinsmoor Jun 8, 2023
749e902
hmmmmmmm
joedinsmoor Jun 8, 2023
fff7789
fixes
joedinsmoor Jun 8, 2023
2915f14
mebbe fix?
joedinsmoor Jun 8, 2023
12238ef
added documentation
joedinsmoor Jun 8, 2023
2cc7336
fix joseph dumb
joedinsmoor Jun 9, 2023
363f04f
fix gps
phoenixrising1800 Jun 9, 2023
ae095a8
error handling
joedinsmoor Jun 9, 2023
2123658
hello!
joedinsmoor Jun 9, 2023
8a32020
joseph is the big dumb
joedinsmoor Jun 9, 2023
75cdc2e
regex added
joedinsmoor Jun 9, 2023
f35be9d
boop
joedinsmoor Jun 9, 2023
0f543a0
joe is dummy
joedinsmoor Jun 9, 2023
4f0f816
boop!
joedinsmoor Jun 9, 2023
c6c70f5
boooooop
joedinsmoor Jun 9, 2023
fd9fda8
fixed things!
joedinsmoor Jun 9, 2023
923ea11
fix regex
joedinsmoor Jun 9, 2023
9731992
added stop thigns
joedinsmoor Jun 9, 2023
52b1fde
fix joe dumb
joedinsmoor Jun 9, 2023
a419ff6
Init hyundai artifacts
phoenixrising1800 Jun 9, 2023
5dda47a
Merge branch 'main' of github.com:joedinsmoor/VLEAPP
phoenixrising1800 Jun 9, 2023
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
48 changes: 48 additions & 0 deletions scripts/artifacts/chrysler_accessories.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import csv
import os
import re
import datetime

from scripts.artifact_report import ArtifactHtmlReport
from scripts.ilapfuncs import logfunc, tsv, logdevinfo, is_platform_windows

#Compatability Data
vehicles = ['FCA','Jeep Cherokee']
platforms = ['Carplay']



## Get Accessory data
def get_accessorydata(files_found, report_folder, seeker, wrap_text):
data_list = []
for file_found in files_found:
with open(file_found, "r") as f:
for line in f:
names = line.split("::")
data_list.append((names[0],names[1]))
#[A-Za-z]+::[A-Za-z]+ - regex for the accessory_data.txt file

if len(data_list) > 0:
report = ArtifactHtmlReport('Accessory Data')
report.start_artifact_report(report_folder, f'Accessory Data')
report.add_script()
data_headers = ('Name','Value')
report.write_artifact_data_table(data_headers, data_list, file_found)
report.end_artifact_report()

tsvname = f'Accessory Data'
tsv(report_folder, data_headers, data_list, tsvname)
else:
logfunc(f'No Accessory Data Found')






__artifacts__ = {
"accessory_data": (
"accessory_data",
('*/media/accessory_data.txt'),
get_accessorydata)
}
2 changes: 1 addition & 1 deletion scripts/artifacts/chrysler_bt.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ def get_btDevices(files_found, report_folder, seeker, wrap_text):
__artifacts__ = {
"bluetooth_devices": (
"bluetooth devices",
('*/mnt/p3/betula/bt_log.txt'),
('*/betula/bt_log.txt'),
get_btDevices),
}
55 changes: 55 additions & 0 deletions scripts/artifacts/chrysler_contacts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import csv
import os
import re
import datetime

from scripts.artifact_report import ArtifactHtmlReport
from scripts.ilapfuncs import logfunc, tsv, logdevinfo, is_platform_windows

#Compatability Data
vehicles = ['FCA','Jeep Cherokee']
platforms = ['Carplay']



## Get known contacts
def get_contacts(files_found, report_folder, seeker, wrap_text):
data_list = []
for file_found in files_found:
with open(file_found, "r") as f:
name = ''
information = ''
count = 0
for line in f:
line_str = str(line)
line_str_decoded = bytes(line_str, "utf-8").decode("unicode_escape", errors="replace")
line_decoded = re.sub('r\\\\x[0-9a-fA-F]{2}', "", line_str_decoded)
line_wanted = line_decoded.encode('ascii', 'ignore').decode('ascii', errors="replace")
splits = ''
if count%2==0:
name = line
else:
information = line
if (name not in data_list):
data_list.append((name, information))
count += 1
if len(data_list) > 0:
report = ArtifactHtmlReport('Contacts List')
report.start_artifact_report(report_folder, f'Contacts List')
report.add_script()
data_headers = ('Name','Information')
report.write_artifact_data_table(data_headers, data_list, file_found)
report.end_artifact_report()

tsvname = f'Contacts List'
tsv(report_folder, data_headers, data_list, tsvname)
else:
logfunc(f'No Contacts')


__artifacts__ = {
"contactList": (
"contactsList",
('*/voice/asr/context/phonebook/*.txt'),
get_contacts)
}
2 changes: 1 addition & 1 deletion scripts/artifacts/chrysler_diag.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ def get_diagnosticdata(files_found, report_folder, seeker, wrap_text):
__artifacts__ = {
"diagnostic_data": (
"diagnostic_data",
('*/mnt/p3/persistence/nonvol_*.ps'),
('*/persistence/nonvol_*.ps'),
get_diagnosticdata)
}
65 changes: 65 additions & 0 deletions scripts/artifacts/chrysler_gps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import csv
import os
import re
import datetime

from scripts.artifact_report import ArtifactHtmlReport
from scripts.ilapfuncs import logfunc, tsv, logdevinfo, is_platform_windows

#Compatability Data
vehicles = ['FCA','Jeep Cherokee']
platforms = ['Carplay']



## Get GPS data
def get_gpsdata(files_found, report_folder, seeker, wrap_text):
data_list = []
for file_found in files_found:
try:
with open(file_found, "r", encoding = "ISO-8859-1") as f:
for line in f:
long = []
lat = []
try:
line_str = str(line)
line_str_decoded = bytes(line_str, "utf-8").decode("unicode_escape", errors="replace")
line_decoded = re.sub('r\\\\x[0-9a-fA-F]{2}', "", line_str_decoded)
line_wanted = line_decoded.encode('ascii', 'ignore').decode('ascii', errors="replace")
if "Latitude" in line_wanted:
for i in re.findall(r"Latitude\sread\sfrom\sPS:\s([+-]?(?=\.\d|\d)(?:\d+)?(?:\.?\d*))(?:[Ee]([+-]?\d+))?", line_wanted):
lat.append(i)
if "Longitude" in line_wanted:
for i in re.findall(r"Longitude\sread\sfrom\sPS:\s([+-]?(?=\.\d|\d)(?:\d+)?(?:\.?\d*))(?:[Ee]([+-]?\d+))?", line_wanted):
long.append(i)
if len(long) > 0 or len(lat) > 0:
if ((lat[0], long[0])) not in data_list:
data_list.append((lat[0], long[0]))
except UnicodeDecodeError:
pass
except PermissionError:
print("directory is not writable")

if len(data_list) > 0:
report = ArtifactHtmlReport('GPS Info')
report.start_artifact_report(report_folder, f'GPS Info')
report.add_script()
data_headers = ('Latitude','Longitude')
report.write_artifact_data_table(data_headers, data_list, file_found)
report.end_artifact_report()

tsvname = f'GPS Info'
tsv(report_folder, data_headers, data_list, tsvname)
else:
logfunc(f'No GPS Info Found')





__artifacts__ = {
"gps_data": (
"gps_data",
('*/log/slogs*'),
get_gpsdata)
}
19 changes: 19 additions & 0 deletions scripts/artifacts/hyundai_callHistory.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import csv
import os

from scripts.artifact_report import ArtifactHtmlReport
from scripts.ilapfuncs import logfunc, tsv, logdevinfo, is_platform_windows

#Compatability Data
vehicles = ['Hyundai Sonata']
platforms = ['Carplay']

def get_callHistory():
pass

__artifacts__ = {
"call history": (
"call history",
('*/bluetooth.DB_BMS/CH_*.db'),
get_callHistory),
}
19 changes: 19 additions & 0 deletions scripts/artifacts/hyundai_contacts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import csv
import os

from scripts.artifact_report import ArtifactHtmlReport
from scripts.ilapfuncs import logfunc, tsv, logdevinfo, is_platform_windows

#Compatability Data
vehicles = ['Hyundai Sonata']
platforms = ['Carplay']

def get_contacts():
pass

__artifacts__ = {
"contacts": (
"contacts",
('*/bluetooth/DB_BMS/MC_*.db'),
get_contacts),
}
19 changes: 19 additions & 0 deletions scripts/artifacts/hyundai_devices.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import csv
import os

from scripts.artifact_report import ArtifactHtmlReport
from scripts.ilapfuncs import logfunc, tsv, logdevinfo, is_platform_windows

#Compatability Data
vehicles = ['Hyundai Sonata']
platforms = ['Carplay']

def get_devices():
pass

__artifacts__ = {
"connected devices": (
"connected devices",
('*/wireless_dev_list.dat'),
get_devices),
}
34 changes: 34 additions & 0 deletions scripts/artifacts/hyundai_infotainment.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import csv
import os

from scripts.artifact_report import ArtifactHtmlReport
from scripts.ilapfuncs import logfunc, tsv, logdevinfo, is_platform_windows

#Compatability Data
vehicles = ['Hyundai Sonata']
platforms = ['Carplay']

def get_infotainmentData(files_found, report_folder, seeker, wrap_text):
data_list = []
for file_found in files_found:
with open(file_found, 'r') as f:
pass
if len(data_list) > 0:
report = ArtifactHtmlReport('Infotainment Data')
report.start_artifact_report(report_folder, f'Infotainment Data')
report.add_script()
data_headers = ('ID','Value')
report.write_artifact_data_table(data_headers, data_list, file_found)
report.end_artifact_report()
tsvname = f'Infotainment Data'
tsv(report_folder, data_headers, data_list, tsvname)
else:
logfunc(f'No Infotainment Data found')


__artifacts__ = {
"accessory_data": (
"accessory data",
('*/wifi/settings'),
get_infotainmentData),
}