
Detecting Spearphishing
FreeEnhance email security against targeted phishing attacks.
Free · Opens the source repo
What Detecting Spearphishing does
Detecting Spearphishing with Email Gateway is a specialized skill designed for cybersecurity professionals focused on enhancing email security. This skill provides detailed guidance on configuring email security gateways (SEGs) like Microsoft Defender for Office 365, Proofpoint, Mimecast, and Barracuda to effectively detect and block spearphishing attempts. Spearphishing is a particularly insidious form of phishing that targets specific individuals with personalized content, often bypassing generic spam filters. By leveraging advanced detection techniques such as impersonation protection, URL rewriting, and attachment sandboxing, this skill enables users to harden their email gateways against these targeted attacks.
The skill outlines a structured workflow for implementing various protective measures, including configuring impersonation settings to safeguard high-profile individuals, enabling URL protection to detonate links in real-time, and setting up attachment sandboxing to analyze potentially harmful documents. Users can also create custom detection rules tailored to their organization's specific threat landscape, enhancing their ability to respond to spearphishing incidents effectively. The skill is particularly useful for Security Operations Center (SOC) analysts and IT security teams seeking to validate their security monitoring coverage and develop threat-hunting queries.
Prerequisites for using this skill include access to the email security gateway admin console and a solid understanding of email flow architecture, as well as familiarity with authentication protocols like SPF, DKIM, and DMARC. By following the outlined steps, users can implement robust defenses against spearphishing and ensure their organization's email security posture is significantly strengthened.
When to use it
Use this skill when investigating spearphishing incidents or when configuring email gateways to enhance protection against targeted phishing attacks.
When not to use it
This skill may not be suitable for organizations without an established email security gateway or those unfamiliar with email authentication protocols.
What you can build with it
Incident Investigation
Use this skill to analyze and respond to suspected spearphishing incidents by configuring detection measures in your email gateway.
Security Monitoring Validation
Validate your organization's email security monitoring coverage against spearphishing techniques using the outlined workflows.
Custom Rule Development
Develop and implement custom detection rules to enhance your email gateway's ability to identify and block spearphishing attempts.
How to install Detecting Spearphishing
View source1. Install with the skills CLI
npx skills add mukul975/anthropic-cybersecurity-skills/detecting-spearphishing-with-email-gateway --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by mukul975Detecting Spearphishing with Email Gateway
Overview
Spearphishing targets specific individuals using personalized, researched content that bypasses generic spam filters. Email security gateways (SEGs) like Microsoft Defender for Office 365, Proofpoint, Mimecast, and Barracuda provide advanced detection capabilities including behavioral analysis, URL detonation, attachment sandboxing, and impersonation detection. This skill covers configuring these gateways to detect and block targeted phishing attacks.
When to Use
- When investigating security incidents that require detecting spearphishing with email gateway
- When building detection rules or threat hunting queries for this domain
- When SOC analysts need structured procedures for this analysis type
- When validating security monitoring coverage for related attack techniques
Prerequisites
- Access to email security gateway admin console
- Understanding of email flow architecture (MX records, transport rules)
- Familiarity with SPF/DKIM/DMARC authentication
- Knowledge of common spearphishing techniques and pretexts
Key Concepts
Spearphishing Characteristics
- Targeted recipients: Specific individuals, often executives or finance staff
- Researched pretexts: References to real projects, colleagues, or events
- Impersonation: Spoofs trusted senders (CEO, vendor, partner)
- Low volume: Few emails to avoid pattern-based detection
- Urgent tone: Creates pressure to act quickly
Gateway Detection Layers
- Reputation filtering: IP/domain/URL reputation scoring
- Authentication checks: SPF, DKIM, DMARC validation
- Content analysis: NLP-based analysis of email body
- Impersonation detection: Display name and domain similarity matching
- URL analysis: Real-time URL detonation and redirect following
- Attachment sandboxing: Behavioral analysis of attachments in isolated environments
- Behavioral analytics: Anomaly detection in communication patterns
Workflow
Step 1: Configure Impersonation Protection
Microsoft Defender for Office 365:
Security > Anti-phishing policies > Impersonation settings
- Enable user impersonation protection for VIPs
- Enable domain impersonation protection
- Add protected users (CEO, CFO, HR Director)
- Set action: Quarantine message
Proofpoint:
Email Protection > Impostor Classifier
- Enable display name spoofing detection
- Configure lookalike domain detection
- Set Impostor threshold sensitivity
Step 2: Configure URL Protection
- Enable Safe Links / URL rewriting
- Enable time-of-click URL detonation
- Block newly registered domains (< 30 days)
- Enable URL redirect chain following
Step 3: Configure Attachment Sandboxing
- Enable Safe Attachments / attachment sandboxing
- Configure dynamic delivery (deliver body, hold attachments)
- Set sandbox detonation timeout to 60+ seconds
- Block macro-enabled Office documents from external senders
Step 4: Create Custom Detection Rules
Use the scripts/process.py to analyze email gateway logs, identify spearphishing patterns, and generate custom detection rules.
Step 5: Configure Alert and Response Actions
- Real-time alerts for impersonation attempts
- Automatic quarantine for high-confidence detections
- User notification with safety tips
- Integration with SIEM for correlation
Tools & Resources
- Microsoft Defender for Office 365: https://security.microsoft.com
- Proofpoint Email Protection: https://www.proofpoint.com/us/products/email-security
- Mimecast Email Security: https://www.mimecast.com/products/email-security/
- Barracuda Email Protection: https://www.barracuda.com/products/email-protection
Validation
- Impersonation protection correctly identifies spoofed VIP display names
- URL detonation catches malicious links in test phishing emails
- Attachment sandboxing detects weaponized documents
- Custom rules trigger on known spearphishing patterns
- SIEM integration receives gateway alerts
Frequently asked questions about Detecting Spearphishing
Similar skills
Asset Criticality Scoring for Vulns
Prioritize vulnerabilities based on asset criticality.
Performing Alert Triage with Elastic SIEM
Streamline alert triage processes in Elastic Security.
Active Directory Vulnerability Assessment
Secure your Active Directory with comprehensive assessments.
Active Directory Investigation
Streamline your Active Directory compromise investigations.
Parsing Artifacts with Eric Zimmerman Tools
Efficiently parse Windows forensic artifacts for analysis.
Operationalizing MISP Threat Feeds
Enhance threat detection with curated MISP feeds.
