OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
network audit of sendmail

From: Mike Tancsa (mikesentex.net)
Date: Thu Mar 06 2003 - 09:41:43 CST


I want to go through my network to a) ensure all my machines are updated
and b)look for customer machines running vulnerable versions of
sendmail. I put together a quick perl script, but its sequential and does
not scan in parallel. (this is slow for 16,000 hosts). Can anyone recommend
a tool to do this ? Essentially all I want to do is connect to port 25,
grab the banner and record it next to the IP address. Nessus seems to be
way overkill and I dont see a way in nmap to record the banner
output. Before I spend time to figure out how to use threads (or fork off
processes) in perl, am I re-inventing the wheel so to speak ? Is there a
script out there to do this ? I tried looking through google but didnt find
anything

        ---Mike

#!/usr/bin/perl -w
use NetAddr::IP;
use Net::SMTP;

my ($range, $i,$totalhosts);

#give it something like scan ./smtp-scan.pl 192.168.0.0/16
$range = $ARGV[0];

print "\ntarget range is $range \n";

my $host = new NetAddr::IP($range);

$i=1;
$totalhosts = $host->num();
print "total hosts $totalhosts \n";

while ($i < $totalhosts) {
         $t="\n";
         $ip = $host->addr;

         if ($smtp = Net::SMTP->new($ip, Helo => 'sendmail-version-check',
Timeout => 10) ){
                 $t = $smtp->banner();
                 $smtp->quit;
         }
         $host=$host+1;
         print "$ip,\t$t";
         $i++;
}

        ---Mike
--------------------------------------------------------------------
Mike Tancsa, tel +1 519 651 3400
Sentex Communications, mikesentex.net
Providing Internet since 1994 www.sentex.net
Cambridge, Ontario Canada www.sentex.net/mike

To Unsubscribe: send mail to majordomoFreeBSD.org
with "unsubscribe freebsd-security" in the body of the message