Lab 1: Basic SMTP Enumeration
This lab will guide you through the process of setting up a vulnerable SMTP server and practicing basic enumeration techniques to gather information about the server and its users.
Lab Objectives
- Set up a vulnerable SMTP server for testing
- Practice banner grabbing to identify server software
- Use SMTP commands to enumerate valid users
- Discover information about the mail server configuration
- Document findings in a structured format
Lab Environment Setup
For this lab, you'll need:
- A virtualization platform (VirtualBox, VMware, etc.)
- An attacking machine (Kali Linux recommended)
- A target machine (Ubuntu Server recommended)
- An isolated virtual network
Step 1: Install Postfix on Target
Set up a vulnerable Postfix server on Ubuntu
Step 2: Create Test Users
Add some test users to the target system
Step 3: Banner Grabbing
Connect to the SMTP server and grab the banner
Step 4: Basic SMTP Commands
Test basic SMTP commands to gather information
Step 5: User Enumeration with VRFY
Use the VRFY command to check if users exist
Step 6: Automated User Enumeration
Use smtp-user-enum tool for more efficient enumeration
Step 7: Enumerating Server Capabilities
Use EHLO to discover supported extensions
Step 8: Testing for Email Relay
Check if the server allows unauthorized relaying
Lab Findings Documentation
As part of this lab, document your findings in a structured format. Include:
- Server Information
- IP Address: 192.168.56.20
- Hostname: mail.lab.local
- Software: Postfix on Ubuntu
- Supported Commands
- AUTH, HELO, EHLO, MAIL, RCPT, DATA
- NOOP, QUIT, RSET, HELP, VRFY
- Supported Extensions
- PIPELINING, SIZE, VRFY, ETRN, STARTTLS
- ENHANCEDSTATUSCODES, 8BITMIME, DSN, SMTPUTF8
- Enumerated Users
- admin, john, alice, root, postmaster
- Security Issues
- VRFY command enabled (allows user enumeration)
- Banner reveals software and OS information
Lab Challenges
To further practice your skills, try these additional challenges:
- Use the EXPN command to see if it provides different information than VRFY
- Try the RCPT TO command as another method of user enumeration
- Use Nmap's smtp-enum-users script to automate the enumeration process
- Create a custom wordlist of potential usernames based on the organization's naming convention
- Document how you would secure this server to prevent the enumeration techniques you've used
Security Implications
The information gathered in this lab could be used by an attacker to:
- Build a list of valid email addresses for phishing attacks
- Identify potential usernames for password guessing attacks
- Target specific software vulnerabilities based on the server version
- Map the email infrastructure for more sophisticated attacks
Remediation Recommendations
To secure an SMTP server against these enumeration techniques:
- Disable the VRFY command (disable_vrfy_command = yes)
- Minimize information in the banner
- Implement rate limiting to prevent automated enumeration
- Use strong authentication mechanisms
- Regularly update the SMTP server software