Script smtp-open-relay
Script types:
portrule
Categories:
discovery, intrusive, external
Download: https://svn.nmap.org/nmap/scripts/smtp-open-relay.nse
Script 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 occurs while testing the target host, the error will be printed with the list of any combinations that were found prior to the error.
Script Arguments
- smtp-open-relay.ip
Use this to change the IP address to be used (default is the target IP address)
- smtp-open-relay.to
Define the destination email address to be used (without the domain, default is relaytest)
- 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.from
Define the source email address to be used (without the domain, default is antispam)
- smbdomain, smbhash, smbnoguest, smbpassword, smbtype, smbusername
See the documentation for the smbauth library.
Example Usage
nmap --script smtp-open-relay.nse [--script-args smtp-open-relay.domain=<domain>,smtp-open-relay.ip=<address>,...] -p 25,465,587 <host>
Script Output
Host script results: | smtp-open-relay: Server is an open relay (1/16 tests) |_MAIL FROM:<antispam@insecure.org> -> RCPT TO:<relaytest@insecure.org>
Requires
Author:
License: Same as Nmap--See https://nmap.org/book/man-legal.html