PISA Pakistan — Community CERT

← ⚙️ Cyber Threat Intelligence Foundations

42. Email Header Analysis for BEC Intelligence in Pakistani Organizations

⏱ 9 min

Email Header Analysis for BEC Intelligence in Pakistani Organizations

Business Email Compromise Landscape in Pakistan

BEC campaigns frequently impersonate senior executives or vendors, leveraging the trust placed in familiar email domains. Recent WhatsApp forwards have spread fraudulent payment instructions that appear to originate from reputable Pakistani banks, underscoring the need for robust header forensics.

Anatomy of a Malicious Email Header

  • Return‑Path: Shows the actual sender address (often differs from the display name).
  • Received‑Path: Lists every mail relay; irregularities indicate spoofing.
  • Authentication‑Results: SPF, DKIM, and DMARC results reveal whether the sender’s domain is legitimately authorized.

Open‑Source Tools for Header Parsing

  • Use the mailheader command (mailheader -f <raw_header>) to extract structured fields.
  • Python’s email library can automate extraction of Return‑Path, Authentication‑Results, and X‑Originating‑IP.
  • Header Analyzer in Mimecast (free tier) visualizes hop chains and flags anomalies.

Correlating with WHOIS, SPF, DKIM, and DMARC

  1. WHOIS lookup on the sender domain to detect newly registered or privacy‑guarded domains.
  2. SPF check (dig txt domain) ensures the sending IP is listed in the domain’s SPF record.
  3. DKIM verification using opendkim‑testmsg to confirm cryptographic signatures.
  4. DMARC policy (dig txt _dmarc.domain) reveals disposition instructions (p=reject/quarantine).

Sharing Findings via MISP and theHive

  • Create a MISP event with attribute type "BEC-campaign" and populate fields: source email, forged domain, and impersonated entity.
  • Feed the same IOC into theHive as an observable linked to an active incident case.

Do / Don't

  • Do: Examine every Received header for mismatched timestamps or IP ranges.
  • Don't: Trust the display name alone; always verify the underlying domain.

Takeaway

Use the mailheader tool to parse a suspicious email and record the Return‑Path and Authentication‑Results in MISP. Report fraudulent emails impersonating Pakistani banks to the NCCIA helpline 1799 and the SBP consumer protection desk.

← PrevNext →