SANS Digital Forensics and Incident Response Blog

Digital Forensic SIFT'ing: Registry and Filesystem Timeline Creation

by Rob Lee

Over the years, being able to examine filesystem timeline data has truly been a breakthrough for many investigations. We started using this technique when we were working on cases in the AFOSI very early on when I wrote a script that would create a basic timeline called mac_daddy.pl based off of the original coroner's toolkit. To my surprise, this key forensic capability that is found in the TCT tools, sleuthkit, and others has not been picked up on by the major forensic vendors as a capability in their toolsets such as EnCase and FTK.

Today's post will discuss how to create a windows operating system timeline of both filesystem and registry data using the SIFT Digital Forensics Workstation.

What is computer forensic timeline analysis?

Timeline analysis essentially takes the metadata time values for each existing and unallocated metadata structure in the file system and sorts it, in order from earliest to most recent, to be viewed and interpreted by a forensic analyst. A good portion of Day 2 in the SEC508 Computer Forensic, Investigation, and Response class is dedicated to creating and analyzing timeline data for both Windows and Linux machines.

Timeline Data is based off of the timestamps stored in the metadata of your filesystem. Lets take a look at the different timestamps stored for some of the most common filesystems you might encounter.

Timestamp Metadata in Common Filesystems

Once a timeline is created, it will be sorted based off of the above timestamp data into a file. Each line will have an output that will include the majority of the metadata associated with it. Learning how to interpret a timeline takes time and practice, but after you utilize it for several cases you will realize just how valuable this data will be to help generate additional computer forensic leads to examine inside the case you are working.

timeline-output

Creating a timeline on a Windows machine (Registry Key Last Write Time and Filesystem Time MetaData)

You will need the SIFT Workstation for this example. DOWNLOAD

Not only can you bring in timeline data from the filesystem, the registry can also be combined into a timeline. First of all we will start with a filesystem image that was acquired. This is our working copy image that is in raw (dd) format. In this case, the name of the file is xp_dblake.dd acquired in the 20090204 case following the YYYYMMDD case name example.

"Working Copy" Forensic Image - RAW (dd)Our NTFS Raw (dd) Image

Mounting an image is easy. Take a look at the previous Digital Forensic SIFT'ing blog on how to examine and mount raw (dd) images in read-only mode.

Mounting "Working Copy" image for analysis using SIFT WorkstationMounting in Read-Only Mode an NTFS Disk Image in Raw (dd) Format

Creating Timeline of Registry Hives

Regtime.pl is a tool that was created by Harlan Carvey and can be found on the SIFT Workstation to parse the registry and pull all of the last write times from every key. It will output in the sleuthkit "bodyfile" format that can be added to the filesystem bodyfile or analyzed separately using the mactime tool. I had been bugging Harlan for years for this capability based off of his knowledge of the registry. He probably knows registry forensics better than anyone I know and his toolkits show it.

How do you use regtime.pl? Easy.

Run from /usr/local/src/windows-perl on the SIFT Workstation

# perl regtime.pl —m <HIVETYPE> —r <HIVEFILE> > bodyfile

[Useful Options]

-r Registry hive file to parse <HIVEFILE>

-m Name of <HIVENAME> for Mactime Bodyfile

Example (HKLM-SAM, HKEY-USER-NAME)

The benefits of identifying when specific keys are last updated and comparing that to what is occurring on the filesystem is a very telling investigative technique. You can use this to easily identify when files are saved, USB keys are inserted, and programs are executed.

Creating a timeline of the registry is easy. You just need to remember where the registry hives are stored on the windows filesystem. The program will require you to point the (-r) option at the specific registry hive you would like to parse. Remember, HKEY_LOCAL_MACHINE hives are located in C:\WINDOWS\system32\config (SECURITY, SAM, system, software). The HKEY-USER hives are located in C:\Documents and Setting\<username>\NTUSER.DAT. If you are one of the few people using VISTA look in C:\Users\<username>NTUSER.DAT.

The hive name is utilized by the mactime program to allow for the user to easily identify the specific key and the hivetype that it originated from. Without the (-m) option, you will not know which user a specific hive originated from. The (-m) option will take any regular input.

The output below uses the mounted filesystem above and uses regtime.pl. This is an example of using regtime.pl to pull bodyfile data from the core HKEY_LOCAL_MACHINE hives (system, SAM, SECURITY, software) located in /WINDOWS/system32/config/ directory. Notice how in each execution it is appending to the existing bodyfile using the (>>) as a part of the command. Each of the 4 core hives and the user hive (NTUSER.dat) will be added to the overall bodyfile located in this example in /images/20090204/bodyfile.

Creating Timeline Bodyfile of Registry HivesAdding Core Registry Hives and the User Hive to the Bodyfile

Creating a Timeline of a NTFS Filesystem

Once the bodyfile has been created, then we can move on to adding the metadata timestamps from the NTFS filesystem using fls from the sleuthkit.Again, make sure you continue to use the (>>) to append the existing bodyfile. Finally, once our final bodyfile is created we can use the mactime tool to create our human readable output for examination.

Adding to Filesystem Metadata to BodyfileAdding NTFS Filesystem Timestamps to the Bodyfile

Regsitry and Filesystem Timeline Examination

Timeline Output Showing IPOD Being Plugged In an XP MachineRegistry and Filesystem Timeline Output For Jan 16, 2009 18:24 EST

In the above example we can see exactly where the setupapi.log file was updated which is very useful in forensics. On VISTA the location of this file is \WINDOWS\inf\setupapi.dev.log. You can also clearly see when the HKEY_Local_Machine USBSTOR keys were last modified when the Apple Ipod was inserted. Again detailed information on USB History viewing and their associated registry keys can be found in many places.

The overall point of this exercise is to show you how to create a timeline of both registry and file system data. This combination makes a very powerful analysis mechanism for examining changes to the system around a specific time of activity on a machine.

If you have any questions or have trouble getting this to work on your case, please email me at rlee@sans.org. Sign up for the NEW class SEC408 Computer Forensic and E-Discovery Essentials debuting at SANSFIRE 2009.

_________________________________________________________________________________________________________________________________________

Rob Lee is a Principal Consultant for MANDIANT, a leading provider of information security consulting services and software to Fortune 500 organizations and the U.S. Government. Rob has over 13 years experience in computer forensics, vulnerability discovery, intrusion detection and incident response. Rob is the lead course author and faculty fellow for the computer forensic courses at the SANS Institute.

8 Comments

Posted February 24, 2009 at 10:43 AM | Permalink | Reply

keydet89

Rob,
Thanks for the shout-out!
Now that WFA 2/e is near completion (at least, with respect to my part''), one of the top things on my To-Do list is to add the ability to report timeline information to tools such as RegRipper (to include rip and ripXP), evt2xls, etc. This will provide a more granular approach to extracting and populating timeline information than is currently available with regtime.pl, as well as provide the capability to correlate other sources of information (IIS web server logs, network packet captures, etc.).

Posted February 24, 2009 at 1:43 PM | Permalink | Reply

Paul Bobby

Encase has had a timeline view for years.
Furthermore, when mounting files, such as the registry, just sort the Last Written column, and there you go.
If it has a timestamp, it can be sorted.

Posted February 24, 2009 at 1:59 PM | Permalink | Reply

keydet89

There is way too much data on a system that includes timestamps to post all of it''there's no data reduction, if you go with everything. Getting *all* of the Registry key LastWrite times gives you way too much data, and completely misses a lot of the timestamp data embedded in value data (ie, UserAssist keys). Also, getting *just* the key LastWrite times provides little context, particularly in the case of MRU lists.
There needs to be some means of trimming the data. For example, on Vista and above, the NtfsDisableLastAccessUpdate value is set by default''so why would you use a TSK tools to display that information? Or, what if the setting is disabled? How about incorporating Event Log event records, entries from IIS web server logs, etc.?
"There are more things in Heaven and Earth than are dreamt of in your philosophy."

Posted February 24, 2009 at 2:15 PM | Permalink | Reply

robtlee

There is a lot of data interpretation that could be done, but getting to that point would be great.
Baby steps. Then we can walk. Then run.
Step #1 is getting the average analyst to the point where you can create a simple timeline. #2 would be manual interpretation'' always the hardest step. #3 would be automated reduction of data that is not useful and context interpretation. (many hours of work to get here)
In this post, I was attempting to get everyone to at least step #1.
Getting everyone to the point where we have the same sheet to analyze from will allow for new discoveries and the next USBSTOR and USERASSIST keys being created. Or differences between versions of Windows (XP, Vista, Windows 7)
Good thoughts. Keep em coming''

Posted June 14, 2010 at 2:39 PM | Permalink | Reply

paulo

could provide the images shown in cases (examples), where I find this image xp_dblake.dd to replicate the lab.
Always accompany your articles hands-on, congratulations
I'm from Brazil

Posted December 2, 2011 at 9:27 PM | Permalink | Reply

Casey

Paulo, if you download the Sift workstation, I believe the xp_blake.dd image is in there. I may be wrong, and it may have been included in the class disk.

Posted February 13, 2013 at 8:39 PM | Permalink | Reply

Ken

Rob,Hey I was checking out the SIFT workstation for possible class. I saw a shortcut for log2timeline that's dead. Its looking for glog3timeline, which isnt in the directory. I haven't researched it much, but I know they took the GUI out for a a while. If there is a GUI that can be used with the latest log2timeline, please point me to it and Ill fix my dead link. The command line one is still in there and is working. ThanksKen