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.

Works with

Claude CodeCursorClineWindsurfCodexGooseGitHub CopilotZed

0

total installs

0

this week

8.6K

GitHub stars

0

upvotes

Install Skill

Run in your terminal

$npx skills install mukul975/Anthropic-Cybersecurity-Skills/investigating-phishing-email-incident

0

installs

0

this week

8.6K

stars

Installation Guide

How to use investigating-phishing-email-incident on Cursor

AI-first code editor with Composer

1

Prerequisites

Before installing skills in Cursor, ensure your development environment meets these requirements:

  • Cursor installed and configured on your machine
  • Node.js 16+ with npm — verify with node --version
  • Active project directory where you want to add investigating-phishing-email-incident
2

Run the install command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills install mukul975/Anthropic-Cybersecurity-Skills/investigating-phishing-email-incident

Fetches investigating-phishing-email-incident from mukul975/Anthropic-Cybersecurity-Skills and configures it for Cursor.

3

Select Cursor when prompted

The CLI shows a list of agents. Use arrow keys and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ────────────────
│ · Cline · Codex · Goose · Windsurf
│ ●Cursor(selected)
│ · Cursor · Aider · Continue
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/investigating-phishing-email-incident

Restart Cursor to activate investigating-phishing-email-incident. Access via /investigating-phishing-email-incident in your agent's command palette.

Security Notice

We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.

Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.

Documentation

name
investigating-phishing-email-incident
description
'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. '
domain
cybersecurity
subdomain
soc-operations
tags
- soc - phishing - incident-response - email-security - splunk - defender - sandbox
mitre_attack
- T1566.001 - T1566.002 - T1204.001 - T1598.003
version
'1.0'
author
mahipal
license
Apache-2.0
nist_csf
- DE.CM-01 - DE.AE-02 - RS.MA-01 - DE.AE-06

Investigating Phishing Email Incident

When to Use

Use this skill when:

  • A user reports a suspicious email via the phishing report button or helpdesk ticket
  • Email security gateway flags a message that bypassed initial filters
  • Automated detection identifies credential harvesting URLs or malicious attachments
  • A phishing campaign targeting the organization requires scope assessment

Do not use for spam or marketing emails without malicious intent — route those to email administration for filter tuning.

Prerequisites

  • Access to email gateway logs (Proofpoint, Mimecast, or Microsoft Defender for Office 365)
  • Splunk or SIEM with email log ingestion (O365 Message Trace, Exchange tracking logs)
  • Sandbox access (Any.Run, Joe Sandbox, or Hybrid Analysis) for URL/attachment detonation
  • Microsoft Graph API or Exchange Admin Center for email search and purge operations
  • URLScan.io and VirusTotal API keys

Workflow

Step 1: Extract and Analyze Email Headers

Obtain the full email headers (.eml file) from the reported message:

import email
from email import policy

with open("phishing_sample.eml", "rb") as f:
    msg = email.message_from_binary_file(f, policy=policy.default)

# Extract key headers
print(f"From: {msg['From']}")
print(f"Return-Path: {msg['Return-Path']}")
print(f"Reply-To: {msg['Reply-To']}")
print(f"Subject: {msg['Subject']}")
print(f"Message-ID: {msg['Message-ID']}")
print(f"X-Originating-IP: {msg['X-Originating-IP']}")

# Parse Received headers (bottom-up for true origin)
for header in reversed(msg.get_all('Received', [])):
    print(f"Received: {header[:120]}")

# Check authentication results
print(f"Authentication-Results: {msg['Authentication-Results']}")
print(f"DKIM-Signature: {msg.get('DKIM-Signature', 'NONE')[:80]}")

Key checks:

  • SPF: Does Return-Path domain match sending IP? Look for spf=pass or spf=fail
  • DKIM: Is the signature valid? dkim=pass confirms the email was not modified in transit
  • DMARC: Does the From domain align with SPF/DKIM domains? dmarc=fail indicates spoofing

Step 2: Analyze URLs and Attachments

URL Analysis:

import requests

# Submit URL to URLScan.io
url_to_scan = "https://evil-login.example.com/office365"
response = requests.post(
    "https://urlscan.io/api/v1/scan/",
    headers={"API-Key": "YOUR_KEY", "Content-Type": "application/json"},
    json={"url": url_to_scan, "visibility": "unlisted"}
)
scan_id = response.json()["uuid"]
print(f"Scan URL: https://urlscan.io/result/{scan_id}/")

# Check VirusTotal for URL reputation
import vt
client = vt.Client("YOUR_VT_API_KEY")
url_id = vt.url_id(url_to_scan)
url_obj = client.get_object(f"/urls/{url_id}")
print(f"VT Score: {url_obj.last_analysis_stats}")
client.close()

Attachment Analysis:

import hashlib

# Calculate file hashes
with open("attachment.docx", "rb") as f:
    content = f.read()
    md5 = hashlib.md5(content).hexdigest()
    sha256 = hashlib.sha256(content).hexdigest()

print(f"MD5: {md5}")
print(f"SHA256: {sha256}")

# Submit to MalwareBazaar for lookup
response = requests.post(
    "https://mb-api.abuse.ch/api/v1/",
    data={"query": "get_info", "hash": sha256}
)
print(response.json()["query_status"])

Submit to sandbox (Any.Run or Joe Sandbox) for dynamic analysis of macros, PowerShell execution, and C2 callbacks.

Step 3: Determine Campaign Scope

Search for all recipients of the same phishing email in Splunk:

index=email sourcetype="o365:messageTrace"
(SenderAddress="[email protected]" OR Subject="Urgent: Password Reset Required"
 OR MessageId="<[email protected]>")
earliest=-7d
| stats count by RecipientAddress, DeliveryStatus, MessageTraceId
| sort - count

Alternatively, use Microsoft Graph API:

import requests

headers = {"Authorization": f"Bearer {access_token}"}
params = {
    "$filter": f"subject eq 'Urgent: Password Reset Required' and "
               f"receivedDateTime ge 2024-03-14T00:00:00Z",
    "$select": "sender,toRecipients,subject,receivedDateTime",
    "$top": 100
}
response = requests.get(
    "https://graph.microsoft.com/v1.0/users/[email protected]/messages",
    headers=headers, params=params
)
messages = response.json()["value"]
print(f"Found {len(messages)} matching messages")

Step 4: Identify Impacted Users (Who Clicked)

Check proxy/web logs for users who visited the phishing URL:

index=proxy dest="evil-login.example.com" earliest=-7d
| stats count, values(action) AS actions, latest(_time) AS last_access
  by src_ip, user
| lookup asset_lookup_by_cidr ip AS src_ip OUTPUT owner, category
| sort - count
| table user, src_ip, owner, actions, count, last_access

Check if credentials were submitted (POST requests to phishing domain):

index=proxy dest="evil-login.example.com" http_method=POST earliest=-7d
| stats count by src_ip, user, url, status

Step 5: Containment Actions

Purge emails from all mailboxes:

# Microsoft 365 Compliance Search and Purge
New-ComplianceSearch -Name "Phishing_Purge_2024_0315" `
    -ExchangeLocation All `
    -ContentMatchQuery '(From:[email protected]) AND (Subject:"Urgent: Password Reset Required")'

Start-ComplianceSearch -Identity "Phishing_Purge_2024_0315"

# After search completes, execute purge
New-ComplianceSearchAction -SearchName "Phishing_Purge_2024_0315" -Purge -PurgeType SoftDelete

Block indicators:

  • Add sender domain to email gateway block list
  • Add phishing URL domain to web proxy block list
  • Add attachment hash to endpoint detection block list
  • Create DNS sinkhole entry for phishing domain

Reset compromised credentials:

# Force password reset for impacted users
$impactedUsers = @("[email protected]", "[email protected]")
foreach ($user in $impactedUsers) {
    Set-MsolUserPassword -UserPrincipalName $user -ForceChangePassword $true
    Revoke-AzureADUserAllRefreshToken -ObjectId (Get-AzureADUser -ObjectId $user).ObjectId
}

Step 6: Document and Report

Create incident report with full timeline, IOCs, impacted users, and remediation actions taken.

| makeresults
| eval incident_id="PHI-2024-0315",
       reported_time="2024-03-15 09:12:00",
       sender="attacker@evil-domain[.]com",
       subject="Urgent: Password Reset Required",
       url="hxxps://evil-login[.]example[.]com/office365",
       recipients_count=47,
       clicked_count=5,
       credentials_submitted=2,
       emails_purged=47,
       passwords_reset=2,
       domains_blocked=1,
       disposition="True Positive - Credential Phishing Campaign"
| table incident_id, reported_time, sender, subject, url, recipients_count,
        clicked_count, credentials_submitted, emails_purged, passwords_reset, disposition

Key Concepts

TermDefinition
SPF (Sender Policy Framework)DNS TXT record specifying which mail servers are authorized to send on behalf of a domain
DKIMDomainKeys Identified Mail — cryptographic signature proving email content was not altered in transit
DMARCDomain-based Message Authentication, Reporting and Conformance — policy combining SPF and DKIM alignment
Credential HarvestingPhishing technique using fake login pages to capture username/password combinations
Business Email Compromise (BEC)Social engineering attack using compromised or spoofed executive email for financial fraud
Message TraceO365/Exchange log showing email routing, delivery status, and filtering actions for forensic analysis

Tools & Systems

  • Microsoft Defender for Office 365: Email security platform with Safe Links, Safe Attachments, and Threat Explorer for investigation
  • URLScan.io: Free URL analysis service capturing screenshots, DOM, cookies, and network requests
  • Any.Run: Interactive sandbox for detonating malicious files and URLs with real-time behavior analysis
  • Proofpoint TAP: Targeted Attack Protection dashboard showing clicked URLs and delivered threats per user
  • PhishTool: Dedicated phishing email analysis platform automating header parsing and IOC extraction

Common Scenarios

  • Credential Phishing: Fake O365 login page — check proxy for POST requests, force password resets for submitters
  • Macro-Enabled Document: Word doc with VBA macro — sandbox shows PowerShell download cradle, check endpoints for execution
  • QR Code Phishing (Quishing): Email contains QR code linking to credential harvester — decode QR, submit URL to sandbox
  • Thread Hijacking: Attacker uses compromised mailbox to reply in existing threads — check for impossible travel or new inbox rules
  • Voicemail Phishing: Fake voicemail notification with HTML attachment — analyze attachment for redirect chains

Output Format

PHISHING INCIDENT REPORT — PHI-2024-0315
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Reported:     2024-03-15 09:12 UTC by jsmith (Finance)
Sender:       attacker@evil-domain[.]com (SPF: FAIL, DKIM: NONE, DMARC: FAIL)
Subject:      Urgent: Password Reset Required
Payload:      Credential harvesting URL

IOCs:
  URL:        hxxps://evil-login[.]example[.]com/office365
  Domain:     evil-login[.]example[.]com (registered 2024-03-14, Namecheap)
  IP:         185.234.xx.xx (VT: 12/90 malicious)

Scope:
  Recipients: 47 users across Finance and HR departments
  Clicked:    5 users visited phishing URL
  Submitted:  2 users entered credentials (confirmed via POST in proxy logs)

Containment:
  [DONE] 47 emails purged via Compliance Search
  [DONE] Domain blocked on proxy and DNS sinkhole
  [DONE] 2 user passwords reset, sessions revoked
  [DONE] MFA enforced for both compromised accounts
  [DONE] Inbox rules audited — no forwarding rules found

Status:       RESOLVED — No evidence of lateral movement post-compromise

List & Monetize Your Skill

Submit your Claude Code skill and start earning

Get started →

Use Cases

Task Automation & Efficiency

Automate repetitive workflows and reduce manual effort

Example

Generate reports, summarize documents, draft communications

Save 3-5 hours per week on routine tasks

Knowledge Enhancement

Learn new skills, understand complex topics, get expert guidance

Example

Explain concepts, provide examples, suggest learning resources

Accelerate learning and skill development by 2x

Quality Improvement

Enhance output quality through reviews, suggestions, and refinements

Example

Review drafts, suggest improvements, catch errors

Improve work quality by 30-40% with less effort

Implementation Guide

Prerequisites

  • Claude Desktop or compatible AI client with skill support
  • Clear understanding of task or problem to solve
  • Willingness to iterate and refine outputs

Time Estimate

15-45 minutes depending on use case complexity

Steps

  1. 1Install skill using provided installation command
  2. 2Test with simple use case relevant to your work
  3. 3Evaluate output quality and relevance
  4. 4Iterate on prompts to improve results
  5. 5Integrate into regular workflow if valuable

Common Pitfalls

  • Expecting perfect results without iteration
  • Not providing enough context in prompts
  • Using skill for tasks outside its intended scope
  • Accepting outputs without review and validation

Best Practices

✓ Do

  • +Start with clear, specific prompts
  • +Provide relevant context and constraints
  • +Review and refine all outputs before using
  • +Iterate to improve output quality
  • +Document successful prompt patterns

✗ Don't

  • Don't use without understanding skill limitations
  • Don't skip validation of outputs
  • Don't share sensitive information in prompts
  • Don't expect skill to replace human judgment

💡 Pro Tips

  • Be specific about desired format and style
  • Ask for multiple options to choose from
  • Request explanations to understand reasoning
  • Combine AI efficiency with human expertise

When to Use This

✓ Use when

Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.

✗ Avoid when

Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.

Learning Path

  1. 1Familiarize yourself with skill capabilities and limitations
  2. 2Start with low-risk, non-critical tasks
  3. 3Progress to more complex and valuable use cases
  4. 4Build expertise through regular use and experimentation

Related Skills

Reviews

4.558 reviews
  • D
    Dhruvi JainDec 28, 2024

    Solid pick for teams standardizing on skills: investigating-phishing-email-incident is focused, and the summary matches what you get after install.

  • C
    Charlotte AgarwalDec 28, 2024

    Registry listing for investigating-phishing-email-incident matched our evaluation — installs cleanly and behaves as described in the markdown.

  • L
    Li TaylorDec 28, 2024

    Useful defaults in investigating-phishing-email-incident — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • A
    Alexander MensahDec 12, 2024

    investigating-phishing-email-incident reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Z
    Zara RahmanDec 8, 2024

    Registry listing for investigating-phishing-email-incident matched our evaluation — installs cleanly and behaves as described in the markdown.

  • H
    Henry TorresNov 27, 2024

    investigating-phishing-email-incident is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • L
    Li GhoshNov 27, 2024

    Useful defaults in investigating-phishing-email-incident — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • O
    OshnikdeepNov 19, 2024

    We added investigating-phishing-email-incident from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • T
    Tariq IyerNov 19, 2024

    Useful defaults in investigating-phishing-email-incident — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • K
    Kaira ChenNov 19, 2024

    Registry listing for investigating-phishing-email-incident matched our evaluation — installs cleanly and behaves as described in the markdown.

showing 1-10 of 58

1 / 6

Discussion

Comments — not star reviews
  • No comments yet — start the thread.