#!/usr/bin/perl5.8.4
#
#
# cim.sara: version 2.0 Jan 31, 13:00:00 2001, last mod by todd
# cim.sara: version 2.1 May 14, 13:17:00 2001, last mod by todd
#
require 'config/paths.pl';
require 'perl/misc.pl';
require 'perllib/getopts.pl';

&Getopts("a:v");

if ($#ARGV < 0) {
   die "Usage: cim.sara [-v] target\n";
}

$target = "$ARGV[0]";
$good_v = "2.2";
$port	= 2301;
$status = "a";
$trustee = "";
$trusted = "";
$service_output = "";
$mymajor = 0;
$myminor = 0;
$args = "-w 15 -bs  'GET / HTTP/1.0\n\n' $target $port";
die "Can't open $TCP_SCAN: $!\n" unless open(SCAN, "$TCP_SCAN $args|");
while(<SCAN>) {
   print "$_" if $opt_v;
   if(/&copy; [0-9]+-([0-9]+) Compaq/) {
     $copy_date = $1;
   }
     if ($copy_date < 2001) {
	$status="a";
	$service = "cpq-wbem";
	$trustee="ANY\@ANY";
	$trusted="ANY\@ANY";
	$service_output="Compaq Insight Manager version";
	$text="Multiple CIM vulnerabilities possible";
	$severity="ycio";
	&sara_print();
     }
}
close (SCAN);
