Scanning & Enumeration Phase
After reconnaissance, the next step in SMTP penetration testing is active scanning and enumeration. This phase involves directly interacting with the target systems to identify open ports, running services, and potential vulnerabilities.
Port Scanning
SMTP and related services typically operate on specific ports:
- Port 25 - Standard SMTP (often blocked by ISPs)
- Port 465 - SMTP over SSL (SMTPS)
- Port 587 - SMTP with STARTTLS (submission port)
- Port 2525 - Alternative SMTP port used by some providers
Basic Port Scan with Nmap
Scan for common SMTP ports on a target
Service Version Detection
Identify SMTP server software and version
Comprehensive SMTP Scan
Run Nmap's built-in scripts for SMTP
Banner Grabbing
Banner grabbing is the process of extracting information from the server's response banner, which often reveals software, version, and configuration details.
Telnet Banner Grabbing
Connect to SMTP server using Telnet to view banner
SMTP Commands for Enumeration
Basic SMTP commands to gather information
User Enumeration
Some SMTP servers are misconfigured to allow enumeration of valid email addresses, which can be valuable for later phases.
SMTP User Enumeration Tool
Using dedicated tool to validate email addresses
Manual RCPT TO Method
Testing email existence using SMTP conversation
TLS/SSL Configuration Testing
Secure SMTP implementations use TLS/SSL, but misconfigurations can lead to vulnerabilities.
Testing SSL/TLS with SSLyze
Analyze the SMTP server's SSL/TLS configuration
Testing STARTTLS with OpenSSL
Check STARTTLS implementation on submission port
Key Findings from Scanning Phase
During the scanning and enumeration phase, focus on collecting these key pieces of information:
- SMTP server software type and version
- Supported SMTP extensions (STARTTLS, AUTH mechanisms, etc.)
- Available SMTP commands (especially dangerous ones like VRFY)
- SSL/TLS configuration and security
- User account validation capabilities
- Open relay potential
Best Practices for Scanning
- Start with non-intrusive scans and gradually increase intensity
- Monitor for alerts or blocks as aggressive scanning may trigger security measures
- Document every finding methodically for the vulnerability analysis phase
- Respect the agreed scope of testing