
Detects CanaryTokens in Office docs and PDFs (docx, xlsx, pptx, pdf) without triggering alerts
Detect suspicious URLs (including CanaryTokens) inside Microsoft Office documents and PDFs.
Supported formats:
CanaryTokens an HoneyTokens (and other tracking or malicious URLs) are often embedded in documents to signal when a file is opened or when an external resource is fetched. This tool performs static inspection only: it reads file contents and looks for embedded URLs without opening the document in Office/Acrobat and without making any network requests.
http:// and https:// URLs.schemas.openxmlformats.orgschemas.microsoft.compurl.orgw3.orgThe scanner searches for URLs in:
/URI(...))stream ... endstream) by attempting Flate/deflate decompressionRun against a single file:
python CanaryTokenScanner.py /path/to/document.pdf
Run against a directory (recursive):
python CanaryTokenScanner.py /path/to/folder
Example output:
URL Found in /path/to/file.docx:
https://example.com/track/abc123
The file /path/to/file.docx is suspicious.

This script is intended for educational and security testing purposes only. Use it responsibly and in compliance with applicable laws and organizational policies. The author(s) assume no liability for misuse or for actions taken based on the output of this tool.