mcpField
E
email-security

email-security

github.com/uphiagoSecurity1.3k42 installsUpdated 8w ago
Repository

About email-security

A security-testing skill for reviewing a domain’s DMARC, SPF, and DKIM records and interpreting their implications for email spoofing. It includes DNS checks, SMTP relay tests, and guidance for verifying findings using message headers.

Key features

  1. 01Checks DMARC, SPF, and DKIM records
  2. 02Interprets email authentication settings
  3. 03Tests SMTP relay availability
  4. 04Explains relevant message headers
  5. 05Lists common DNS and selector pitfalls

Use cases

  1. 01Reviewing email security during reconnaissance
  2. 02Assessing a domain’s email spoofing exposure
  3. 03Checking whether SMTP relays accept test connections
  4. 04Verifying authentication results in message headers

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/uphiago/recon-skills --skill email-security

After installing, type/email-securityin Claude Code to confirm it loaded.

Details

From the project README

Email Security -- DMARC, SPF, DKIM

When to Use

  • During passive reconnaissance (Phase 1)
  • After initial DNS enumeration
  • DMARC p=none means the domain can be totally spoofed
  • Critical for identifying phishing/business email compromise risks

DMARC/SPF/DKIM Check Commands

# SPF
dig +short TXT $target | grep "v=spf1"

# DMARC
dig +short TXT _dmarc.$target

# DKIM (common selector: google)
dig +short TXT google._domainkey.$target

# MX
dig +short MX $target

Interpreting Results

ConfigMeaningRisk
v=spf1 ~all (softfail)SPF suggests blocking but doesnt enforceSpoofed emails may pass
v=spf1 ?all (neutral)SPF does nothingTotally permissive
v=spf1 include:amazonses.com ~allSES can send as domainAny AWS SES account can spoof
v=DMARC1; p=noneDMARC disabledZero spoofing protection
v=DMARC1; p=quarantineFailed emails go to spamPartial protection
v=DMARC1; p=rejectFailed emails rejectedFull protection
DKIM missingNo cryptographic signatureEmail can be forged

Email Spoofing via SMTP

# Test SMTP relay
timeout 3 bash -c 'exec 3<>/dev/tcp/TARGET/25; head -1 <&3'

# Send spoofed email via open relay (swaks)
swaks --to [email protected] --from [email protected]   --server TARGET --body "Spoofed email"

Headers That Indicate Security Level

HeaderValueMeaning
Authentication-Resultsspf=passSPF passed
Authentication-Resultsspf=failSPF failed
Authentication-Resultsdmarc=passDMARC passed
Authentication-Resultsdmarc=failDMARC failed
Authentication-Resultsdkim=passDKIM passed
Received-SPFPassSender authorized
Received-SPFSoftfailSender not fully authorized
Received-SPFFailSender not authorized
ARC-Authentication-ResultsAuthentication chain

AWS SES Spoofing (When SPF includes amazonses.com)

With v=spf1 include:amazonses.com ~all:

  1. Create AWS account
  2. Configure SES with your own domain (verified)
  3. Send email with From: [email protected]
  4. SPF PASSES (because of include:amazonses.com)
  5. DMARC p=none -- provider delivers normally

Real-World Cases

Real-world case (CRITICAL): Political party -- DMARC p=none on both domains (DOMAIN_PLACEHOLDER_A, DOMAIN_PLACEHOLDER_B). SPF with include:amazonses.com (any SES account can send as the domain). Total email spoofing.

Pitfalls

IssueSolution
SPF lookup limitDNS has 10 lookup limit for SPF includes
DKIM selector unknownTry common selectors: google, selector1, selector2, 2022, 2023
DMARC reportingrua=mailto: may leak authentication results to third party

Verification

# Verify email spoofing is possible
# Send test email and check headers:
dig +short TXT _dmarc.target.com
# If p=none -> confirmed spoofable

Comments

Markdown supported