
Parser di log, eventi e Protobuf di Android

Se vuoi contribuire, contattami qui: https://abrignoni.github.io
Post del blog qui: https://leapps.org/blog
Python 3.10 o superiore
Le dipendenze per il tuo ambiente Python sono elencate in requirements.txt. Installale usando il comando seguente. Assicurati
che la parte py sia corretta per il tuo ambiente, ad esempio py, python o python3, ecc.
py -m pip install -r requirements.txt
oppure
pip3 install -r requirements.txt
Per eseguire su Linux, dovrai anche installare tkinter separatamente, così:
sudo apt-get install python3-tk
Per compilare un eseguibile e poterlo eseguire su un sistema senza Python installato.
Windows OS
Per creare aleapp.exe, esegui:
pyinstaller scripts\pyinstaller\aleapp.spec
Per creare aleappGUI.exe, esegui:
pyinstaller scripts\pyinstaller\aleappGUI.spec
macOS
Per creare aleapp, esegui:
pyinstaller scripts/pyinstaller/aleapp_macOS.spec
Per creare aleappGUI.app, esegui:
pyinstaller scripts/pyinstaller/aleappGUI_macOS.spec
Linux
Per creare aleapp, esegui:
pyinstaller scripts/pyinstaller/aleapp_Linux.spec
Per creare aleappGUI, esegui:
pyinstaller scripts/pyinstaller/aleappGUI_Linux.spec
$ python aleapp.py -t <zip | tar | fs | gz> -i <path_to_extraction> -o <path_for_report_output>
$ python aleappGUI.py
$ python aleapp.py --help
Ogni plugin è un file sorgente Python che deve essere aggiunto alla cartella scripts/artifacts; verrà caricato dinamicamente ogni volta che ALEAPP viene eseguito.
Il file sorgente del plugin deve contenere un dizionario chiamato __artifacts_v2__ all'inizio del modulo, che definisce gli artefatti elaborati dal plugin. Le chiavi del dizionario __artifacts_v2__ devono essere ID per gli artefatti e devono essere univoci all'interno di ALEAPP. I valori devono essere dizionari contenenti le seguenti chiavi:
name: il nome dell'artefatto come stringa.description: una descrizione dell'artefatto come stringa.author: l'autore del plugin come stringa.version: la versione dell'artefatto come stringa.date: la data dell'ultimo aggiornamento dell'artefatto come stringa.requirements: eventuali requisiti per elaborare l'artefatto come stringa.category: la categoria dell'artefatto come stringa.notes: eventuali note aggiuntive come stringa.paths: una tupla di stringhe contenente pattern di ricerca glob per far corrispondere il percorso dei dati che il plugin si aspetta per l'artefatto.function: il nome della funzione che rappresenta il punto di ingresso per l'elaborazione dell'artefatto come stringa.Per esempio:
__artifacts_v2__ = {
"cool_artifact_1": {
"name": "Cool Artifact 1",
"description": "Extracts cool data from database files",
"author": "@username",
"version": "0.1",
"date": "2022-10-25",
"requirements": "none",
"category": "Really cool artifacts",
"notes": "",
"paths": ('*/com.android.cooldata/databases/database*.db',),
"function": "get_cool_data1"
},
"cool_artifact_2": {
"name": "Cool Artifact 2",
"description": "Extracts cool data from XML files",
"author": "@username",
"version": "0.1",
"date": "2022-10-25",
"requirements": "none",
"category": "Really cool artifacts",
"notes": "",
"paths": ('*/com.android.cooldata/files/cool.xml',),
"function": "get_cool_data2"
}
}
Le funzioni indicate come punti di ingresso nel dizionario __artifacts__ devono accettare i seguenti argomenti:
Per esempio:
def get_cool_data1(files_found, report_folder, seeker, wrap_text):
pass # do processing here
Generalmente ci si aspetta che i plugin forniscano output nel formato HTML di ALEAPP, in TSV e, opzionalmente, inviino record alla timeline. Le funzioni per generare questo output si trovano nei moduli artifact_report e ilapfuncs. A livello generale, un esempio potrebbe essere simile a:
__artifacts_v2__ = {
"cool_artifact_1": {
"name": "Cool Artifact 1",
"description": "Extracts cool data from database files",
"author": "@username", # Replace with the actual author's username or name
"version": "0.1", # Version number
"date": "2022-10-25", # Date of the latest version
"requirements": "none",
"category": "Really cool artifacts",
"notes": "",
"paths": ('*/com.android.cooldata/databases/database*.db',),
"function": "get_cool_data1"
}
}
import datetime
from scripts.artifact_report import ArtifactHtmlReport
import scripts.ilapfuncs
def get_cool_data1(files_found, report_folder, seeker, wrap_text):
# let's pretend we actually got this data from somewhere:
rows = [
(datetime.datetime.now(), "Cool data col 1, value 1", "Cool data col 1, value 2", "Cool data col 1, value 3"),
(datetime.datetime.now(), "Cool data col 2, value 1", "Cool data col 2, value 2", "Cool data col 2, value 3"),
]
headers = ["Timestamp", "Data 1", "Data 2", "Data 3"]
# HTML output:
report = ArtifactHtmlReport("Cool stuff")
report_name = "Cool DFIR Data"
report.start_artifact_report(report_folder, report_name)
report.add_script()
report.write_artifact_data_table(headers, rows, files_found[0]) # assuming only the first file was processed
report.end_artifact_report()
# TSV output:
scripts.ilapfuncs.tsv(report_folder, headers, rows, report_name, files_found[0]) # assuming first file only
# Timeline:
scripts.ilapfuncs.timeline(report_folder, report_name, rows, headers)
Questo strumento è il risultato di uno sforzo collaborativo di molte persone nella community DFIR.
Logo ALEAPP per gentile concessione di Derek Eiri.