Phishing Email Investigation
Systematic analysis of suspicious emails to identify phishing campaigns, extract indicators of compromise (IoCs), and classify threats.
Email Header Analysis
Understanding email headers is crucial for tracing the origin and authenticity of messages
Identify the Originating IP
X-Originating-IP, X-Sender-IP, or first Received header reveals the true source of the email, which may differ from the claimed sender.
Use
MXToolbox
Trace Email Path
Received: headers shows the email's journey through mail servers, helps identify relay points and potential spoofing
Mail server hostnamesIP addresses of relay serversTimestamps of each hop
grep -i "^Received:" email.emlAnalyze Sender Information
From address: Who the email claims to be fromReply-To address: Where responses will actually go (often different in phishing)Return-Path: Bounce address for undeliverable emails
Red flags
Mismatched From/Reply-To domains
Suspicious or free email domains for business emails
Typosquatting domains
Email Authentication Analysis
SPF (Sender Policy Framework)
Verifies the sending server is authorized for the domain.
grep -i "received-spf\|spf=" email.emlDKIM (DomainKeys Identified Mail)
Cryptographic signature verifying email hasn't been tampered with.
grep -i "dkim" email.emlDMARC (Domain-based Message Authentication)
Combines
SPFandDKIMwith policy enforcement.
grep -i "dmarc" email.emlThe Authentication-Results: header usually contains all three in one place, making it the easiest to check:
grep -A 5 -i "Authentication-Results:" email.eml | grep -oP "(spf|dkim|dmarc)=\w+"Passing authentication doesn't guarantee legitimacy! Attackers can set up proper authentication for their malicious domains.
Email Content Analysis
Subject Line & Body Analysis
Red flags:
Urgent language ("URGENT", "IMMEDIATE ACTION REQUIRED")
Threats (account suspension, legal action)
Time pressure ("within 24 hours")
Generic greetings ("Dear Customer" vs. your actual name)
Poor grammar/spelling
URL Analysis
Extract all URLs from the email body
Check for:
Domain inconsistencies (claimed company vs. actual domain)
URL shorteners (bit.ly, tinyurl)
Typosquatting
Suspicious paths with random characters
HTTPS vs HTTP
grep -oP 'https?://[^\s<>"]+|mailto:[^\s<>"]+' email.emlBrand Impersonation Detection
Identify company/organization being impersonated
Compare against legitimate communications
Check for logo inconsistencies or missing branding
Attachment Analysis
Identify Attachments
Location in
.emlfiles: Look forContent-Type: application/*sectionsEncoding: Usually
base64encodedExtract: Decode
base64to get actual file
File Metadata Analysis
Filename: Check for suspicious extensions or double extensions.pdf.exe,.doc.bat,.invoice.js
MIME type: Verify matches the extensionFile size: Unusually small/large for claimed type
Generate File Hashes
base64 -d attachment.b64 > file.zipmd5sum file.zipsha1sum file.zipsha256sum file.zipInspect Archive Contents
Executable extensions:
.exe,.bat,.cmd,.ps1,.vbs,.jsHidden file extensions
Macros in documents:
.docm,.xlsm,.pptm
Threat Classification & Intelligence
MITRE ATT&CK Mapping
T1566.001 - Phishing: Spearphishing Attachment
T1566.002 - Phishing: Spearphishing Link
T1204.001 - User Execution: Malicious Link
T1204.002 - User Execution: Malicious File
T1036 - Masquerading (file/extension spoofing)
T1027 - Obfuscated Files or Information
T1598 - Phishing for InformationIndicators of Compromise (IOCs)
IP addresses
Email addresses
Domains
File hashes
File names
URLs
Subject lines / patterns
Threat Actor Attribution
Search
IOCsin threat intelligence platformsLook for known campaigns
Check for
TTPsmatching known groups
Tools & Resources
Email Analysis Tools
https://mxtoolbox.com/EmailHeaders.aspxhttps://toolbox.googleapps.com/apps/messageheader/https://mha.azurewebsites.net/URL/Domain Analysis
https://www.virustotal.comhttps://urlscan.iohttps://talosintelligence.com/File Analysis
https://www.hybrid-analysis.com/https://www.joesandbox.com/https://bazaar.abuse.ch/Threat Intelligence
https://attack.mitre.org/https://otx.alienvault.com/https://threatfox.abuse.ch/Last updated