saad sarraj • 2023-07-21
An example would be the information you find on the cover of a book. It tells you things like the book’s title, who wrote it, when it was made, and what it’s about.
Metadata gives you important details about a document, like its name, who made it, when it was created, the device used, and the software used. This information helps us keep track of and find documents easily.
An example would be the information you find on the cover of a book. It tells you things like the book’s title, who wrote it, when it was made, and what it’s about.
If you would like to read metadata from a document or an image, you can use a CLI program called ExifTool.
To read the metadata of a PDF file using ExifTool, you can follow these steps:
Follow the installation instructions for your specific operating system.
Open a command prompt or terminal: Launch the command prompt or terminal on your computer.
Navigate to the directory containing the ExifTool executable: Use the cd
command to change to the directory where ExifTool is installed.
For example, if it’s installed in the “C:\ExifTool” directory on Windows, use the command cd C:\ExifTool
Run the ExifTool command: With the command prompt or terminal open and the correct directory selected, you can read the metadata of a PDF file by running the following command:
exiftool <PDF filename>
exiftool sample.pdf
Sample.pdf outout
Note: ExifTool can extract metadata from various file types, not just PDFs. You can use the same command to read metadata from images, audio files, videos, and more.
You can remove metadata from a file using ExifTool, you can follow these steps:
Install ExifTool: If you haven’t already, download and install ExifTool from the official website (https://exiftool.org/) following the installation instructions for your operating system.
Open a command prompt or terminal: Launch the command prompt or terminal on your computer.
Navigate to the directory containing the ExifTool executable:
Use the cd
command to change to the directory where ExifTool is installed.
For example, if it’s installed in the “C:\ExifTool” directory on Windows,use the command cd C:\ExifTool
Run the ExifTool command to remove metadata:
With the command prompt or terminal open and the correct directory selected, execute the following command to remove metadata from a file:
exiftool -all= <filename>
exiftool -all= Sample.pdf
This command removes all metadata from the file, including EXIF data, IPTC data, XMP data, and any other metadata types present in the file.
The issue with the aforementioned approach for removing metadata from a file is its reversibility.
Consequently, anyone utilizing ExifTool to eliminate metadata from a file prior to emailing or uploading it online cannot ensure complete privacy, as this data may be recovered.
To recover deleted metadata, you can use the following option:
exiftool -pdf-update:all <filename>
exiftool -pdf-update:all Sample.pdf
The aforementioned command will recover all deleted metadata from a PDF file.
This command is specifically designed to work with PDF files and doesn’t work for images, audio files, and other file types.
You might be wondering, “How can I protect myself from the retrieval of metadata?”
Well, there’s a solution to permanently delete metadata using a tool called qpdf.
Begin by following the method mentioned earlier using ExifTool to delete the metadata.
exiftool -all= <filename>
exiftool -all= Sample.pdf
Next, download qpdf.exe from https://sourceforge.net/projects/qpdf/ and save it to your computer.
Open the command prompt (cmd) and navigate to the location where you saved qpdf.exe.
Now, execute the following command to permanently delete the metadata and make it unrecoverable:
qpdf --linearize <stripped_exiftool.pdf> <new_filename.pdf>
qpdf --linearize Sample.pdf New_Sample
By using qpdf in this manner, you’ll ensure that the metadata is permanently removed and cannot be retrieved. This additional step adds an extra layer of protection to safeguard your privacy.
Links to the websites are in CyberSudo’s OSINT Toolkit.
Get a Free Ethical Hacking Kit: https://cybersudo.org
Cardy
Copyright © 2021 Govest, Inc. All rights reserved.