Summary
Attempts to relay mail by issuing a predefined combination of SMTP commands. The goal of this script is to tell if a SMTP server is vulnerable to mail relaying.
An SMTP server that works as an open relay, is a email server that does not verify if the user is authorised to send email from the specified email address. Therefore, users would be able to send email originating from any third-party email address that they want.
The checks are done based in combinations of MAIL FROM and RCPT TO commands. The list is hardcoded in the source file. The script will output all the working combinations that the server allows if nmap is in verbose mode otherwise the script will print the number of successful tests. The script will not output if the server requires authentication.
If debug is enabled and an error occurrs while testing the target host, the error will be printed with the list of any combinations that were found prior to the error.
SYNTAX:
smtp-open-relay.ip: Use this to change the IP address to be used (default is the target IP address)
smtp.domain: or smtp-open-relay.domain Define the domain to be used in the anti-spam tests and EHLO command (default is nmap.scanme.org)
smtp-open-relay.to: Define the destination email address to be used (without the domain, default is relaytest)
smtp-open-relay.from: Define the source email address to be used (without the domain, default is antispam)