home *** CD-ROM | disk | FTP | other *** search
/ Hackers Handbook - Millenium Edition / Hackers Handbook.iso / files / c_scripts / xcrack.perl < prev    next >
Encoding:
Text File  |  1998-12-05  |  2.2 KB  |  70 lines

  1. #-- Cut Here --
  2. # [ http://www.rootshell.com/ ]
  3. # ---------------------------------------------------
  4. #  xcrack.pl -- Unix/Linux Password Cracker -- V0.11
  5. #   By manicx -- 13th Oct 98 -- email from site
  6. # Get the latest from http://www.infowar.co.uk/manicx
  7. #    usage = perl xcrack.pl PASSWORDFILE WORDFILE
  8. # ---------------------------------------------------
  9. # Only improvements are the splits into subs
  10. # quickest results from using smaller wordfiles under 1 or 2mb
  11. # using .bat files or whatever
  12. # start xcrack.pl
  13. # system("cls");
  14. print ("\n***********************************************");
  15. print ("\n*                  Xcrack V0.11               *");
  16. print ("\n*       http://www.infowar.co.uk/manicx       *");
  17. print ("\n***********************************************\n");
  18.  
  19. # Print simple statement how to use program if no arguments
  20. if ($#ARGV < 0) {
  21.   usage();
  22.   exit;
  23. }
  24.  
  25. $passlist = $ARGV[0];     # Our password File
  26. $wordlist = $ARGV[1];     # Our word list
  27.  
  28. # ------------- Main Start --------------
  29. getpasslist($passlist, $wordlist);
  30.  
  31. #------------------------------------------------------------
  32. sub getpasslist{
  33. open (PWD, $passlist) or die print " No Good Name for password File ", $passlist, "\n";
  34. while (<PWD>)
  35.   {                         # data in password file split by :'s
  36.   ($fname, $encrypted, $uid, $gid, $cos, $home, $shell) = split ( /:/);
  37.   getwordlist($encrypted, $fname);  
  38.   }
  39.   close (PWD);  #closes the password file
  40. }
  41.  
  42. #------------------------------------------------------------
  43. sub getwordlist{
  44. open (WRD, $wordlist) or die print " No Good Name for wordfile ", $wordlist, "\n" ;
  45.      while (<WRD>)
  46.         {
  47.         ($password) = split (/,/);
  48.         chop($password);
  49.         $encword = crypt ($password, $encrypted); 
  50.         if ($encword eq $encrypted)
  51.            {
  52.            print "Account :",$fname, "    \t ------ \aPassword : ", $password, "\n";
  53.            }
  54.          }
  55.          close (WRD);  #closes the wordlist
  56.  }
  57.  
  58. #------------------------------------------------------------
  59. sub usage {
  60.  print "usage = perl xcrack.pl PASSWORDFILE WORDFILE\n";
  61. }
  62.  
  63. print ("\nFinished .......$wordlist");
  64.  
  65. # perl xcrack.txt password.txt words.txt
  66.  
  67. # End xcrack.pl 
  68.  
  69.