In digital forensics, Log2Timeline stands as a fundamental open-source tool that is indispensable for investigations. This task aims to furnish a comprehensive understanding of Log2Timeline's commands and offer insights into creating and analyzing timelines in forensic investigations.
Scenario
The forensic disk image used in this room was procured from the Computer Forensic Reference Data Sets (CFReDS) portal hosted by the National Institute of Standards and Technology (NIST). For more information and access to the dataset, visit CFReDS.
Connecting to the System
Click the Start Lab Machine button attached to this task to start the VM. Once the machine starts, you can access it via the AttackBox or your own VPN connected machine using SSH with the credentials provided below:
| Username | analyst |
| Password | analyst1234 |
Note: All the necessary tools for this room have already been installed on the machine.
Creating a Super Timeline With Log2Timeline
A pre-generated timeline storage file has been prepared using a sample disk image saved on the machine from our source. However, understanding the process remains crucial for your investigative journey.
Log2Timeline
To create a timeline storage file with the extension .plaso, we need to run the following command. Please note that the walkthrough here provides a guide on creating the files; however, this is skipped on the attached machine as it could take hours to complete the process, depending on the size of the disk image.
In our case, we will be using the image on the path /home/analyst/Desktop/Timelines/Task4/2020JimmyWilson.E01. Run log2timeline.py and indicate our output file using the option --storage-file and the image file to use. The first thing log2timeline.py will do is scan the storage file for partitions. If there is more than one partition, or the partition contains Volume Shadow Copies (VSS), you will be prompted to make a specification.
From this point, the pre-processing stage will begin, and information from the storage file will be collected. This stage also determines whether the parser is enabled to generate a Plaso storage file. This will be followed by the storage process, involving several workers and collectors based on the number of CPUs running on the system. All this has been summarized in the terminal output below.
Note: You do not have to run the command because the Jimmy_timeline.plaso file has already been generated for you.
Timeline Creation with Log2Timeline
analyst@MACHINE_IP:~$ /Desktop/Timelines/Task4$ log2timeline.py --storage-file Jimmy_timeline.plaso 2020JimmyWilson.E01
Checking availability and versions of dependencies.
[OK]
The following partitions were found:
Identifier Offset (in bytes) Size (in bytes)
p1 17408 (0x00004400) 32.0MiB / 33.6MB (33554432 B)
p2 33619968 (0x02010000) 816.0MiB / 855.6MB (855638016 B)
Please specify the identifier of the partition that should be processed. All partitions can be defined as: "all". Note that you can abort with Ctrl^C.
Partition identifier(s): all
Source path : /home/analyst/Desktop/Timelines/Task4/2020JimmyWilson.E01
Source type : storage media image
Processing time : 00:01:18
Tasks: Queued Processing Merging Abandoned Total
243 2 1 0 845
Identifier PID Status Memory Sources Events File
Main 91704 merging 221.5 MiB 845 (0) 39501 (2642)
03521f49a3e442499dad46d2818880c2
Worker_00 91711 extracting 205.6 MiB 572 (0) 90675 (777) NTFS:\Windows\System32\config\SOFTWARE
Worker_01 91713 extracting 196.6 MiB 272 (0) 81084 (913) NTFS:\Windows\System32\config\SYSTEM
The disk file has two partitions available, and we were prompted to specify which one to select; in this case, we went with all to parse all the partitions. As we can see from the status window, we have information about the following elements:
- How many workers were started
- The process identifier of the worker processes
- The total events extracted
- The last file entry is from which each worker extracted events
We mentioned parsers that can provide a more granular timeline from the disk. This would narrow the analysis into creating a targeted timeline. We do not need to provide individual files for the parsers to work, but just pointing Log2Timeline to the disk image will use the parser preset and obtain the data we need. A list of parsers supported by Log2Timeline is shown below:
Log2Timeline Parsers
analyst@MACHINE_IP:~$ /Desktop/Timelines/Task4$ log2timeline.py --parsers list | more
********************************* Parsers ************************************
Name : Description
------------------------------------------------------------------------------
android_app_usage : Parser for Android usage history (usage-history.xml
files.
apache_access : Parser for Apache access log (access.log) files.
apt_history : Parser for Advanced Packaging Tool (APT) History log
files.
asl_log : Parser for Apple System Log (ASL) files.
aws_elb_access : Parser for AWS ELB Access log files.
bash_history : Parser for Bash history files.
bencode : Parser for Bencoded files.
binary_cookies : Parser for Safari Binary Cookie files.
bodyfile : Parser for SleuthKit version 3 bodyfile.
bsm_log : Parser for Basic Security Module (BSM) event auditing
files.
--More--
To illustrate the work of parsers, let's employ the winevt parser and filter events about Windows Event Logs using the --artifact-filters WindowsEventLogSystem flag.
Log2Timeline Parsers & Filters
analyst@MACHINE_IP:~$ /Desktop/Timelines/Task4$ log2timeline.py --parsers winevt --artifact-filters WindowsEventLogSystem --storage-file Jimmy_WinEvent_timeline.plaso 2020JimmyWilson.E01
2024-03-12 12:54:04,311 [INFO] (MainProcess) PID:1728 Determined data location: /usr/share/plaso
2024-03-12 12:54:04,327 [INFO] (MainProcess) PID:1728 Determined artifact definitions path: /usr/share/artifacts
Checking availability and versions of dependencies.
[OK]
The following partitions were found:
Identifier Offset (in bytes) Size (in bytes)
p1 17408 (0x00004400) 32.0MiB / 33.6MB (33554432 B)
p2 33619968 (0x02010000) 816.0MiB / 855.6MB (855638016 B)
Please specify the identifier of the partition that should be processed. All partitions can be defined as: "all". Note that you can abort with Ctrl^C.
Partition identifier(s): all
Source path : /home/analyst/Desktop/Timelines/Task4/2020JimmyWilson.E01
Source type : storage media image
Artifact filters : WindowsEventLogSystem
Processing time : 00:00:00
Processing started
Tasks: Queued Processing Merging Abandoned Total
0 0 0 0 0
Identifier PID Status Memory Sources Events
File
Main 1728 completed 157.3 MiB 0 (0) 0 (0)
Worker_00 1733 idle 119.9 MiB 0 (0) 0 (0)
Worker_01 1737 idle 120.3 MiB 0 (0) 0 (0)
Processing completed.
pinfo
We can retrieve information about our timeline storage file using the
pinfo.py command. The information contained includes
metadata from each storage container processed, parsers used during the
creation of the timeline, and the number of extracted events.
Using pinfo.py
analyst@MACHINE_IP:~$ /Desktop/Timelines/Task4$ pinfo.py Jimmy_timeline.plaso | more
************************ Plaso Storage Information ***************************
Filename : Jimmy_timeline.plaso
Format version : 20220716
Serialization format : json
********************************* Sessions ***********************************
1b610eef-70af-4893-bc66-ebd0b81124f0 : 2024-02-21T06:27:49.398019+00:00
****************************** Event sources *********************************
Total : 36
*********************** Events generated per parser **************************
Parser (plugin) name : Number of events
------------------------------------------------------------------------------
appcompatcache : 980
bagmru : 34
explorer_mountpoints2 : 35
explorer_programscache : 10
filestat : 19843
--More--
To obtain a more verbose result containing information collected during processing, we will run the tool with a -v flag: pinfo.py -v Jimmy_timeline.plaso
psort
Psort.py is an accompanying command tool used to post-process Plaso storage files by filtering, sorting, and analyzing the file, aiding in searching for events that occurred during a particular timeframe. Additionally, the tool can convert the file into other file formats, such as CSV, for analysis using other tools.
The basic format for running psort.py is as shown below, together with the output formats supported:
Using psort.py
analyst@MACHINE_IP:~$ /Desktop/Timelines/Task4$ psort.py [-a] [-o FORMAT] [-w OUTPUTFILE] [--output-time-zone TIME_ZONE] STORAGE_FILE FILTER
analyst@MACHINE_IP:~/Desktop/Timelines/Task4$ psort.py -o list
******************************** Output Modules ********************************
dynamic : Dynamic selection of fields for a separated value output
format.
json : Saves the events into a JSON format.
json_line : Saves the events into a JSON line format.
kml : Saves events with geography data into a KML format.
l2tcsv : CSV format used by legacy log2timeline, with 17 fixed fields.
l2ttln : Extended TLN 7 field | delimited output.
null : Output module that does not output anything.
opensearch : Saves the events into an OpenSearch database.
opensearch_ts : Saves the events into an OpenSearch database for use with
Timesketch.
rawpy : native (or "raw") Python output.
tln : TLN 5 field | delimited output.
xlsx : Excel Spreadsheet (XLSX) output
--------------------------------------------------------------------------------
Now, if we want to obtain the complete timeline of Jimmy Wilson's disk image in CSV, we can run the command against it and analyze the output file to find information on specific events, as shown below:
Using psort.py
analyst@MACHINE_IP:~/Desktop/Timelines/Task4$ psort.py -o dynamic -w Jimmy_timeline.csv Jimmy_timeline.plaso
Once the file has been created, we can look at the chronological order of events from our timeline.
Plaso tools also offer the ability to perform automatic analysis using plugins that extract and inspect timeline events, create tags for them, and generate meaningful reports. Based on the installation, the list of supported plugins can be viewed using the command psort.py --analysis list. Some plugins may require additional parameters such as files, keys, or protocols to perform the analysis.
In our analysis of Jimmy's timeline, we wish to tag the events found. We can check which parameters would be needed, such as a file containing event tags, by running psort.py --analysis tagging -h to obtain a list of necessary parameters. Do scroll through the information to identify the arguments section.
Using Psort Analysis Arguments
analyst@MACHINE_IP:~$ /Desktop/Timelines/Task4$ psort.py --analysis tagging -h
...
Analysis Arguments:
--analysis PLUGIN_LIST
A comma separated list of analysis plugin names to be loaded or "--analysis list" to see a list of available
plugins.
--tagging-file TAGGING_FILE, --tagging_file TAGGING_FILE
Specify a file to read tagging criteria from.
...
To run an analysis against our plaso file, we will use psort.py -o null --analysis tagging --tagging-file tag_windows.txt Jimmy_timeline.plaso. This will run the tagging analysis plugin using the "tag_windows.txt" file as the source of all tags, without printing any events. The tagging file is found within Plaso's data directory, which was downloaded during installation. Ultimately, the tool will summarize the analysis, which will be helpful during an investigation.
Using Psort Automatic Analysis
analyst@MACHINE_IP:~$ /Desktop/Timelines/Task4$ psort.py -o null --analysis tagging --tagging-file tag_windows.txt Jimmy_timeline.plaso
...
***************Analysis report: tagging***********
Date and time : 2024-04-02T11:58:25.000000+00:00
Event filter : N/A
Results : application_install: 62
: event_tags: 3370
: time_change: 29
Task Exercise
Based on the investigation case conducted in the Digital Forensics Case B4DM755 room, a disk image file was captured as part of the tasks. This image file under the name Forensic_Image_b4dm755.E01 has been presented to you in the /home/analyst/Desktop/Timelines/Task4/ directory to extract information using the different Plaso tools. You are tasked to utilize what you have learned during this task to complete the set of questions presented to you.