RedTeam Nexus Labs
Module 17 · Lesson 02 // File Analysis

metadata

File Analysis · CTF

Freereading · 10 min
On this page
LESSON

Overview

Files carry more than the content you see. Photos, documents, and PDFs embed metadata — data about the data — describing when and how the file was created, by whom, and sometimes exactly where. In CTF forensics, flags are frequently hidden in metadata fields. In the real world, the same fields routinely leak sensitive information that people never intended to publish. This lesson shows what metadata is, where it lives, and how to read it safely.

Learning objectives

  • Define metadata and give examples of common metadata fields.
  • Explain where metadata is stored inside images and documents.
  • Use metadata-reading tools to extract fields without executing the file.
  • Describe the privacy and security risks of leaked metadata.

Core concept

Metadata is descriptive information attached to a file that is separate from its visible content. A photograph's pixels are its content; the camera model, timestamp, and GPS coordinates stored alongside them are metadata. Because metadata is written automatically by cameras, phones, and applications, people are often unaware it exists — which is exactly why it is a rich source of clues in forensics and a common privacy leak.

How it works

Different formats store metadata in different structures:

  • Images (JPEG, TIFF) commonly use EXIF (Exchangeable Image File Format), holding fields such as camera make and model, the date and time a photo was taken, exposure settings, and optionally GPS latitude/longitude. JPEGs may also carry IPTC and XMP blocks used for captions and copyright.
  • PNG images store text chunks (tEXt, iTXt, zTXt) that can hold arbitrary key/value comments.
  • PDFs have a document information dictionary and/or XMP metadata with fields like Author, Title, Creator (the authoring app), Producer, and creation/modification dates.
  • Office documents (.docx, .xlsx) — which are ZIP archives internally — keep author, company, and revision data in docProps/core.xml and app.xml.

A metadata reader parses these structures and prints the fields as text. Crucially, reading metadata does not run the file; it only interprets the header/description blocks, which makes it a safe first step.

Practical example

You are given vacation.jpg in an authorized challenge. Instead of just viewing it, you read its metadata:

$ exiftool vacation.jpg
File Name        : vacation.jpg
Camera Model Name: (example camera)
Create Date      : 2023:07:14 09:12:30
GPS Latitude     : (degrees/minutes/seconds)
GPS Longitude    : (degrees/minutes/seconds)
User Comment     : flag{exif_reveals_more_than_pixels}

The User Comment field holds the flag — invisible when you merely look at the image. The GPS fields, meanwhile, show that the photo records the exact location where it was taken. On Linux you could also use identify -verbose (ImageMagick) or exiv2 to read comparable fields.

Cybersecurity relevance

Metadata is a double-edged sword. For investigators and CTF players it provides timelines, device fingerprints, authorship, and geolocation. For everyone else it is a privacy risk: publishing a photo with intact GPS EXIF can disclose a home address; sharing a document can reveal the internal author names, software versions, and edit history an organization would rather keep private. This is a real operational-security concern — organizations scrub metadata from files before release, and forensic analysts specifically look for it. Understanding metadata teaches you both how to find hidden information and why stripping it matters before sharing files.

Common mistakes

  • Judging a file only by its visible content and never inspecting its metadata fields.
  • Assuming metadata is harmless — GPS coordinates and author names can be highly sensitive.
  • Forgetting that Office and PDF files carry metadata too, not just photos.
  • Editing content but not removing metadata, so old author names or timestamps persist after "cleanup."

Key takeaways

  • Metadata is descriptive data about a file (timestamps, device, author, location) stored separately from visible content.
  • Images use EXIF/IPTC/XMP; PNGs use text chunks; PDFs and Office files keep author/creator/date fields in dedicated structures.
  • Reading metadata with a tool parses these fields without executing the file, making it a safe early step in analysis.
  • Leaked metadata (especially GPS and author fields) is a genuine privacy and OPSEC risk, which is why sensitive files are scrubbed before sharing.

Check your understanding

  • Where in a JPEG would you expect to find the date a photo was taken and the location it was captured?
  • Why is stripping metadata important before publishing a photo or document, and what kinds of information might otherwise leak?
FINISH THIS LESSON

Sign in to save your progress.