Agent skill
analyzing-phishing-email-headers
Email headers contain critical metadata that reveals the true origin, routing path, and authentication status of emails. Analyzing these headers is a foundational skill for identifying phishing attemp
Install this agent skill to your Project
npx add-skill https://github.com/autohandai/community-skills/tree/main/analyzing-phishing-email-headers
SKILL.md
Analyzing Phishing Email Headers
Overview
Email headers contain critical metadata that reveals the true origin, routing path, and authentication status of emails. Analyzing these headers is a foundational skill for identifying phishing attempts, verifying sender authenticity, and gathering threat intelligence. This skill covers systematic extraction and interpretation of email headers using both manual techniques and automated tools.
Prerequisites
- Basic understanding of SMTP protocol and email delivery
- Familiarity with DNS records (MX, TXT, SPF, DKIM, DMARC)
- Python 3.8+ installed
- Access to email client that can export raw headers (Outlook, Gmail, Thunderbird)
Key Concepts
Critical Header Fields
- Received: Chain of mail servers the message passed through (read bottom to top)
- From / Return-Path / Reply-To: Sender identity fields (often spoofed)
- Authentication-Results: SPF, DKIM, DMARC verification outcomes
- X-Originating-IP: Original sender IP address
- Message-ID: Unique identifier; anomalies indicate spoofing
- X-Mailer / User-Agent: Email client used to compose the message
Red Flags in Headers
- Mismatched
FromandReturn-Pathdomains - SPF/DKIM/DMARC failures in
Authentication-Results - Suspicious
Receivedchains with unfamiliar relay servers X-Originating-IPfrom unexpected geographies- Missing or malformed
Message-ID - Unusual
X-Mailervalues (e.g., mass-mailing tools)
Implementation Steps
Step 1: Extract Raw Email Headers
Gmail: Open email -> Three dots -> "Show original"
Outlook: Open email -> File -> Properties -> Internet Headers
Thunderbird: View -> Message Source (Ctrl+U)
Step 2: Parse Headers with Python
Use the scripts/process.py script to automate header analysis including IP geolocation, authentication validation, and anomaly detection.
Step 3: Validate Authentication Chain
- Check SPF alignment: Does the sending IP match the domain's SPF record?
- Check DKIM signature: Is the cryptographic signature valid?
- Check DMARC policy: Does the message pass DMARC alignment?
Step 4: Trace Mail Route
- Read
Receivedheaders from bottom to top - Map each hop's IP to organization/location
- Identify unexpected relays or delays
Step 5: Correlate with Threat Intelligence
- Look up originating IP on AbuseIPDB, VirusTotal
- Check sending domain age on WHOIS
- Search for known phishing infrastructure patterns
Tools & Resources
- MXToolbox Header Analyzer: https://mxtoolbox.com/EmailHeaders.aspx
- Google Admin Toolbox: https://toolbox.googleapps.com/apps/messageheader/
- AbuseIPDB: https://www.abuseipdb.com/
- VirusTotal: https://www.virustotal.com/
- PhishTank: https://phishtank.org/
Validation
- Successfully parse headers from 3 different email providers
- Correctly identify authentication pass/fail status
- Accurately trace email routing path
- Detect at least 3 phishing indicators in a sample phishing email
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
mapping-mitre-attack-techniques
Maps observed adversary behaviors, security alerts, and detection rules to MITRE ATT&CK techniques and sub-techniques to quantify detection coverage and guide control prioritization. Use when building an ATT&CK-based coverage heatmap, tagging SIEM alerts with technique IDs, aligning security controls to adversary playbooks, or reporting threat exposure to executives. Activates for requests involving ATT&CK Navigator, Sigma rules, MITRE D3FEND, or coverage gap analysis.
hunting-for-spearphishing-indicators
Hunt for spearphishing campaign indicators across email logs, endpoint telemetry, and network data to detect targeted email attacks.
analyzing-malicious-url-with-urlscan
URLScan.io is a free service for scanning and analyzing suspicious URLs. It captures screenshots, DOM content, HTTP transactions, JavaScript behavior, and network connections of web pages in an isolat
implementing-zero-standing-privilege-with-cyberark
Deploy CyberArk Secure Cloud Access to eliminate standing privileges in hybrid and multi-cloud environments using just-in-time access with time, entitlement, and approval controls.
implementing-pam-for-database-access
Deploy privileged access management for database systems including Oracle, SQL Server, PostgreSQL, and MySQL. Covers session proxy configuration, credential vaulting, query auditing, dynamic credentia
detecting-t1003-credential-dumping-with-edr
Detect OS credential dumping techniques targeting LSASS memory, SAM database, NTDS.dit, and cached credentials using EDR telemetry, Sysmon process access monitoring, and Windows security event correlation.
Didn't find tool you were looking for?