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.
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:
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:
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
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.
Other worthwhile deals to check out: