Document Metadata OSINT

Extracting identity, environment and lineage from the envelope of published files (OOXML parts, PDF Info/XMP, incremental saves, EXIF, active references) to map an organization or attribute a document, and the sanitization needed to stop it.

How it works

Files leak three ways, with covert marks underneath (Your Files Are Talking):

  • Passive metadata — who, where, when, with what (EXIF, docProps, PDF /Info + XMP).
  • Structural residue — revision IDs, incremental PDF saves, embedded thumbnails and workbooks preserve what the author thinks is gone.
  • Active content — remote templates, external images, UNC paths, PDF actions make the file report on its reader.
  • Content-level marks — printer Machine Identification Code dots, camera PRNU, canary-trap text variants, zero-width characters. These survive every metadata scrub.

Where to look

OOXML (.docx/.xlsx/.pptx = ZIP of XML)
| Part | Leaks |
|---|---|
| docProps/core.xml | dc:creator, cp:lastModifiedBy (often AD logins → email format), cp:revision, cp:lastPrinted (survives Save As, so dates the original document) |
| docProps/app.xml | exact Office build, Company, Manager, Template, TotalTime |
| docProps/custom.xml | Purview MSIP_Label_<GUID>_*: SiteId = Entra tenant GUID (resolves to the org), label name, Method, SetDate |
| docMetadata/LabelInfo.xml | label history incl. removed="1" entries from other tenants |
| customXml/item*.xml | cover-page data store (persists after cover page deletion); SharePoint SharedWithUsers, ContentTypeId |
| word/settings.xml (w:rsids) | every editing session; shared rsids prove common ancestry between documents |
| word/_rels/*.rels, xl/externalLinks/ | absolute paths: C:\Users\<user>\OneDrive - <Org>\..., \\fs01\finance\, SharePoint URLs |
| xl/pivotCache/, word/embeddings/ | full source datasets and whole workbooks behind a pasted chart |

PDF

  • /Info and XMP disagree often; clean both. /ID[0] stays constant across saves and links revisions across releases; xmpMM:DocumentID/History likewise.
  • Creator/Producer fingerprint the pipeline (Word export vs MFP scan vs iText/Ghostscript backend).
  • Incremental updates append; count %%EOF, carve with qpdf --show-xref, pdfresurrect, mutool show to recover deleted text.
  • Redaction failures, most common first: overlay box over live Tj/TJ text (select-all or pdftotext recovers it); text left in OCR layer, bookmarks, /Alt, form fields or XMP; glyph-width/kerning leakage that constrains candidates; blur/pixelation reversible by brute force through the same transform (Depix-style). Only solid fill on pixels destroys information.

All from Your Files Are Talking.

Images — GPSLatitude/Longitude/Altitude/ImgDirection, OffsetTimeOriginal (time zone even with GPS off), BodySerialNumber, plus embedded thumbnails and MPF secondary images; see Image Geolocation.

Techniques

Estate harvesting. Enumerate an org’s published files (site:target.com filetype:pdf|docx|xlsx, Wayback CDX, public buckets/SharePoint links, or FOCA/Metagoofil) and run exiftool -j -r into a dataframe. In aggregate you get username format for spray lists, exact Office/PDF library builds (patch level, pretexts), server/share/printer names, and org-chart fragments from Author vs LastModifiedBy (Your Files Are Talking, Wiz: FOCA). Sitemaps make it trivial: a government portal’s sitemap index (44 sub-sitemaps, 80k URLs, 15k+ PDFs, 700+ DOCX) enumerated every file unauthenticated; metadata held staff account names, NAME@W###### workstation IDs, C:/Users/<name>/ XMP paths (one as dc:title), Company and internal .dotx GUIDs (Government portal metadata leak). Severity comes from the corpus, not one file.

Single-file attribution. An “anonymised” recruiter .docx was attributed in ~20 minutes: cp:lastPrinted five years before created exposed template reuse; 594 rsids listed vs 6 used; the cover-page data store’s CompanyFax held “‘s DFIR Team”; SharePoint SharedWithUsers named the CEO; the Purview SiteId tenant matched; a removed label from a second live tenant was visible in LabelInfo.xml (Attributing an anonymised .docx). Compare what a file shows with what it contains: a visually blank PDF had a text layer recoverable with pdftotext, and its fr language tag was the hint (Blank PDF CTF).

Reader-side callbacks (canaries). Remote template injection (attachedTemplate, TargetMode="External" in settings.xml.rels), INCLUDEPICTURE, external images, PDF /URI//SubmitForm//GoToR, and .lnk/.url/desktop.ini icon paths disclose IP, client and open time; UNC targets leak NTLMv2; a unique hostname alone leaks the reader’s resolver via DNS (Your Files Are Talking). A DIY canary (Word doc fetching a 1×1 PNG from a Python listener, plus p0f passive OS fingerprinting) helps distinguish an endpoint from a sandbox, mail gateway, proxy or scanner before over-interpreting a hit (DIY document tripwire).

Correlation, not single fields. Tenant GUID → employer via Microsoft OpenID configuration; /ID or DocumentID → common origin across leaks; rsid sets → draft lineage; Producer → generating system. No single step is conclusive; together they are (Your Files Are Talking).

Adjacent artifacts. Git commit author/email/timestamps are client-asserted. Treat author and committer as separate claims, verify containment against refs in a --mirror clone (fork objects render under the parent’s URL), and note that GitHub web-UI commits show “Verified” via the web-flow key (Git repo forensics). File hashes can be triaged against known-file sets with hashlookup-forensic-analyser (v0.8 adds --report with Markdown and JSON output) (hashlookup).

Notable cases

  • 2003 UK “dodgy dossier” .doc revision log named the editing officials; 2005 BTK floppy .rtf metadata (“Christ Lutheran Church”, user “Dennis”); 2012 McAfee photo GPS; 2017 Reality Winner MIC yellow dots on a scanned printout (Your Files Are Talking).
  • Government portal, 15k+ PDFs, bulk-harvestable internal usernames and workstation naming via sitemap; acknowledged under responsible disclosure (Government portal metadata leak).

Defenses

  • Strip on ingest in the publishing pipeline (exiftool -all= minimum); publish a sanitized copy, keep the original internally (Government portal metadata leak).
  • Know the limits: exiftool -all= skips MakerNote internals, MPF images and trailing data, and its PDF edits are reversible incremental updates; Office Document Inspector misses rsids, pivot caches, embedded workbooks and some external rels; some “remove hidden information” PDF features clean /Info but not XMP, or save incrementally.
  • Rebuild, don’t edit: rasterize + OCR (Dangerzone approach) kills incremental history, hidden layers and glyph-width leakage; redact on pixels with solid fill; drop external relationships, fields, JS, actions and macros; remove the yellow channel from scans; verify the bytes the recipient actually receives. mat2 reconstructs many formats but does not handle content or watermarks (Your Files Are Talking).
  • Open untrusted documents offline or in a VM/converter, never on a host whose IP or Windows credentials matter.
  • Template hygiene: purge old labels, cover-page stores and rsid history from shared templates.

Sources