Credit:
The information has been provided by arhont.com.
To keep updated with the tool visit the project's homepage at: http://www.arhont.com/ViewPage7422.html
#!/usr/bin/perl
use IO::Socket;
use Net::hostent;
use Getopt::Std;
my $VERSION = "0.1";
my $brutefile = $ARGV[1];
if ($brutefile eq "") {
$brutefile="brutefile.txt";
}
my $max_processes = $ARGV[2];
if ($max_processes eq "") {
$max_processes = 150;
}
sub usage { # print a short 'usage` message and exit
print "usage: perl $0 <tftpserver> <filelist> <maxprocesses> \n";
print "example ./tftpbrute.pl 192.168.66.202 brutefile.txt 100 \n";
exit;
}
use vars qw($opt_h ); # command line options
print "$0, $PgmName, V $VERSION \n";
# handle the commandline options
getopts('h'); # look for -h and -c
$opt_h && usage; # -h print usage message and exit
(!$ARGV[0]) && usage; # no server: print usage message and exit
my $server = $ARGV[0];
if ($server =~ /[a-zA-Z]/) {
my $i = gethostbyname($server);
$server = inet_ntoa($i);
}
print "TFTP file word database: $brutefile \n";
print "TFTP server $server \n";
print "Max processes $max_processes \n";
$timeout = 2;
$port = 69;
$retries=2;
my @pids;
my $npids=0;
open( BRUTEFILE, "<$brutefile") || die " Cannot open the word file : $bruteyfile ! \n";
chomp(@brutefile = <BRUTEFILE>);
close(BRUTEFILE);