#!/usr/bin/perl
# http://kaneda.bohater.net
#
# Very simple mysql [ => 4.1 version] password cracker from wordlist
# v.0.1

use Digest::SHA1 qw(sha1 sha1_hex);

if ( $#ARGV+1 != 2 ) {
  print "Usage: $0 ./wordfile password (without \"*\" char) \n";
  print "Example: $0 ./wordfile.txt 94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29 \n";
  exit;
}

$encoded_password=uc(sha1_hex(sha1(@ARGV[1])));

open (FILE, "< @ARGV[0]");
while (<FILE>)
{
  ($line) = split (/\n/);
  if ( $encoded_password eq uc(sha1_hex(sha1($line))) ) {
    print "Password: $line\n";
  }
}
close (FILE);

