Email/Web server type discovery - using PHP or Perl
Fairly simple question (I think): I have a list of domains, and I want to loop through them, hitting their email and web servers, and determining the type of server software running. Something like this:
LOOP over domain list ... Socket connect with www.[domain-name] over Port 80 ... Get return handshake volley of server type > plug into array ... Close socket ... Socket connect with mail.[domain-name] over Port 25 ... Get return handshake volley of server type > plug into array ... Close socket ... END LOOP
I don't know of a discovery mechanism to de开发者_运维问答rive the primary MX from a base domain name - probably not possible. I seem to remember opening and closing sockets needs some grace time (sleep?).
Any advice or example code would be much appreciated - thanks in advance.
-Dean
Actually there is a PHP function for just what you described getmxrr ( http://www.php.net/manual/en/function.getmxrr.php )
There are a bunch of examples in the comments of the manual page.
精彩评论