| Crates.io | smtpeek |
| lib.rs | smtpeek |
| version | 1.0.1 |
| created_at | 2025-04-19 13:37:15.008768+00 |
| updated_at | 2025-04-24 10:00:09.159253+00 |
| description | A state-of-the-art SMTP user enumeration tool that efficiently tests for valid email accounts on SMTP servers while evading detection mechanisms. |
| homepage | |
| repository | https://github.com/0xricksanchez/SMTPeek |
| max_upload_size | |
| id | 1640662 |
| size | 1,536,977 |
A high-performance, concurrent SMTP user enumeration tool written in Rust.
Designed for security testing to efficiently discover valid email accounts on SMTP servers.
Includes multiple probing techniques and TLS support (STARTTLS & Implicit).
RCPT TO, VRFY, EXPN, and experimental Timing, Combined, and Stealth methods (-m). Auto mode intelligently selects the best method.-s). Optional certificate verification skip (--tls-skip-verify).-c) and connection pool size (--pool-size).-t), retries (-r), fixed delays (--delay), and experimental adaptive delays (--adaptive-delay).-f json) for machine parsing.-f csv) for spreadsheets.Machine format (-f machine).-L) for real-time results (disables progress bar).-v) for detailed connection/debugging info.-u), optional domain appending (-d), and target randomization (--randomize).--fingerprint).Ctrl+C to stop cleanly.cargo install smtpeek
git clone https://github.com/0xricksanchez/SMTPeek
cd SMTPeek
cargo build --release
# The binary will be in ./target/release/smtpeek
smtpeek [OPTIONS] --user <USER_INPUT> <HOST> [PORT]
<HOST>: Target SMTP server hostname or IP address (required).[PORT]: Target SMTP server port (optional) [default: 25].-u, --user <USER_INPUT>: Username string or path to a file containing usernames.For a full list of options, run:
smtpeek --help
SMTPeek employs several methods to determine if a username/email corresponds to a valid account. Servers respond differently and may disable certain commands, so choosing the right mode (or using Auto) is crucial.
EHLO response.VRFY > EXPN > RCPT TO.MAIL FROM:<sender> followed by RCPT TO:<target_email>. Resets (RSET) between checks on the same connection.RCPT TO.
VRFY <username_or_email> command. Some servers check only the username part.EXPN <list_or_alias> command. Primarily for mailing lists.RCPT TO internally. Compares the response time for the target user against a baseline time for a known-invalid user.VRFY, then EXPN, then RCPT sequentially.MAIL FROM for the RCPT TO check.RCPT TO result.# Test users from list against example.com, use 5 connections
smtpeek -u users.txt -d example.com -c 5 example.com
Example output:
# [...] Banner and Config [...]
[>] Connection to example.com:25 - Establishing connection pool...
[>] Connection to example.com:25 - Validating initial pool connection...
[+] Connection to example.com:25 - Pool connection verified successfully
[!] Running with 5 concurrent connections. High concurrency on slow networks (e.g., VPN) or against rate-limited/slow servers may cause delays or appear unresponsive. Consider lowering concurrency (-c) if issues arise.
[+] validuser@example.com - VALID 250 2.1.5 Ok
Processing... [=================>] 100/100 (0s) Processing completed
------------------------------------------------------------
STATS Total: 100 | Valid: 1 | Invalid: 99 | Unknown: 0
------------------------------------------------------------
------------------------------------------------------------
Valid User Details:
validuser@example.com - 250 2.1.5 Ok
------------------------------------------------------------
# Test users, show results immediately (disables progress bar)
smtpeek -u users.txt -d example.com -L example.com
Example output:
# [...] Banner and Config [...]
[>] Connection to example.com:25 - Establishing connection pool...
[>] Connection to example.com:25 - Pool connection verified successfully
[INFO] Small list in live mode, forcing sequential processing (concurrency=1).
[FAIL] unknown@example.com 550 5.1.1 User unknown
[SUCC] validuser@example.com 250 2.1.5 Ok
# ... more results ...
# --- Results Summary --- (Only shown if live or verbose)
# [+] validuser@example.com - VALID 250 2.1.5 Ok
# [+] unknown@example.com - INVALID 550 5.1.1 User unknown
# --- End Summary ---
------------------------------------------------------------
STATS Total: 100 | Valid: 1 | Invalid: 99 | Unknown: 0
------------------------------------------------------------
------------------------------------------------------------
Valid User Details:
validuser@example.com - 250 2.1.5 Ok
------------------------------------------------------------
# Test list via implicit TLS, save results to JSON (with disabled colors)
smtpeek -C -u users.txt -d example.com -s -p 465 -f json -o results.json secure.example.com
Example output:
[
{
"email": "valid@example.com",
"raw_response": "250 2.1.5 Ok",
"reason": "RCPT accepted",
"response_time_ms": 150,
"status": "Valid",
"username": "valid"
},
{
"email": "invalid@example.com",
"raw_response": "550 5.1.1 User unknown",
"reason": "RCPT rejected",
"response_time_ms": 80,
"status": "Invalid",
"username": "invalid"
}
]
Contributions are welcome! Please feel free to submit issues, open pull requests, or suggest improvements.
While SMTPeek is already a capable tool, here are some areas for potential future improvement:
| Feature / TODO | Description | Usefulness | Complexity | Notes |
|---|---|---|---|---|
| Certificate Verification Control | Implement the --tls-verify flag to allow choosing between skipping verification, using platform checks, or specifying a custom CA bundle. |
💥 Very High | 🟡 Medium | Essential security feature. Requires CLI flag, conditional logic in TLS setup. Custom CA adds complexity. |
| Error Handling & Reporting | Provide more specific error types/messages for different failures (DNS, TCP, TLS, SMTP commands). Map SMTP codes to user-friendly explanations. | ✨ High | 🟡 Medium | Improves usability significantly. Involves mapping errors, parsing responses. Can be done incrementally. |
| Documentation | Expand examples, add CONTRIBUTING.md, document nuances of modes/options more deeply. |
💥 Very High | 🟢 Low-Med | Crucial for users. Examples/basic explanations are Low, deep dives/CONTRIBUTING are Medium. |
| Evasion Techniques (Basic) | Implement simple evasion tactics like randomized delays (jitter), randomized HELO/MAIL FROM values behind the --evasion flag. |
👍 Medium | 🟡 Medium | Useful for basic IDS/rate limits. Requires rand crate, conditional logic. |
| Username Mangling/Generation | Add options to generate variations of usernames (e.g., jsmith, john.smith) from a base list or pattern. |
✨ High | 🟡 Medium | Increases effectiveness significantly. Requires defining rules, generation logic, integration. |
| Configuration File | Allow specifying common options via a configuration file (e.g., TOML, YAML) instead of only command-line flags. | ✨ High | 🟡 Medium-Hi | Very convenient for power users. Requires config crate, parsing, layering logic. |
| Explicit Implicit TLS Flag | Add clearer control for Implicit TLS (e.g., --implicit-tls or --tls=implicit), especially for non-standard ports. |
👍 Medium | 🟢 Low-Med | Improves clarity/correctness for non-standard ports. Requires CLI change, logic adjustment. |
| Connection Pool Validation (NOOP Tuning) | Make the NOOP check for reused connections configurable (enable/disable/timeout). Ensure pool permit logic is robust. | 👍 Medium | 🟢 Low | Makes pool more robust. Adding config flag is Low. More complex NOOP handling is Low-Med. |
| Evasion Techniques (Advanced) | Implement more complex evasion like connection rotation (configurable lifespan/usage count) or sophisticated timing adjustments. | ✨ High | 🔴 High | Harder to implement correctly and test effectiveness. Might require significant changes. |
| IPv6 Literal TLS Handling | Investigate and potentially warn or adjust SNI behavior when connecting via TLS directly to an IPv6 literal address. | 🤷 Low-Med | 🟡 Medium | Edge case correction. Requires IP detection, conditional SNI handling, potential rustls config. |
Advanced Timing Analysis (--mode Timing) |
Significantly refine the --mode Timing heuristics with better statistics, baseline methods, and configurable thresholds. |
🤷 Low-Med | 🔴 High | Difficult to make reliable, prone to errors. Requires significant stats/heuristics work. |
⚠️ Warning: This tool is intended for authorized security testing and educational purposes only.
The developers assume no liability and are not responsible for any misuse or damage caused by this tool.
This project is licensed under the Apache-2.0 License - see the LICENSE file for details.