detecting-spearphishing-with-email-gateway
Spearphishing targets specific individuals using personalized, researched content that bypasses generic spam filters. Email security gateways (SEGs) like Microsoft Defender for Office 365, Proofpoint,
Best use case
detecting-spearphishing-with-email-gateway is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Spearphishing targets specific individuals using personalized, researched content that bypasses generic spam filters. Email security gateways (SEGs) like Microsoft Defender for Office 365, Proofpoint,
Teams using detecting-spearphishing-with-email-gateway should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/detecting-spearphishing-with-email-gateway/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How detecting-spearphishing-with-email-gateway Compares
| Feature / Agent | detecting-spearphishing-with-email-gateway | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Spearphishing targets specific individuals using personalized, researched content that bypasses generic spam filters. Email security gateways (SEGs) like Microsoft Defender for Office 365, Proofpoint,
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Detecting 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 1. **Reputation filtering**: IP/domain/URL reputation scoring 2. **Authentication checks**: SPF, DKIM, DMARC validation 3. **Content analysis**: NLP-based analysis of email body 4. **Impersonation detection**: Display name and domain similarity matching 5. **URL analysis**: Real-time URL detonation and redirect following 6. **Attachment sandboxing**: Behavioral analysis of attachments in isolated environments 7. **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
Related Skills
testing-for-email-header-injection
Test web application email functionality for SMTP header injection vulnerabilities that allow attackers to inject additional email headers, modify recipients, and abuse contact forms for spam relay.
securing-api-gateway-with-aws-waf
Securing API Gateway endpoints with AWS WAF by configuring managed rule groups for OWASP Top 10 protection, creating custom rate limiting rules, implementing bot control, setting up IP reputation filtering, and monitoring WAF metrics for security effectiveness.
investigating-phishing-email-incident
Investigates phishing email incidents from initial user report through header analysis, URL/attachment detonation, impacted user identification, and containment actions using SOC tools like Splunk, Microsoft Defender, and sandbox analysis platforms. Use when a reported phishing email requires full incident investigation to determine scope and impact.
implementing-proofpoint-email-security-gateway
Deploy and configure Proofpoint Email Protection as a secure email gateway to detect and block phishing, malware, BEC, and spam before messages reach user inboxes.
implementing-email-sandboxing-with-proofpoint
Email sandboxing detonates suspicious attachments and URLs in isolated environments to detect zero-day malware and evasive phishing payloads. Proofpoint Targeted Attack Protection (TAP) is an industry
implementing-dmarc-dkim-spf-email-security
SPF, DKIM, and DMARC form the three pillars of email authentication. Together they prevent domain spoofing, validate message integrity, and define policies for handling unauthenticated mail. Proper im
implementing-api-gateway-security-controls
Implements security controls at the API gateway layer including authentication enforcement, rate limiting, request validation, IP allowlisting, TLS termination, and threat protection. The engineer configures API gateways (Kong, AWS API Gateway, Azure APIM, Apigee) to act as a centralized security enforcement point that validates, throttles, and monitors all API traffic before it reaches backend services. Activates for requests involving API gateway security, API management security, gateway authentication, or centralized API protection.
hunting-for-spearphishing-indicators
Hunt for spearphishing campaign indicators across email logs, endpoint telemetry, and network data to detect targeted email attacks.
detecting-wmi-persistence
Detect WMI event subscription persistence by analyzing Sysmon Event IDs 19, 20, and 21 for malicious EventFilter, EventConsumer, and FilterToConsumerBinding creation.
detecting-typosquatting-packages-in-npm-pypi
Detects typosquatting attacks in npm and PyPI package registries by analyzing package name similarity using Levenshtein distance and other string metrics, examining publish date heuristics to identify recently created packages mimicking established ones, and flagging download count anomalies where suspicious packages have disproportionately low usage compared to their legitimate targets. The analyst queries the PyPI JSON API and npm registry API to gather package metadata for automated comparison. Activates for requests involving package typosquatting detection, dependency confusion analysis, malicious package identification, or software supply chain threat hunting in package registries.
detecting-t1548-abuse-elevation-control-mechanism
Detect abuse of elevation control mechanisms including UAC bypass, sudo exploitation, and setuid/setgid manipulation by monitoring registry modifications, process elevation flags, and unusual parent-child process relationships.
detecting-t1055-process-injection-with-sysmon
Detect process injection techniques (T1055) including classic DLL injection, process hollowing, and APC injection by analyzing Sysmon events for cross-process memory operations, remote thread creation, and anomalous DLL loading patterns.