instructions.md Copy instructions---
name: detecting-spearphishing-with-email-gateway-b93d5daef378
description: Spearphishing targets specific individuals using personalized, researched content that bypasses generic spam
filters. Email security gateways (SEGs) like Microsoft Defender for Office 365, Proofpoint,
domain: cybersecurity
subdomain: phishing-defense
tags:
- phishing
- email-security
- social-engineering
- dmarc
- awareness
- spearphishing
- email-gateway
version: '1.0'
author: Krishna Kumar (xalgord)
license: Apache-2.0
nist_csf:
- PR.AT-01
- DE.CM-09
- RS.CO-02
- DE.AE-02
---
# 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
## Detection Gaps & Validation
- **SPF pass but spoofed display name:** a message from `attacker@gmail.com` with display name "CEO Jane Doe" passes SPF/DKIM for gmail.com - the SEG must run user/domain impersonation detection, not rely on auth alone.
- **Low-volume targeted mail evades reputation:** a handful of hand-crafted emails never trip volumetric spam scores - enable impersonation and anomaly/behavioral detection for VIPs.
- **URL detonation gaps:** time-of-click is defeated by delayed weaponization (benign at delivery, malicious later), geofenced/cloaked pages, and CAPTCHA gates - enable time-of-click rewriting AND newly-registered-domain blocking, not just delivery-time scan.
- **Attachment sandbox evasion:** password-protected archives, URL-only lures with no attachment, and VM/timing-aware payloads bypass detonation - set detonation timeout 60s+, attempt archive passwords from the body, and use dynamic delivery.
- **Lookalike/cousin domains** (`rn`->`m`, IDN homoglyphs) pass authentication for the attacker's own domain - add similarity matching against your domain and partners.
- **Validate + tune:** send test impersonation (VIP display-name spoof), a delayed-detonation URL, and a macro doc; confirm quarantine fires. Reduce FPs by allowlisting legitimate bulk senders and link-wrappers before tightening thresholds.
## 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
---
name: detecting-spearphishing-with-email-gateway-b93d5daef378
description: Spearphishing targets specific individuals using personalized, researched content that bypasses generic spam
filters. Email security gateways (SEGs) like Microsoft Defender for Office 365, Proofpoint,
domain: cybersecurity
subdomain: phishing-defense
tags:
- phishing
- email-security
- social-engineering
- dmarc
- awareness
- spearphishing
- email-gateway
version: '1.0'
author: Krishna Kumar (xalgord)
license: Apache-2.0
nist_csf:
- PR.AT-01
- DE.CM-09
- RS.CO-02
- DE.AE-02
---
# 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
## Detection Gaps & Validation
- **SPF pass but spoofed display name:** a message from `attacker@gmail.com` with display name "CEO Jane Doe" passes SPF/DKIM for gmail.com - the SEG must run user/domain impersonation detection, not rely on auth alone.
- **Low-volume targeted mail evades reputation:** a handful of hand-crafted emails never trip volumetric spam scores - enable impersonation and anomaly/behavioral detection for VIPs.
- **URL detonation gaps:** time-of-click is defeated by delayed weaponization (benign at delivery, malicious later), geofenced/cloaked pages, and CAPTCHA gates - enable time-of-click rewriting AND newly-registered-domain blocking, not just delivery-time scan.
- **Attachment sandbox evasion:** password-protected archives, URL-only lures with no attachment, and VM/timing-aware payloads bypass detonation - set detonation timeout 60s+, attempt archive passwords from the body, and use dynamic delivery.
- **Lookalike/cousin domains** (`rn`->`m`, IDN homoglyphs) pass authentication for the attacker's own domain - add similarity matching against your domain and partners.
- **Validate + tune:** send test impersonation (VIP display-name spoof), a delayed-detonation URL, and a macro doc; confirm quarantine fires. Reduce FPs by allowlisting legitimate bulk senders and link-wrappers before tightening thresholds.
## 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
Install this skill Download the complete skill package or use the command below.
Your agent Claude Code Codex OpenClaw Cursor Your shell macOS / Linux Windows PowerShell Run from your project’s root folder.
mkdir -p ".agents/skills" && archive=$(mktemp) && curl -fSL "https://megaaihub.com/downloads/detecting-spearphishing-with-email-gateway-b93d5daef378.zip" -o "$archive" && unzip -o "$archive" -d ".agents/skills" && rm -f "$archive" Copy install command Download skill ZIPOriginal SKILL.md, bundled files, source attribution, and license notices. Reload your agent if it does not discover the new skill.
LICENSE Apache-2.0
ACCESS Free / no account
AgentSkill.sh import seo-specialist
Download MarkdownSource & author Creator / publisher xalgord Project source Original project Source repository record
Open issues and PRs 0
Repository size ~60,575 KB
Default branch main
Created Mar 13, 2026
Repository updated Nov 3, 2026
Last push Nov 3, 2026
Language Go
License Apache-2.0
Topics ai-agent · ai-security · automation · autonomous-pentesting · bug-bounty · cybersecurity · ethical-hacking · golang · penetration-testing · pentest · pentesting-tools · recon
Repository-wide figures from GitHub, checked Nov 4, 2026. Stars are endorsements, not a Mega AI Hub quality rating. Repository size is GitHub’s estimate; a ZIP download may differ.
Classification Fields of work Marketing Sales Customer Support Roles Customer Success Manager Marketing Analyst PR & Communications SEO Specialist Support Agent Skill specialties Specialty not specified Tools & integrations Email (SMTP/IMAP) Microsoft Teams Country applicability Country not specified Creator / publisher xalgord Source catalog labels. Country labels describe applicability, not creator location.