← Back to HackThePDF

HACKTHEPDF // BLOG

PDF Security Insights, Forensics and Threat Intelligence

← Back to Blog PDF Phishing Attacks: How Attackers Use PDFs to Bypass Email Security | HackThePDF

PDF Phishing Attacks: How Attackers Use PDFs to Bypass Email Security

Most people know to be wary of suspicious emails. Links get checked, attachments get scanned, and yet somehow malicious PDFs still land in inboxes and fool users every day. The reason is simple: PDFs are trusted documents. They're business-critical. And most email security solutions give them a pass.

In this post, I'm breaking down how attackers use PDF files to run phishing campaigns, what techniques they employ, and how you can detect these threats before they trick your users.

Why Attackers Love PDFs for Phishing

PDFs occupy a strange security position. Unlike executable files (.exe, .scr, .bat), they're not flagged as dangerous by default. They're expected in business communication—invoices, contracts, receipts, applications. This trust is precisely what makes them attractive to threat actors.

Here's what's happening on the attacker side:

  • Email filters struggle with PDFs — Many security gateways scan attachment signatures for known malware but skip PDF content analysis unless specifically configured.
  • Users expect PDFs — A Word doc raises suspicion. A PDF looks legitimate. Users open it without second-guessing.
  • PDFs support rich content — Links, forms, JavaScript, embedded images—all usable for social engineering.
  • Obfuscation is easy — Attackers hide malicious URLs inside PDF metadata, annotations, or behind clickable images.

Common PDF Phishing Techniques

1. Fake Login Pages Embedded in PDF

Attackers create PDFs that display what looks like a corporate login page when opened. The user sees a familiar interface, enters credentials, and those credentials go straight to the attacker.

These PDFs often display:

  • Fake password expiry warnings
  • Document access requests
  • Fake invoice payment portals

2. Malicious Links in PDF Content

The simplest approach: embed a link in the PDF that points to a phishing site. The link might be disguised as:

  • "Click here to view document"
  • Shortened URLs
  • QR codes (which work even when the user is on mobile)

3. PDF Metadata Attacks

The /Author, /Title, or /Subject fields can contain malicious URLs. Some PDF viewers render these metadata fields as clickable links or display them prominently, making this a silent attack vector.

4. Annotation-Based Phishing

PDF annotations (the pop-up notes, comments, and links you can add) are frequently abused. Attackers insert fake comments that urge users to click embedded links or open "attached" files that are actually scripts.

5. Chained Attacks

Sometimes a PDF is just the first stage. The user clicks a link, gets directed to a page that:

  • Downloads additional malware
  • Collects browser fingerprints
  • Redirects to credential harvesting pages

Real-World Example

In recent phishing campaigns, attackers have sent PDFs claiming to be "overdue invoice" or "urgent payment required" notices. The PDFs display a convincing payment portal link. Users who click are taken to lookalike banking or accounting sites that steal login credentials.

How to Analyze Suspect PDF Files

When you receive a suspicious PDF, here's how to investigate it safely:

Step 1: Extract Text and Metadata

Use tools like pdfinfo or pdftotext to extract what's actually in the file:

pdfinfo suspicious.pdf
pdftotext suspicious.pdf - 

Look for:

  • Unexpected author or creator software
  • Suspicious URLs in the text or metadata
  • Hidden annotations

Step 2: Inspect Objects and Streams

The pdfid and peepdf tools give you a breakdown of PDF structures:

pdfid.py suspicious.pdf

Watch for elevated counts of:

  • /OpenAction — auto-executed scripts on open
  • /AA — additional actions
  • /JS — JavaScript presence
  • /URI — embedded URLs

Step 3: Check Embedded URLs

Use strings or a PDF parser to pull out all URLs:

strings suspicious.pdf | grep -E "http|https|www"

Cross-check every URL against threat intelligence feeds. Look for typosquatting domains, newly registered domains, or IP addresses instead of domain names.

Step 4: Sandbox Execution

When in doubt, open the PDF in an isolated VM or sandboxed environment. Monitor network traffic to see if it attempts to communicate with suspicious endpoints.

Defense Strategies

Here's what works against PDF phishing:

  • Disable JavaScript in PDF readers — Most users don't need it. Turning it off neutralizes many attacks.
  • Configure email gateways to scan PDF content — Not just attachment signatures, but links and embedded objects.
  • User training — Teach users to verify unexpected PDFs, especially those prompting for login or containing urgent requests.
  • URL reputation checking — Integrate link scanning that follows PDF-embedded URLs and evaluates the destination.
  • Monitor for credential phishing domains — Register lookalike domains of your organization to prevent spoofing.

Final Thoughts

PDF phishing works because PDFs are trusted by default. Attackers exploit this trust by embedding phishing content inside files that users expect to receive. The good news is that with the right tools and awareness, these attacks are detectable.

Always inspect PDFs before opening them, especially when they arrive unexpectedly. Check the metadata, extract the links, and verify the sender. In cybersecurity, a little paranoia goes a long way.

Need to analyze a suspicious PDF?

Use our PDF security tools at hackthepdf.com to inspect, analyze, and sanitize PDF files before opening them.