#!/usr/bin/perl
# Read "ReadMe.txt/.html" for ...

# Needed Files
$|++;
use Socket;
require 'include/banner.rs';
require 'include/logger.rs';
require 'include/count.rs';
require 'nss.conf';

# Plugins
opendir(DIR, "plugin");
while($in=readdir(DIR)) {
    next if ($in=~/^[.]{1,2}/);
    next if !($in=~/\.rs$/);
    require "plugin/$in";
}
closedir(DIR);

# Main Code [-START-]
    &banner;
if((length($ARGV[0])) >= 40 || (length($ARGV[1])) >= 40) { print "ARGV: Line too long.\n"; exit; }
if(!$ARGV[0] || !$ARGV[1]) {
    print "Usage: (perl) $0 <host file> <log file>\n\n";
    exit;
}
$hostfile = $ARGV[0]; $logfile  = $ARGV[1];
print "Loading $hostfile ... "; $count = 0;
count("$hostfile");
foreach $cnn (@cnt) { $count++; }
if($count <= 0) { print "Nothing To Scan!\n\n"; exit; }
print "$count Host(s) Found!\n\n"; $now=1;
foreach $host (@cnt) {
    chomp($host);
    &logs("$logfile","open");
    &last($host);
    print "Scanning $host \($now of $count\)\n";
foreach $plugin (@plugins) {
    $plugin_varb = "scan_$plugin";
    if ($$plugin_varb > 0) {
    &$plugin($host);
    }
}
    $now++;
    &logs("$logfile","close");
}

print "\nEND.\n";
exit;

# Main Code [-END-]