Forensic Investigation: Preserve TimeStamp

As a Digital Forensic Investigator, you might understand, how important it is to preserve timestamps of any evidence gathered at the scene of a crime. You will be on your toes to make sure that the timestamps of the original evidence are never altered at the time of acquisition. This is important as you have to maintain the chain of custody of the evidence.

Table of Contents

  • Introduction to Timestamp
  • Preserving Timestamp using command-prompt
  • Preserving Timestamp using ForensiCopy
  • Preserving Timestamp using OSForensics
  • Preserving Timestamp using Copy Files with Dates
  • Preserving Timestamp using SafeCopy
  • Preserving Timestamp using TeraCopy
  • Preserving Timestamp in Linux

Some of the popular file systems like FAT, NTFS, and EXT store file timestamps in the following manner

Let us take a scenario where you have been investigating a case and suddenly you have the opportunity to gather evidence files or folder from a system which you had been wanting to seize for a very long time, but now you don’t have your paid and expensive tools with you. If you use the traditional copy and paste method, you will be changing the timestamps of the documents

If we want to avoid these problems in our forensic investigation, we are going to learn to use a few simple forensic techniques and open-source software where you will be able to copy folder or files from one location to the other without changing the timestamps, hence preserving the timestamp.

Preserving Timestamp using command-prompt

This is one of the manuals and simplest technique which does not require any fancy, expensive, or automated software to transfer files from one location to the other in a windows system with just using a command in the command prompt. The Robocopy command stands for ‘Robust File Copy’, which was introduced in Windows NT and has been popular ever since to copy files from one location to another robustly. You can type;

After the copying is completed, you can manually see that has been no difference in the date time stamp in the copy of the file.

Preserving Timestamp using ForensiCopy

ForensiCopy is an automated evidence copying software that is quite different from imaging.  It can be downloaded from here. This tool copies the file from one location to the other without changing the timestamps. All you have to do is, add the path of the file, the destination of the file to copy and click on start. On completion, it will generate a log file.

Once the copy is over, you can compare the source and destination properties of the files and you will see that the time was not changed.

Preserving Timestamp using OSForensics

OSForensics has always been a legendary tool in forensics investigation and provides the option to make a ‘Forensic Copy’. You can download it from here.

Here in this software, it is called as Forensics Imaging by creating a Logical Image. In Logical Image, only a portion of a drive is copied bit by bit and keeps the timestamp of the file/folder intact. Add the source and destination path of the folder and click on start.

Here, you can see that the source and destination path have not changed and are intact.

Preserving Timestamp using Copy Files with Dates

This again is a crucial software when it comes to preserving the date and timestamps of any files in the Windows file system. You can download it from here. All you have to do is put a source file and the destination file and click on start.

A log file will be generated which can be opened in the command prompt using

Preserving Timestamp using SafeCopy

It is a software which can be used to perform forensics as well as anti-forensics. You can download it from here. Add the source and the destination path and keep the same date and time of the file to preserve it and then click on copy.

You will see below, that the timestamps for these files that have been copied to a new destination are intact.

Preserving Timestamp using TeraCopy

It is a quite simple tool and barely any consumes very little time to copy the files to the destination without changing the date and time of the original document. You can download it from here.

Preserving Timestamp in Linux

So here you can switch on your Linux machines and open your terminal as root. Go to the directory of the source of the file to be copied and type

To copy the file without changing time stamp, use command;

You can see that it has been copied to a new destination without the timestamp changing, to see the file information at the new path, type;

Conclusion: Hence, here in this article you have learnt about various methods and tools to copy files from one location to the other without changing the timestamp.

Author: Jeenali Kothari is a Digital Forensics enthusiast and enjoys technical content writing. You can reach her on Here

USB Forensics: Detection & Investigation

Universal Serial Bus flash drives, commonly known as USB flash drives are the most common storage devices which can be found as evidence in Digital Forensics Investigation. The digital forensic investigation involves following a defined procedure for investigation which needs to be performed in such a manner that the evidence isn’t destroyed. So, let us get started with the Forensics Investigation of USB.

Table of Contents

  • Detecting last attached USB flash drives in the Windows system
  • Using Registry Editor
  • Using PowerShell
  • Using USBDeview
  • Detecting last attached USB flash drives using Metasploit
  • Investigating USB flash drives for deleted files
  • Creating Disk Image
  • Analysing Disk Image

Detecting last attached USB flash drives in the Windows system

The usage of USB drives in place of work may let nasty employees remove sensitive or confidential information from a system without any authorization. To resolve this issue, forensic examination of systems comes into the picture. So, let’s start investigating;

To detect the artifacts of the USB in the windows machine, we can use the manual as well as automated methods.

Using Registry Editor

It is a manual method to easily list the information of the last plugged in USB storage devices. Press ‘Windows+R’ and type Registry Editor.

This information can be found in the Windows registry at:

The details like last plugged in USB devices, the vendor of the USB, name of the product, serial number, and version name can be seen.

Using PowerShell

This a manual method to find artifacts. The same path can be used in the PowerShell to get the information on last plugged in USB, with the following command;

Using USBDeview

To use an automatic method to find artifacts, you can download USBDeview. This tool gives you an automated and a graphical representation understanding of what USB devices were connected to the system.

Detecting last attached USB flash drives using Metasploit

When the USB flash drives history need to be investigated remotely, we can make use of modules in Metasploit in the Kali Linux This module will enumerate USB Drive history on a target host. To use this module, switch on your Linux machine, start msfconsole, and type command;

Set the session number and exploit. Here you will be able to see a history of various USB connected previously.

Now you have also obtained the meterpreter session, so in order to use the powershell remotely to get the history of USB flash drives connected you can use the following command;

Once the PowerShell is loaded, you can type,

You can hence see the list of USB Flash drives connected to the system remotely.

Investigating USB flash drives for deleted files.

After we have detected all the USB connection to the system and if the USB Flash drive is available at the scene of the crime. It can be carefully collected in Faraday Bag and now the forensic investigator can investigate the evidence.

At first, it is important to create an image of the USB flash drive that was retrieved from the crime scene. To create an image and to analyse, we can use FTK® Imager, which can be downloaded from here.

Creating Disk Image

Step 1: Install and run AccessData FTK imager

Step 2. Create a disk image of the USB Drive

A disk image is a bit-by-bit or a sector-by-sector copy of a physical storage device like USB Flash drive, which includes all files, folders and unallocated, free and slack space etc.

Step 3: As it as USB Flash drive, select Physical Drive and its source to create an image and click on finish.

Step 4: Add the destination of the image file, check the box which say verify images that are created.

Step 5: After adding the destination of the image file to be created, type the name you want to give to the image file and click on finish.

Step 6:  You can see that the image destination is ready, then click on Start to begin imaging.

Step 7: You see that the image of your USB flash Drive is being created.

Step 8: After the imaging is completed, you will be prompted with MD% image verification details where a compared and verified hash is generated.

Here the imaging part is over, so we can now move to the analysis of the USB Flash Drive.

Analysing Disk Image

Note: Investigation is to be performed only on the Disk image of the original evidence.

Step 9: Click on add evidence item and add the source of the created image file.

Step 10: Here you see that an evidence tree is created and the root folder has deleted folders. Here we will try to retrieve them by clicking on ‘Export files’

Step 11: You see that the deleted folder and the contents of the deleted folder have been retrieved.

Author: Jeenali Kothari is a Digital Forensics enthusiast and enjoys technical content writing. You can reach her on Here

Anti-Forensic: Swipe Footprint with Timestomp

In this article, we will learn how we can swipe our footprint after hacking the victim’s system. We can achieve that with the help of the Timestomp feature provided by Metasploit Framework.

Let’s understand the scenario

In this scenario, how a hacker can remove his footsteps in the victim system after the hack. So, that he won’t get caught in the Forensic Investigation.

Objective: Learn to use the functionality of the Timestomp feature provided by the Metasploit Framework.

Ex: Changing the Date and Time of Modified, Created, Accessed of a particular file type.

Table of Content

  • Introduction to Timestomp
  • Display MACE value
  • Set the Modified date and time
  • Set the Accessed date and time
  • Set the Created date and time
  • Set the Entry Modified date and time
  • Set All four attributes at once
  • Set the MACE attributes equal to supplied file

Introduction to Timestomp

As we all know with file systems is be like walking in the snow…. we will leave footprints. It will depend on how detailed those footprints are, how much we can learn from them, and how long we last all depends on various circumstances.

The art of analyzing these artifacts is known as Digital Forensics. For various explanations, when conducting a penetration test, we may want to make it tough for a forensic analyst to determine the movements that we took.

To avoid detection by the forensic investigation is simple: Don’t touch the filesystem! This is the beauty of Meterpreter, it will load into memory without writing anything to disk, greatly minimizing the pieces it leaves on a system.

But in Some cases, we may have to interact with the filesystem in some way. In these cases, Timestomp will be a great tool.

To know the full functionality of the Timestomp feature we just need to take a meterpreter session and follow these commands.

Display MACE value

This feature helps us to Display MACE values, where MACE stands Modified Accessed Created Entry Modified. Through this feature, we can see these values and see if these values are modified during the hack or not.

To view, these details follow this command.

Change Modified date and time

It is the date and time when a new version of the file, which is created better known as the last activity. Where last activity is the date and time when changes are made to the item’s metadata.

Now we can change this modified date and time as per our need, with the help of [-m] parameter. By this command.

we can also check that whether we can able to modify the date and time or not, with the help of [-v] parameter. As we can check the below screenshot, we have successfully able to modify the date and time.

Change Accessed date and time

It is the date and time we accessed the material or file. It can be listed as day, month, and the year it is also included at the end of the citation.

Now we can change this accessed date and time as per our need, with the help of [-a] parameter. By this command.

we can also check that whether we can able to change the date and time or not, with the help of [-v] parameter. As we can check the below screenshot, we have successfully able to change the date and time.

Change Created date and time

The created date is recorded when the file was created. Now we can change this created date and time as per our need, with the help of [-c] parameter. By this command.

we can also check that whether we can able to change the date and time or not, with the help of [-v] parameter. we can check the below screenshot we have successfully able to change the date and time.

Change of Entry Modified date and time

It is the date and time of the last entry modified in the particular file or material. Now we can change this entry modified date and time as per our need, with the help of [-e] parameter. With the help of this command.

we can also check that whether we can able to change the date and time or not, with the help of [-v] parameter. we can check the below screenshot we have successfully able to change the date and time.

Set All four attributes at once

If we want to set all four MACE attributes [Modified, Accessed, Created, and Entry Modified]. It will change the whole investigation scenario, easy to us swipe the footprints of the hack.

Now we can change all MACE attributes date and time as per our need, with the help of [-z] parameter. With the help of this command.

we can also check that whether we can able to change these dates and times or not, with the help of [-v] parameter. we can check the below screenshot we have successfully able to change these dates and times.

Set the MACE attributes equal to supplied file

This amazing feature helps us to give the MACE attributes value equal to that particular supplied file. The first file which we use in this practical is file.txt. We use the [-v] parameter to display its MACE attributes values.

Now, we have cross-checked the MACE attributes values of the note.txt, with the help [-v] parameter.

After this, we use the [-f] parameter to change the MACE values of file.txt with note.txt. To achieve that we give the proper path of the note.txt file. Like this

Now, we can also check that whether we can able to change these dates and times or not, with the help of [-v] parameter. we can check the below screenshot we have successfully able to change these dates and times. Through this feature, we can sweep our footprints during the hack.

Conclusion:  We have learned, how a hacker can remove his footsteps in the victim system after the hack. So, that it won’t get caught in the Forensic Investigation.

Although there are many different foundations of timeline information on the Windows system Other than just MACE times. If a forensic investigator came across a system that had been adapted in this manner, they would be successive to these substitute information sources.

Author: Shubham Sharma is a Pentester and Cybersecurity Researcher, Contact Linkedin and twitter.