Skip to content

Instantly share code, notes, and snippets.

@kirsle
Created December 19, 2014 22:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kirsle/8464feb82455322cf491 to your computer and use it in GitHub Desktop.
Save kirsle/8464feb82455322cf491 to your computer and use it in GitHub Desktop.
Just a dead simple "password cracker" that will brute force your plain lowercased passwords (letters only, no numbers or capitals).
#!/usr/bin/perl
# Simple password cracker. Tries every combination of plain lowercased
# passwords, from "a", "b", ..., "z", "aa", "ab", ... "az", "ba", "bb" ...
use 5.18.0;
use Time::HiRes qw(time);
use Digest::MD5 qw(md5_hex);
my $victim = $ARGV[0];
if (!defined $victim) {
print "Hash to crack: ";
chomp(my $victim = <STDIN>);
}
my $start = time();
my $passwd = 'a';
while (1) {
if (md5_hex($passwd) eq $victim) {
my $elapsed = time() - $start;
say "I FOUND IT! Your password was $passwd";
say "It took me $elapsed seconds to crack.";
exit(0);
}
$passwd++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment