# 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 ([[raw/medium.com/your-files-are-talking-tracking-surveillance-and-osint-in-everyday-doc-14375|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 [[raw/medium.com/your-files-are-talking-tracking-surveillance-and-osint-in-everyday-doc-14375|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 ([[raw/medium.com/your-files-are-talking-tracking-surveillance-and-osint-in-everyday-doc-14375|Your Files Are Talking]], [[raw/wiz.io/9-top-osint-tools-how-to-evaluate-them-3374|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 ([[raw/infosecwriteups.com/the-metadata-nobody-reads-how-a-government-portal-leaked-internal-user-15303|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 "<Org>'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 ([[raw/medium.com/attributing-an-anonymised-docx-from-its-metadata-13573|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 ([[raw/medium.com/from-a-blank-pdf-to-a-manhattan-address-solving-the-counterintelligenc-15346|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 ([[raw/medium.com/your-files-are-talking-tracking-surveillance-and-osint-in-everyday-doc-14375|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 ([[raw/infosecwriteups.com/beyond-canarytokens-building-a-diy-document-tripwire-with-passive-os-f-10025|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 ([[raw/medium.com/your-files-are-talking-tracking-surveillance-and-osint-in-everyday-doc-14375|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 ([[raw/root-security.eu/git-repo-forensics-a-seven-phase-process-for-investigating-suspicious-11482|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) ([[raw/github.com/hashlookup-forensic-analyser-version-0-8-released-including-a-report-f-5188|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 ([[raw/medium.com/your-files-are-talking-tracking-surveillance-and-osint-in-everyday-doc-14375|Your Files Are Talking]]).
- Government portal, 15k+ PDFs, bulk-harvestable internal usernames and workstation naming via sitemap; acknowledged under responsible disclosure ([[raw/infosecwriteups.com/the-metadata-nobody-reads-how-a-government-portal-leaked-internal-user-15303|Government portal metadata leak]]).
## Defenses
- **Strip on ingest** in the publishing pipeline (`exiftool -all=` minimum); publish a sanitized copy, keep the original internally ([[raw/infosecwriteups.com/the-metadata-nobody-reads-how-a-government-portal-leaked-internal-user-15303|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 ([[raw/medium.com/your-files-are-talking-tracking-surveillance-and-osint-in-everyday-doc-14375|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.
## Related
- [[OSINT]]
- [[Image Geolocation]] · [[Domain and Infrastructure OSINT]] · [[OSINT Investigation Tradecraft]] · [[OSINT Tools]]
- [[Google Dorking]] · [[Reconnaissance]] · [[Hardcoded Secrets]]
## Sources
- [[raw/medium.com/your-files-are-talking-tracking-surveillance-and-osint-in-everyday-doc-14375|Your Files Are Talking: Tracking, Surveillance, and OSINT in Everyday Documents]]
- [[raw/medium.com/attributing-an-anonymised-docx-from-its-metadata-13573|Attributing an anonymised .docx from its metadata]]
- [[raw/infosecwriteups.com/the-metadata-nobody-reads-how-a-government-portal-leaked-internal-user-15303|The Metadata Nobody Reads: Government Portal Leak]]
- [[raw/medium.com/from-a-blank-pdf-to-a-manhattan-address-solving-the-counterintelligenc-15346|From a Blank PDF to a Manhattan Address]]
- [[raw/infosecwriteups.com/beyond-canarytokens-building-a-diy-document-tripwire-with-passive-os-f-10025|Beyond Canarytokens: DIY Document Tripwire]]
- [[raw/wiz.io/9-top-osint-tools-how-to-evaluate-them-3374|9 Top OSINT Tools & How to Evaluate Them (Wiz)]]
- [[raw/root-security.eu/git-repo-forensics-a-seven-phase-process-for-investigating-suspicious-11482|Git repo forensics: a seven-phase process]]
- [[raw/github.com/hashlookup-forensic-analyser-version-0-8-released-including-a-report-f-5188|hashlookup-forensic-analyser 0.8]]
- [[raw/medium.com/your-files-are-talking-tracking-surveillance-and-osint-in-everyday-doc-14516|Your Files Are Talking (duplicate capture)]]