Detecting backdoor SMTP servers
Compromised servers might have rogue SMTP servers installed and abused by spammers. System administrators can use Nmap to help them monitor mail servers in their network.
This recipe shows how to detect rogue SMTP servers by using Nmap.
How to do it...
Open your terminal and enter the following Nmap command:
$ nmap -sV --script smtp-strangeport <target>
If a mail server is found on a non-standard port, it will be reported in the script output section:
PORT STATE SERVICE VERSION 9999/tcp open ssl/smtp Postfix smtpd |_smtp-strangeport: Mail server on unusual port: possible malware
How it works...
The script smtp-strangeport
was submitted by Diman Todorov. It detects SMTP servers running on non-standard ports, which is an indicator of rogue mail servers. If an SMTP server is found running on a port other than 25, 465, and 587, this script will notify you.
The argument -sV --script smtp-strangeport
makes Nmap start service detection and launch the NSE...