#!/usr/bin/perl
#
# statd.saint
#
# identify operating systems which have
# vulnerable versions of statd
#
# Usage: statd.saint [OS type] target [FW][.PLUS]
#
# Sam Kline, WWDSI, 7/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 = "statd";
$argptr--;

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

$status = "a";
$trusted = "ANY\@ANY";
$trustee = "USER\@$target";

if (!(($ostype =~ /SunOS 5.[7-9]/) ||
      ($ostype =~ /Solaris 2.[7-9]/) ||
      ($ostype =~ /IRIX 6.[2-9]/) ||
      ($ostype =~ /AIX 4.[2-9]/) ||
      ($ostype =~ /AIX [5-9]/) ||
      ($ostype =~ /OpenServer/) ||
      ($ostype =~ /BSD/))) {
	$severity = "zcio";
	$service_output = "rpc statd access";
	$text = "rpc.statd is enabled and may be vulnerable";
	&saint_print();
}
