Detecting open relays
Open relays are insecure mail servers that allow third-party domains to use them without authorization. They are abused by spammers and phishers and they present a serious risk to organizations because public spam blacklists may add them and affect the entire organization, which depends on e-mails reaching its destination.
This recipe shows how to detect open relays by using Nmap.
How to do it...
Open your terminal and enter the following command:
$ nmap -sV --script smtp-open-relay -v <target>
The output returns the number of tests that passed, and the command combination used:
Host script results: | smtp-open-relay: Server is an open relay (1/16 tests) |_MAIL FROM:<antispam@insecure.org> -> RCPT TO:<relaytest@insecure.org>
How it works...
The script smtp-open-relay
was submitted by Arturo 'Buanzo' Busleiman, and it attempts 16 different tests to determine if an SMTP server allows open relaying. If verbose mode is on, it also returns the commands...