#!/usr/bin/perl5.8.4

# bin/bounce.sara
#
# Last Mod 8 Mar 99, 23:30:00 by Bob Todd
#
require 'config/paths.pl';
require 'config/sara.cf';
require 'perl/misc.pl';
require 'perllib/getopts.pl';

$VER_OK   = "1.2.27";
$VER_RED  = "1.2.21";
$service  = "ftp";
$port = "22";

if ($#ARGV < 0) {
   die "Usage: bin/bounce.sara hostname\n";
}

$target = $ARGV[0];

$args = "$target 127.0.0.1 21 21";

die "Can't open $FTPSCAN: $!\n" unless open(FTP, "$TIMEOUT 20 $FTP_SCAN $args 2>&1|");

while(<FTP>) {
   chop;
   if (/connect/) {
         $sid = "FTP-010";
         ($severity,$service_output,$text, $cve) = &get_sid($sid);
	 $status  = "a";
         $trustee = "ANY\@$target";
         $trusted = "ANY\@$target";
         &sara_print();
        }

}

close(FTP);
