Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.