#!/usr/bin/perl

require 'config/paths.pl';
require 'perl/misc.pl';

print "BEGIN\n";
if ($#ARGV < 0) {
   die "Usage: $0 target\n";
}

$port = 4224;
$target = "$ARGV[0]";
$service = "xtelld";

# check whether xtelld version is old
# (old versions allow null "to" field)
$from = "saint";
$to = "";
$tty_dev = "null";
$message = "hello";
$xtell_test = "$from:$to:$tty_dev:$message\r\n";
$args = "-bs \"$xtell_test\" $target $port";
die "Can't open $TCP_SCAN: $!\n" unless open(SCAN, "$TCP_SCAN $args|");

while(<SCAN>) {
    if (/200 OK/) {
	$status = "a";
	$severity = "us";
	$trustee = "ANY\@ANY";
	$trusted = "ANY\@ANY";
	$service_output = "xtell vulnerabilities";
	$text = "multiple vulnerabilities in xtell";
	&saint_print;
    }
}
close(SCAN);
