Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.66 KB | None | 0 0
  1. #!usr/bin/perl
  2. use warnings;
  3. use Net::FTP;
  4. use Net::Telnet ();
  5.  
  6. sub ftp{
  7.   $host=$_[0];
  8.   $user=$_[1];
  9.   $pass=$_[2];
  10.   $user=~s/\n//;
  11.   $pass=~s/\n//;
  12.   $ftp=Net::FTP->new($host)or die "impossibile stabilire una connessione";
  13.   $ftp->login($user,$pass) or die "",$ftp->message;
  14.   return 0;
  15. }
  16.  
  17.  
  18. open PWD,"<",$ARGV[0];
  19. @rpwd=<PWD>;# finito con il file passw
  20. open USR,"<",$ARGV[1];
  21. @rusr=<USR>;
  22. $host=$ARGV[2];
  23. for($i=0;$i<scalar(@rpwd);$i++){
  24.    for($j=0;$j<scalar(@rusr);$j++){
  25.       if((ftp($host,$rusr[$j],$rpwd[$i])==0)){
  26.           print $rusr[$j]-$rpwd[$i];
  27.           exit;
  28.       }
  29.       else{
  30.          print 'notfound';
  31.       }
  32.    }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement