How To: Change File Metadata (Access/Modification Date)

Change File Metadata (Access/Modification Date)

In this tutorial I am going to show you how to change some file metadata, this could be very useful if you want to edit or access a file and remove any evidence of your changes.

In this introduction we are going to change simple files metadata, just dates.

Step 1: Copy of the Original File

First of all we have to copy the original file that we want to edit, this is because we are going to copy its metadata into our new edited file.

So suppose that I have downloaded a text file, or that we have localized it in a remote system.

#cp myDocument.txt myDocument2.txt

We can see the actual metadata with exiftool, which is built in Kali:

#exiftool myDocument.txt

Step 2: Edit the File and Copy the Original Metadata

Now we can access the file, edit it and everything you want.

If we take a look to the actual metadata we can see that they have been changed, obviously.

Once it has been modified we just have to copy the original metadata to remove any hint.

touch myDocument2.txt -r myDocument.txt

Lets take a look at the new dates:

Step 3: Delete the Original File

At this point we have edited the file and it has the original access and modification date. We just have to delete the original file.

We can do it with the simple command rm, but if we want to be more prudent: secure file delete

Step 4: Changing Other Metadata and Other Files

In another tutorial I will explain how to edit more complex metadata in another kind of files such as PDF, PNG, JPEG...

Want to start making money as a white hat hacker? Jump-start your hacking career with our 2020 Premium Ethical Hacking Certification Training Bundle from the new Null Byte Shop and get over 60 hours of training from cybersecurity professionals.

Buy Now (90% off) >

Other worthwhile deals to check out:

Join the Next Reality AR Community

Get the latest in AR — delivered straight to your inbox.


Good start point drMorpheus! +1

Thanks Jako! Great tutorials too

use touch command we can change access/modify time ,create file.

Share Your Thoughts

  • Hot
  • Latest