#!/usr/bin/perl
#
# sadmind.saint
#
# identify operating systems which have
# vulnerable versions of sadmind
#
# Usage: sadmind.saint [OS type] target [FW][.PLUS]
#
# Sam Kline, WWDSI, 6/00
#
require 'perl/misc.pl';

print "BEGIN\n";
$argptr = $#ARGV;
if (($ARGV[$argptr] eq "FW") ||
    ($ARGV[$argptr] eq ".PLUS") ||
    ($ARGV[$argptr] eq "FW.PLUS")) { $argptr--; }

$target = $ARGV[$argptr];
$service = "sadmind";
$argptr--;

if ($argptr < 0) {
  $ostype = "UNKNOWN";
} else {
  $ostype = join (" ", @ARGV[0..$argptr]);
}

if (($ostype eq "SunOS") ||
    ($ostype eq "SunOS 5") ||
    ($ostype =~ /SunOS 5.[0-7]/) ||
    ($ostype =~ /Solaris 2.[0-7]/) ||
    ($ostype =~ /Solaris 7/) ||
    ($ostype eq "UNKNOWN")) {
	$status = "a";
	$severity = "bo";
	$trusted = "ANY@$target";
	$trustee = "ANY@$target";
	$service_output = "sadmind";
	$text = "sadmind may be vulnerable to buffer overflow";
	&saint_print();
}
